[PATCH 09/21] drm/omap: handle mismatching color format and buffer width

Daniel Vetter daniel at ffwll.ch
Fri Feb 27 07:47:22 PST 2015


On Fri, Feb 27, 2015 at 02:40:20PM +0000, Daniel Stone wrote:
> On 27 February 2015 at 13:01, Daniel Vetter <daniel at ffwll.ch> wrote:
> > On Thu, Feb 26, 2015 at 03:20:17PM +0200, Tomi Valkeinen wrote:
> >> omapdrm doesn't check if the width of the framebuffer and the color
> >> diff --git a/drivers/gpu/drm/omapdrm/omap_fb.c b/drivers/gpu/drm/omapdrm/omap_fb.c
> >> index 2975096abdf5..bf98580223d0 100644
> >> --- a/drivers/gpu/drm/omapdrm/omap_fb.c
> >> +++ b/drivers/gpu/drm/omapdrm/omap_fb.c
> >> @@ -463,6 +463,14 @@ struct drm_framebuffer *omap_framebuffer_init(struct drm_device *dev,
> >>                       goto fail;
> >>               }
> >>
> >> +             if (mode_cmd->width % format->planes[i].stride_bpp != 0) {
> >
> > width is in pixels. No idea what you're trying to check here, but this
> > probably isn't it.
> 
> stride_bpp is very misnamed: it is the bits per pixel for that plane,
> and not stride at all. I think the check should in fact be be (pitch %
> format->planes[i].stride_bpp), which would achieve the desired result,
> i.e. that the stride can be expressed as an integer number of pixels.

I meant that mode_cmd->width is in pixels and so totally not what you want
to check here. It probably should be mode_cmd->pitches[i].
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch


More information about the dri-devel mailing list