Skip to content

Commit 0375af8

Browse files
author
Herton R. Krzesinski
committed
Merge: DG2 DRM Backport
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/1701 Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2041690 Backport relevant patches to make Intel DG2 Graphics card working Depends: !1699 Omitted-fix: 665ae9c Omitted-fix: 5d53f4c Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com> Approved-by: Michel Dänzer <mdaenzer@redhat.com> Approved-by: John B. Wyatt IV <jwyatt@redhat.com> Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
2 parents dc71649 + 2124912 commit 0375af8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+2850
-404
lines changed

drivers/gpu/drm/i915/Makefile

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -307,15 +307,18 @@ i915-y += \
307307

308308
i915-y += i915_perf.o
309309

310-
# Protected execution platform (PXP) support
311-
i915-$(CONFIG_DRM_I915_PXP) += \
310+
# Protected execution platform (PXP) support. Base support is required for HuC
311+
i915-y += \
312312
pxp/intel_pxp.o \
313+
pxp/intel_pxp_tee.o \
314+
pxp/intel_pxp_huc.o
315+
316+
i915-$(CONFIG_DRM_I915_PXP) += \
313317
pxp/intel_pxp_cmd.o \
314318
pxp/intel_pxp_debugfs.o \
315319
pxp/intel_pxp_irq.o \
316320
pxp/intel_pxp_pm.o \
317-
pxp/intel_pxp_session.o \
318-
pxp/intel_pxp_tee.o
321+
pxp/intel_pxp_session.o
319322

320323
# Post-mortem debug and GPU hang state capture
321324
i915-$(CONFIG_DRM_I915_CAPTURE_ERROR) += i915_gpu_error.o

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -908,7 +908,7 @@ static u32 get_allowed_dc_mask(const struct drm_i915_private *dev_priv,
908908
return 0;
909909

910910
if (IS_DG2(dev_priv))
911-
max_dc = 0;
911+
max_dc = 1;
912912
else if (IS_DG1(dev_priv))
913913
max_dc = 3;
914914
else if (DISPLAY_VER(dev_priv) >= 12)

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@
5252

5353
#define DISPLAY_VER12_DMC_MAX_FW_SIZE ICL_DMC_MAX_FW_SIZE
5454

55-
#define DG2_DMC_PATH DMC_PATH(dg2, 2, 06)
56-
#define DG2_DMC_VERSION_REQUIRED DMC_VERSION(2, 06)
55+
#define DG2_DMC_PATH DMC_PATH(dg2, 2, 07)
56+
#define DG2_DMC_VERSION_REQUIRED DMC_VERSION(2, 07)
5757
MODULE_FIRMWARE(DG2_DMC_PATH);
5858

5959
#define ADLP_DMC_PATH DMC_PATH(adlp, 2, 16)

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

Lines changed: 44 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,40 +26,66 @@ intel_pin_fb_obj_dpt(struct drm_framebuffer *fb,
2626
struct drm_device *dev = fb->dev;
2727
struct drm_i915_private *dev_priv = to_i915(dev);
2828
struct drm_i915_gem_object *obj = intel_fb_obj(fb);
29+
struct i915_gem_ww_ctx ww;
2930
struct i915_vma *vma;
3031
u32 alignment;
3132
int ret;
3233

34+
/*
35+
* We are not syncing against the binding (and potential migrations)
36+
* below, so this vm must never be async.
37+
*/
38+
GEM_WARN_ON(vm->bind_async_flags);
39+
3340
if (WARN_ON(!i915_gem_object_is_framebuffer(obj)))
3441
return ERR_PTR(-EINVAL);
3542

3643
alignment = 4096 * 512;
3744

3845
atomic_inc(&dev_priv->gpu_error.pending_fb_pin);
3946

40-
ret = i915_gem_object_lock_interruptible(obj, NULL);
41-
if (!ret) {
47+
for_i915_gem_ww(&ww, ret, true) {
48+
ret = i915_gem_object_lock(obj, &ww);
49+
if (ret)
50+
continue;
51+
52+
if (HAS_LMEM(dev_priv)) {
53+
unsigned int flags = obj->flags;
54+
55+
/*
56+
* For this type of buffer we need to able to read from the CPU
57+
* the clear color value found in the buffer, hence we need to
58+
* ensure it is always in the mappable part of lmem, if this is
59+
* a small-bar device.
60+
*/
61+
if (intel_fb_rc_ccs_cc_plane(fb) >= 0)
62+
flags &= ~I915_BO_ALLOC_GPU_ONLY;
63+
ret = __i915_gem_object_migrate(obj, &ww, INTEL_REGION_LMEM_0,
64+
flags);
65+
if (ret)
66+
continue;
67+
}
68+
4269
ret = i915_gem_object_set_cache_level(obj, I915_CACHE_NONE);
43-
i915_gem_object_unlock(obj);
44-
}
45-
if (ret) {
46-
vma = ERR_PTR(ret);
47-
goto err;
48-
}
70+
if (ret)
71+
continue;
4972

50-
vma = i915_vma_instance(obj, vm, view);
51-
if (IS_ERR(vma))
52-
goto err;
73+
vma = i915_vma_instance(obj, vm, view);
74+
if (IS_ERR(vma)) {
75+
ret = PTR_ERR(vma);
76+
continue;
77+
}
5378

54-
if (i915_vma_misplaced(vma, 0, alignment, 0)) {
55-
ret = i915_vma_unbind_unlocked(vma);
56-
if (ret) {
57-
vma = ERR_PTR(ret);
58-
goto err;
79+
if (i915_vma_misplaced(vma, 0, alignment, 0)) {
80+
ret = i915_vma_unbind(vma);
81+
if (ret)
82+
continue;
5983
}
60-
}
6184

62-
ret = i915_vma_pin(vma, 0, alignment, PIN_GLOBAL);
85+
ret = i915_vma_pin_ww(vma, &ww, 0, alignment, PIN_GLOBAL);
86+
if (ret)
87+
continue;
88+
}
6389
if (ret) {
6490
vma = ERR_PTR(ret);
6591
goto err;

0 commit comments

Comments
 (0)