On Tue, Mar 20, 2018 at 09:01:11PM -0400, Rob Clark wrote: > On Tue, Mar 20, 2018 at 6:58 PM, Daniel Stone <daniels@xxxxxxxxxxxxx> wrote: > > getfb can only return a single plane, so reject attempts to use it with > > multi-plane framebuffers. > > > > yeah, this seems like a pretty good idea, > > Reviewed-by: Rob Clark <robdclark@xxxxxxxxx> > > > Signed-off-by: Daniel Stone <daniels@xxxxxxxxxxxxx> > > Reported-by: Daniel van Vugt <daniel.van.vugt@xxxxxxxxxxxxx> > > Fixes: 308e5bcbdb10 ("drm: add an fb creation ioctl that takes a pixel format v5") > > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105518 Cc: stable@xxxxxxxxxxxxxxx # v3.3+ Reviewed-by: Daniel Vetter <daniel.vetter@xxxxxxxx> Please push to drm-misc-fixes and poke Gustavo to do a pull so it's not lost. -Daniel > > --- > > drivers/gpu/drm/drm_framebuffer.c | 7 +++++++ > > 1 file changed, 7 insertions(+) > > > > diff --git a/drivers/gpu/drm/drm_framebuffer.c b/drivers/gpu/drm/drm_framebuffer.c > > index 7df025669067..ad67203de715 100644 > > --- a/drivers/gpu/drm/drm_framebuffer.c > > +++ b/drivers/gpu/drm/drm_framebuffer.c > > @@ -462,6 +462,12 @@ int drm_mode_getfb(struct drm_device *dev, > > if (!fb) > > return -ENOENT; > > > > + /* Multi-planar framebuffers need getfb2. */ > > + if (fb->format->num_planes > 1) { > > + ret = -EINVAL; > > + goto out; > > + } > > + > > r->height = fb->height; > > r->width = fb->width; > > r->depth = fb->format->depth; > > @@ -485,6 +491,7 @@ int drm_mode_getfb(struct drm_device *dev, > > ret = -ENODEV; > > } > > > > +out: > > drm_framebuffer_put(fb); > > > > return ret; > > -- > > 2.16.2 > > > > _______________________________________________ > > dri-devel mailing list > > dri-devel@xxxxxxxxxxxxxxxxxxxxx > > https://lists.freedesktop.org/mailman/listinfo/dri-devel > _______________________________________________ > dri-devel mailing list > dri-devel@xxxxxxxxxxxxxxxxxxxxx > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/dri-devel