drm: fix fbs in DRM_IOCTL_MODE_GETRESOURCES ioctl
Subsystems (2)
PATCH 1/1 drm: fix fbs in DRM_IOCTL_MODE_GETRESOURCES ioctl
The DRM_IOCTL_MODE_GETRESOURCES ioctl just returns bogus framebuffers. That is because the framebuffers for each file are in the filp_head member of struct drm_framebuffer, not in the head member.
--- drivers/gpu/drm/drm_crtc.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/gpu/drm/drm_crtc.c +1 -1
@@ -1113,7 +1113,7 @@ int drm_mode_getresources(struct drm_device *dev, void *data,if (card_res->count_fbs >= fb_count) { copied =0 ; fb_id = (uint32_t __user *)(unsigned long )card_res->fb_id_ptr; -list_for_each_entry (fb, &file_priv->fbs, head) { +list_for_each_entry (fb, &file_priv->fbs, filp_head) {if (put_user (fb->base.id, fb_id + copied)) { ret = -EFAULT ; goto out;
Signature · 7 lines
1.7.5.3 -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Hi David,
Somehow my Cc got lost. Maybe you missed this. Any comments?
Thanks
Sascha
Quoted 36 lines · Sascha Hauer
The
DRM_IOCTL_MODE_GETRESOURCESioctl just returns bogus framebuffers. That is because the framebuffers for each file are in thefilp_headmember of structdrm_framebuffer, not in the head member.Signed-off-by Sascha Hauer <[email protected]>--- drivers/gpu/drm/drm_crtc.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)drivers/gpu/drm/drm_crtc.c +1
-1@@ -1113,7 +1113,7 @@ int drm_mode_getresources(struct drm_device *dev, void *data,if (card_res->count_fbs >= fb_count) { copied =0 ; fb_id = (uint32_t __user *)(unsigned long )card_res->fb_id_ptr; -list_for_each_entry (fb, &file_priv->fbs, head) { +list_for_each_entry (fb, &file_priv->fbs, filp_head) {if (put_user (fb->base.id, fb_id + copied)) { ret = -EFAULT ; goto out;Signature · 11 lines
1.7.5.3 -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 4 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
Quoted 6 lines · Sascha Hauer
The
DRM_IOCTL_MODE_GETRESOURCESioctl just returns bogus framebuffers. That is because the framebuffers for each file are in thefilp_headmember of structdrm_framebuffer, not in the head member.Signed-off-by Sascha Hauer <[email protected]>---
Looks good, commited to drm-fixes tree.
Dave.