drm: Reject getfb for multi-plane framebuffers
Subsystems (2)
PATCH 1/1 drm: Reject getfb for multi-plane framebuffers
getfb can only return a single plane, so reject attempts to use it with multi-plane framebuffers.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105518
--- drivers/gpu/drm/drm_framebuffer.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/gpu/drm/drm_framebuffer.c +7 -0
@@ -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;
Signature · 6 lines
2.16.2 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 3 lines · Daniel Stone
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,
Quoted 36 lines
Signed-off-by Daniel Stone <[email protected]>Reported-by Daniel van Vugt <[email protected]>Fixes 308e5bcbdb10 ("drm: add an fb creation ioctl that takes a pixel format v5")Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105518
--- drivers/gpu/drm/drm_framebuffer.c | 7 +++++++ 1 file changed, 7 insertions(+)drivers/gpu/drm/drm_framebuffer.c +7
-1@@ -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
Quoted 4 lines
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Daniel Vetter
Reviewed-byQuoted 13 lines · Rob Clark
Quoted 3 lines · Daniel Stone
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 <[email protected]>Quoted 4 lines
Signed-off-by Daniel Stone <[email protected]>Reported-by Daniel van Vugt <[email protected]>Fixes 308e5bcbdb10 ("drm: add an fb creation ioctl that takes a pixel format v5")Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105518
Please push to drm-misc-fixes and poke Gustavo to do a pull so it's not lost.
-Daniel
Quoted 40 lines
Quoted 32 lines
--- drivers/gpu/drm/drm_framebuffer.c | 7 +++++++ 1 file changed, 7 insertions(+)drivers/gpu/drm/drm_framebuffer.c +7
-1@@ -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
Quoted 4 lines
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Hi,
Quoted 15 lines · Daniel Vetter
Quoted 13 lines · Rob Clark
Quoted 3 lines · Daniel Stone
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 <[email protected]>Quoted 4 lines
Signed-off-by Daniel Stone <[email protected]>Reported-by Daniel van Vugt <[email protected]>Fixes 308e5bcbdb10 ("drm: add an fb creation ioctl that takes a pixel format v5")Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105518
Quoted 5 lines
Cc [email protected] # v3.3+Reviewed-by Daniel Vetter <[email protected]>Please push to drm-misc-fixes and poke Gustavo to do a pull so it's not lost.
Thanks both, I've pushed now. I suspect Gustavo is still on a plane somewhere, but poked nevertheless.
Cheers,
aniel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel