Skip to content

Commit ff83fec

Browse files
committed
Merge tag 'drm-fixes-2023-01-20' of git://anongit.freedesktop.org/drm/drm
Pull drm fixes from Dave Airlie: "Just a pretty regular week for this stage of things, amdgpu and i915, along with some msm and misc others. fb-helper: - switcheroo fix msm: - kexec shutdown fix - fix potential double free i915: - Reject display plane with height == 0 - re-disable RC6p on Sandy Bridge - Fix hugepages' selftest - DG2 hw workarounds - switcheroo fix vc4: - fix a memory leak panfrost: - Kconfig fix amdgpu: - Fix display scaling - Fix RN/CZN power reporting on some firmware versions - Colorspace fixes - Fix resource freeing in error case in CS IOCTL - Fix warning on driver unload - GC11 fixes - DCN 3.1.4/5 S/G display workarounds" * tag 'drm-fixes-2023-01-20' of git://anongit.freedesktop.org/drm/drm: (24 commits) drm/amd/display: disable S/G display on DCN 3.1.4 drm/amd/display: disable S/G display on DCN 3.1.5 drm/amdgpu: allow multipipe policy on ASICs with one MEC drm/amdgpu: correct MEC number for gfx11 APUs drm/amd/display: fix issues with driver unload drm/amdgpu: fix amdgpu_job_free_resources v2 drm/amd/display: Fix COLOR_SPACE_YCBCR2020_TYPE matrix drm/amd/display: Calculate output_color_space after pixel encoding adjustment drm/amdgpu: fix cleaning up reserved VMID on release drm/amdgpu: Correct the power calcultion for Renior/Cezanne. drm/amd/display: Fix set scaling doesn's work drm/i915: Remove unused variable drm/i915/dg2: Introduce Wa_18019271663 drm/i915/dg2: Introduce Wa_18018764978 drm/fb-helper: Set framebuffer for vga-switcheroo clients drm/i915: Allow switching away via vga-switcheroo if uninitialized drm/i915/selftests: Unwind hugepages to drop wakeref on error drm/i915: re-disable RC6p on Sandy Bridge drm/panfrost: fix GENERIC_ATOMIC64 dependency drm/i915/display: Check source height is > 0 ...
2 parents 35929da + 3f30a6e commit ff83fec

File tree

22 files changed

+92
-42
lines changed

22 files changed

+92
-42
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,9 @@ static bool amdgpu_gfx_is_compute_multipipe_capable(struct amdgpu_device *adev)
156156
return amdgpu_compute_multipipe == 1;
157157
}
158158

159+
if (adev->ip_versions[GC_HWIP][0] > IP_VERSION(9, 0, 0))
160+
return true;
161+
159162
/* FIXME: spreading the queues across pipes causes perf regressions
160163
* on POLARIS11 compute workloads */
161164
if (adev->asic_type == CHIP_POLARIS11)

drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,7 @@ void amdgpu_vmid_free_reserved(struct amdgpu_device *adev,
497497
!--id_mgr->reserved_use_count) {
498498
/* give the reserved ID back to normal round robin */
499499
list_add(&id_mgr->reserved->list, &id_mgr->ids_lru);
500+
id_mgr->reserved = NULL;
500501
}
501502
vm->reserved_vmid[vmhub] = false;
502503
mutex_unlock(&id_mgr->lock);

drivers/gpu/drm/amd/amdgpu/amdgpu_job.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,14 @@ void amdgpu_job_free_resources(struct amdgpu_job *job)
161161
struct dma_fence *f;
162162
unsigned i;
163163

164-
/* use sched fence if available */
165-
f = job->base.s_fence ? &job->base.s_fence->finished : &job->hw_fence;
164+
/* Check if any fences where initialized */
165+
if (job->base.s_fence && job->base.s_fence->finished.ops)
166+
f = &job->base.s_fence->finished;
167+
else if (job->hw_fence.ops)
168+
f = &job->hw_fence;
169+
else
170+
f = NULL;
171+
166172
for (i = 0; i < job->num_ibs; ++i)
167173
amdgpu_ib_free(ring->adev, &job->ibs[i], f);
168174
}

drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1287,17 +1287,24 @@ static int gfx_v11_0_sw_init(void *handle)
12871287

12881288
switch (adev->ip_versions[GC_HWIP][0]) {
12891289
case IP_VERSION(11, 0, 0):
1290-
case IP_VERSION(11, 0, 1):
12911290
case IP_VERSION(11, 0, 2):
12921291
case IP_VERSION(11, 0, 3):
1293-
case IP_VERSION(11, 0, 4):
12941292
adev->gfx.me.num_me = 1;
12951293
adev->gfx.me.num_pipe_per_me = 1;
12961294
adev->gfx.me.num_queue_per_pipe = 1;
12971295
adev->gfx.mec.num_mec = 2;
12981296
adev->gfx.mec.num_pipe_per_mec = 4;
12991297
adev->gfx.mec.num_queue_per_pipe = 4;
13001298
break;
1299+
case IP_VERSION(11, 0, 1):
1300+
case IP_VERSION(11, 0, 4):
1301+
adev->gfx.me.num_me = 1;
1302+
adev->gfx.me.num_pipe_per_me = 1;
1303+
adev->gfx.me.num_queue_per_pipe = 1;
1304+
adev->gfx.mec.num_mec = 1;
1305+
adev->gfx.mec.num_pipe_per_mec = 4;
1306+
adev->gfx.mec.num_queue_per_pipe = 4;
1307+
break;
13011308
default:
13021309
adev->gfx.me.num_me = 1;
13031310
adev->gfx.me.num_pipe_per_me = 1;

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1503,8 +1503,6 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
15031503
case IP_VERSION(3, 0, 1):
15041504
case IP_VERSION(3, 1, 2):
15051505
case IP_VERSION(3, 1, 3):
1506-
case IP_VERSION(3, 1, 4):
1507-
case IP_VERSION(3, 1, 5):
15081506
case IP_VERSION(3, 1, 6):
15091507
init_data.flags.gpu_vm_support = true;
15101508
break;
@@ -1730,10 +1728,6 @@ static void amdgpu_dm_fini(struct amdgpu_device *adev)
17301728
adev->dm.vblank_control_workqueue = NULL;
17311729
}
17321730

1733-
for (i = 0; i < adev->dm.display_indexes_num; i++) {
1734-
drm_encoder_cleanup(&adev->dm.mst_encoders[i].base);
1735-
}
1736-
17371731
amdgpu_dm_destroy_drm_device(&adev->dm);
17381732

17391733
#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY)
@@ -5311,8 +5305,6 @@ static void fill_stream_properties_from_drm_display_mode(
53115305

53125306
timing_out->aspect_ratio = get_aspect_ratio(mode_in);
53135307

5314-
stream->output_color_space = get_output_color_space(timing_out);
5315-
53165308
stream->out_transfer_func->type = TF_TYPE_PREDEFINED;
53175309
stream->out_transfer_func->tf = TRANSFER_FUNCTION_SRGB;
53185310
if (stream->signal == SIGNAL_TYPE_HDMI_TYPE_A) {
@@ -5323,6 +5315,8 @@ static void fill_stream_properties_from_drm_display_mode(
53235315
adjust_colour_depth_from_display_info(timing_out, info);
53245316
}
53255317
}
5318+
5319+
stream->output_color_space = get_output_color_space(timing_out);
53265320
}
53275321

53285322
static void fill_audio_info(struct audio_info *audio_info,
@@ -9530,8 +9524,8 @@ static int amdgpu_dm_atomic_check(struct drm_device *dev,
95309524
goto fail;
95319525
}
95329526

9533-
if (dm_old_con_state->abm_level !=
9534-
dm_new_con_state->abm_level)
9527+
if (dm_old_con_state->abm_level != dm_new_con_state->abm_level ||
9528+
dm_old_con_state->scaling != dm_new_con_state->scaling)
95359529
new_crtc_state->connectors_changed = true;
95369530
}
95379531

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,6 @@ static const struct drm_connector_helper_funcs dm_dp_mst_connector_helper_funcs
468468
static void amdgpu_dm_encoder_destroy(struct drm_encoder *encoder)
469469
{
470470
drm_encoder_cleanup(encoder);
471-
kfree(encoder);
472471
}
473472

474473
static const struct drm_encoder_funcs amdgpu_dm_encoder_funcs = {

drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ static const struct out_csc_color_matrix_type output_csc_matrix[] = {
9090
{ 0xE00, 0xF349, 0xFEB7, 0x1000, 0x6CE, 0x16E3,
9191
0x24F, 0x200, 0xFCCB, 0xF535, 0xE00, 0x1000} },
9292
{ COLOR_SPACE_YCBCR2020_TYPE,
93-
{ 0x1000, 0xF149, 0xFEB7, 0x0000, 0x0868, 0x15B2,
94-
0x01E6, 0x0000, 0xFB88, 0xF478, 0x1000, 0x0000} },
93+
{ 0x1000, 0xF149, 0xFEB7, 0x1004, 0x0868, 0x15B2,
94+
0x01E6, 0x201, 0xFB88, 0xF478, 0x1000, 0x1004} },
9595
{ COLOR_SPACE_YCBCR709_BLACK_TYPE,
9696
{ 0x0000, 0x0000, 0x0000, 0x1000, 0x0000, 0x0000,
9797
0x0000, 0x0200, 0x0000, 0x0000, 0x0000, 0x1000} },

drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1171,6 +1171,7 @@ static int renoir_get_smu_metrics_data(struct smu_context *smu,
11711171
int ret = 0;
11721172
uint32_t apu_percent = 0;
11731173
uint32_t dgpu_percent = 0;
1174+
struct amdgpu_device *adev = smu->adev;
11741175

11751176

11761177
ret = smu_cmn_get_metrics_table(smu,
@@ -1196,7 +1197,11 @@ static int renoir_get_smu_metrics_data(struct smu_context *smu,
11961197
*value = metrics->AverageUvdActivity / 100;
11971198
break;
11981199
case METRICS_AVERAGE_SOCKETPOWER:
1199-
*value = (metrics->CurrentSocketPower << 8) / 1000;
1200+
if (((adev->ip_versions[MP1_HWIP][0] == IP_VERSION(12, 0, 1)) && (adev->pm.fw_version >= 0x40000f)) ||
1201+
((adev->ip_versions[MP1_HWIP][0] == IP_VERSION(12, 0, 0)) && (adev->pm.fw_version >= 0x373200)))
1202+
*value = metrics->CurrentSocketPower << 8;
1203+
else
1204+
*value = (metrics->CurrentSocketPower << 8) / 1000;
12001205
break;
12011206
case METRICS_TEMPERATURE_EDGE:
12021207
*value = (metrics->GfxTemperature / 100) *

drivers/gpu/drm/drm_fb_helper.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@
3030
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
3131

3232
#include <linux/console.h>
33+
#include <linux/pci.h>
3334
#include <linux/sysrq.h>
35+
#include <linux/vga_switcheroo.h>
3436

3537
#include <drm/drm_atomic.h>
3638
#include <drm/drm_drv.h>
@@ -1909,6 +1911,11 @@ static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper,
19091911
return ret;
19101912

19111913
strcpy(fb_helper->fb->comm, "[fbcon]");
1914+
1915+
/* Set the fb info for vgaswitcheroo clients. Does nothing otherwise. */
1916+
if (dev_is_pci(dev->dev))
1917+
vga_switcheroo_client_fb_set(to_pci_dev(dev->dev), fb_helper->info);
1918+
19121919
return 0;
19131920
}
19141921

drivers/gpu/drm/i915/display/skl_universal_plane.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1627,7 +1627,7 @@ static int skl_check_main_surface(struct intel_plane_state *plane_state)
16271627
u32 offset;
16281628
int ret;
16291629

1630-
if (w > max_width || w < min_width || h > max_height) {
1630+
if (w > max_width || w < min_width || h > max_height || h < 1) {
16311631
drm_dbg_kms(&dev_priv->drm,
16321632
"requested Y/RGB source size %dx%d outside limits (min: %dx1 max: %dx%d)\n",
16331633
w, h, min_width, max_width, max_height);

0 commit comments

Comments
 (0)