Skip to content

Commit 2124912

Browse files
author
Jocelyn Falempe
committed
drm/i915/display: consider DG2_RC_CCS_CC when migrating buffers
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2041690 Upstream Status: git://anongit.freedesktop.org/drm/drm commit e3afc69 Author: Matthew Auld <matthew.auld@intel.com> AuthorDate: Tue Oct 4 14:19:15 2022 +0100 Commit: Matthew Auld <matthew.auld@intel.com> CommitDate: Wed Oct 5 09:02:45 2022 +0100 For these types of display buffers, we need to able to CPU access some part of the backing memory in prepare_plane_clear_colors(). As a result we need to ensure we always place in the mappable part of lmem, which becomes necessary on small-bar systems. v2(Nirmoy & Ville): - Add some commentary for why we need to CPU access the buffer. - Split out the other changes, so we just consider the display change here. v3: - Handle this in the dpt path. v4(Ville): - Drop the intel_fb_rc_ccs_cc_plane() sanity check in pin_and_fence_fb_obj(), since we can also trigger this on DG1 it seems. Fixes: eb1c535 ("drm/i915: turn on small BAR support") Reported-by: Jianshui Yu <jianshui.yu@intel.com> Signed-off-by: Matthew Auld <matthew.auld@intel.com> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Cc: Nirmoy Das <nirmoy.das@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Acked-by: Nirmoy Das <nirmoy.das@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20221004131916.233474-4-matthew.auld@intel.com Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
1 parent 3499b75 commit 2124912

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

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

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,18 @@ intel_pin_fb_obj_dpt(struct drm_framebuffer *fb,
5050
continue;
5151

5252
if (HAS_LMEM(dev_priv)) {
53-
ret = i915_gem_object_migrate(obj, &ww, INTEL_REGION_LMEM_0);
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);
5465
if (ret)
5566
continue;
5667
}

0 commit comments

Comments
 (0)