Skip to content

Commit a40e65f

Browse files
committed
drm/gem-framebuffer: Don't validate buffer size when non-linear
pitch*height does not necessarily equate to buffer size if the buffer is non-linear, so the buffer validation is invalid. Disable it for non-linear buffers. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
1 parent 71f493d commit a40e65f

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

drivers/gpu/drm/drm_gem_framebuffer_helper.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,9 @@ int drm_gem_fb_init_with_funcs(struct drm_device *dev,
182182
goto err_gem_object_put;
183183
}
184184

185+
if (mode_cmd->modifier[i] != DRM_FORMAT_MOD_LINEAR)
186+
continue;
187+
185188
min_size = (height - 1) * mode_cmd->pitches[i]
186189
+ drm_format_info_min_pitch(info, i, width)
187190
+ mode_cmd->offsets[i];

0 commit comments

Comments
 (0)