All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm: fix fbs in DRM_IOCTL_MODE_GETRESOURCES ioctl
@ 2011-06-03 10:54 Sascha Hauer
  2011-06-07  6:43 ` Sascha Hauer
  2011-06-09  4:31 ` Dave Airlie
  0 siblings, 2 replies; 3+ messages in thread
From: Sascha Hauer @ 2011-06-03 10:54 UTC (permalink / raw)
  To: dri-devel


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.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/gpu/drm/drm_crtc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index 872747c..21058e6 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -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;
-- 
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 |

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm: fix fbs in DRM_IOCTL_MODE_GETRESOURCES ioctl
  2011-06-03 10:54 [PATCH] drm: fix fbs in DRM_IOCTL_MODE_GETRESOURCES ioctl Sascha Hauer
@ 2011-06-07  6:43 ` Sascha Hauer
  2011-06-09  4:31 ` Dave Airlie
  1 sibling, 0 replies; 3+ messages in thread
From: Sascha Hauer @ 2011-06-07  6:43 UTC (permalink / raw)
  To: dri-devel

Hi David,

Somehow my Cc got lost. Maybe you missed this. Any comments?

Thanks
 Sascha

On Fri, Jun 03, 2011 at 12:54:14PM +0200, Sascha Hauer wrote:
> 
> 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.
> 
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
>  drivers/gpu/drm/drm_crtc.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
> index 872747c..21058e6 100644
> --- a/drivers/gpu/drm/drm_crtc.c
> +++ b/drivers/gpu/drm/drm_crtc.c
> @@ -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;
> -- 
> 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
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
> 

-- 
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 |

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm: fix fbs in DRM_IOCTL_MODE_GETRESOURCES ioctl
  2011-06-03 10:54 [PATCH] drm: fix fbs in DRM_IOCTL_MODE_GETRESOURCES ioctl Sascha Hauer
  2011-06-07  6:43 ` Sascha Hauer
@ 2011-06-09  4:31 ` Dave Airlie
  1 sibling, 0 replies; 3+ messages in thread
From: Dave Airlie @ 2011-06-09  4:31 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: dri-devel

On Fri, 2011-06-03 at 12:54 +0200, Sascha Hauer wrote:
> 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.
> 
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---

Looks good, commited to drm-fixes tree.

Dave.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-06-09  4:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-03 10:54 [PATCH] drm: fix fbs in DRM_IOCTL_MODE_GETRESOURCES ioctl Sascha Hauer
2011-06-07  6:43 ` Sascha Hauer
2011-06-09  4:31 ` Dave Airlie

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.