Skip to content

Commit bcdcae6

Browse files
committed
drm/i915/dsb: Allocate command buffer from local memory
Using system memory for the DSB command buffer doesn't appear to work. On DG2 it seems like the hardware internally replaces the actual memory reads with zeroes, and so we end up executing a bunch of NOOPs instead of whatever commands we put in the buffer. To determine that I measured the time it takes to execute the instructions, and the results are always more or less consistent with executing a buffer full of NOOPs from local memory. Another theory I considered was some kind of cache coherency issue. Looks like i915_gem_object_pin_map_unlocked() will in fact give you a WB mapping for system memory on DGFX regardless of what mapping mode was requested (WC in case of the DSB code). But clflush did not change the behaviour at all, so that theory seems moot. On DG1 it looks like the hardware might actually be fetching data from system memory as the logs indicate that we just get underruns. But that is equally bad, so doesn't look like we can really use system memory on DG1 either. Thus always allocate the DSB command buffer from local memory on discrete GPUs. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20231009132204.15098-1-ville.syrjala@linux.intel.com Reviewed-by: Uma Shankar <uma.shankar@intel.com>
1 parent a2cd15c commit bcdcae6

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66

77
#include "gem/i915_gem_internal.h"
8+
#include "gem/i915_gem_lmem.h"
89

910
#include "i915_drv.h"
1011
#include "i915_irq.h"
@@ -461,7 +462,11 @@ struct intel_dsb *intel_dsb_prepare(const struct intel_crtc_state *crtc_state,
461462
/* ~1 qword per instruction, full cachelines */
462463
size = ALIGN(max_cmds * 8, CACHELINE_BYTES);
463464

464-
obj = i915_gem_object_create_internal(i915, PAGE_ALIGN(size));
465+
if (HAS_LMEM(i915))
466+
obj = i915_gem_object_create_lmem(i915, PAGE_ALIGN(size),
467+
I915_BO_ALLOC_CONTIGUOUS);
468+
else
469+
obj = i915_gem_object_create_internal(i915, PAGE_ALIGN(size));
465470
if (IS_ERR(obj))
466471
goto out_put_rpm;
467472

0 commit comments

Comments
 (0)