drm/i915/dsb: Fix DSB command buffer size checks
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 16 Dec 2022 00:38:01 +0000 (02:38 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 13 Jan 2023 14:48:57 +0000 (16:48 +0200)
commit488dd0758366213ab85701d7e687458cfa598c49
tree3c8122100ab35c6294784704e8404ca356516677
parent3229319e446cafe51e8d3060bdf39203b95a5c98
drm/i915/dsb: Fix DSB command buffer size checks

free_pos is in dwords, DSB_BUF_SIZE in bytes. Directly
comparing the two is nonsense. Fix it up, and make sure
we also account for the 8byte alignment requirement for
each instruction, and also assume that each instruction
normally eats two dwords.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221216003810.13338-5-ville.syrjala@linux.intel.com
Reviewed-by: Animesh Manna <animesh.manna@intel.com>
drivers/gpu/drm/i915/display/intel_dsb.c