Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1410146 > unrolled thread

[PATCH 4/5] add cursor hotspot to drm_framebuffer

Started byGerd Hoffmann <kraxel@redhat.com>
First post2016-05-31 13:00 +0200
Last post2016-05-31 16:00 +0200
Articles 5 — 3 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 4/5] add cursor hotspot to drm_framebuffer Gerd Hoffmann <kraxel@redhat.com> - 2016-05-31 13:00 +0200
    Re: [PATCH 4/5] add cursor hotspot to drm_framebuffer Daniel Vetter <daniel@ffwll.ch> - 2016-05-31 13:00 +0200
    Re: [PATCH 4/5] add cursor hotspot to drm_framebuffer Ville Syrjälä <ville.syrjala@linux.intel.com> - 2016-05-31 14:40 +0200
      Re: [PATCH 4/5] add cursor hotspot to drm_framebuffer Gerd Hoffmann <kraxel@redhat.com> - 2016-05-31 15:10 +0200
        Re: [PATCH 4/5] add cursor hotspot to drm_framebuffer Ville Syrjälä <ville.syrjala@linux.intel.com> - 2016-05-31 16:00 +0200

#1410146 — [PATCH 4/5] add cursor hotspot to drm_framebuffer

FromGerd Hoffmann <kraxel@redhat.com>
Date2016-05-31 13:00 +0200
Subject[PATCH 4/5] add cursor hotspot to drm_framebuffer
Message-ID<rEPyW-1EG-53@gated-at.bofh.it>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 drivers/gpu/drm/drm_crtc.c | 2 ++
 include/drm/drm_crtc.h     | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index d2a6d95..ce5a280 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -2977,6 +2977,8 @@ static int drm_mode_cursor_universal(struct drm_crtc *crtc,
 				DRM_DEBUG_KMS("failed to wrap cursor buffer in drm framebuffer\n");
 				return PTR_ERR(fb);
 			}
+			fb->hot_x = req->hot_x;
+			fb->hot_y = req->hot_y;
 		} else {
 			fb = NULL;
 		}
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index d1559cd..1460f66 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -253,6 +253,8 @@ struct drm_framebuffer {
 	int bits_per_pixel;
 	int flags;
 	uint32_t pixel_format; /* fourcc format */
+	int hot_x;
+	int hot_y;
 	struct list_head filp_head;
 };
 
-- 
1.8.3.1

[toc] | [next] | [standalone]


#1410147

FromDaniel Vetter <daniel@ffwll.ch>
Date2016-05-31 13:00 +0200
Message-ID<rEPyW-1EG-51@gated-at.bofh.it>
In reply to#1410146
On Tue, May 31, 2016 at 12:53:12PM +0200, Gerd Hoffmann wrote:
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

And feel free to include in a virtio pull to Dave with my ack.
-Daniel

> ---
>  drivers/gpu/drm/drm_crtc.c | 2 ++
>  include/drm/drm_crtc.h     | 2 ++
>  2 files changed, 4 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
> index d2a6d95..ce5a280 100644
> --- a/drivers/gpu/drm/drm_crtc.c
> +++ b/drivers/gpu/drm/drm_crtc.c
> @@ -2977,6 +2977,8 @@ static int drm_mode_cursor_universal(struct drm_crtc *crtc,
>  				DRM_DEBUG_KMS("failed to wrap cursor buffer in drm framebuffer\n");
>  				return PTR_ERR(fb);
>  			}
> +			fb->hot_x = req->hot_x;
> +			fb->hot_y = req->hot_y;
>  		} else {
>  			fb = NULL;
>  		}
> diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
> index d1559cd..1460f66 100644
> --- a/include/drm/drm_crtc.h
> +++ b/include/drm/drm_crtc.h
> @@ -253,6 +253,8 @@ struct drm_framebuffer {
>  	int bits_per_pixel;
>  	int flags;
>  	uint32_t pixel_format; /* fourcc format */
> +	int hot_x;
> +	int hot_y;
>  	struct list_head filp_head;
>  };
>  
> -- 
> 1.8.3.1
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

[toc] | [prev] | [next] | [standalone]


#1410262

FromVille Syrjälä <ville.syrjala@linux.intel.com>
Date2016-05-31 14:40 +0200
Message-ID<rER7H-2H1-1@gated-at.bofh.it>
In reply to#1410146
On Tue, May 31, 2016 at 12:53:12PM +0200, Gerd Hoffmann wrote:
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
>  drivers/gpu/drm/drm_crtc.c | 2 ++
>  include/drm/drm_crtc.h     | 2 ++
>  2 files changed, 4 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
> index d2a6d95..ce5a280 100644
> --- a/drivers/gpu/drm/drm_crtc.c
> +++ b/drivers/gpu/drm/drm_crtc.c
> @@ -2977,6 +2977,8 @@ static int drm_mode_cursor_universal(struct drm_crtc *crtc,
>  				DRM_DEBUG_KMS("failed to wrap cursor buffer in drm framebuffer\n");
>  				return PTR_ERR(fb);
>  			}
> +			fb->hot_x = req->hot_x;
> +			fb->hot_y = req->hot_y;
>  		} else {
>  			fb = NULL;
>  		}
> diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
> index d1559cd..1460f66 100644
> --- a/include/drm/drm_crtc.h
> +++ b/include/drm/drm_crtc.h
> @@ -253,6 +253,8 @@ struct drm_framebuffer {
>  	int bits_per_pixel;
>  	int flags;
>  	uint32_t pixel_format; /* fourcc format */
> +	int hot_x;
> +	int hot_y;
>  	struct list_head filp_head;
>  };

Why store it in the fb and not eg. the plane state?

>  
> -- 
> 1.8.3.1
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Ville Syrjälä
Intel OTC

[toc] | [prev] | [next] | [standalone]


#1410276

FromGerd Hoffmann <kraxel@redhat.com>
Date2016-05-31 15:10 +0200
Message-ID<rERAJ-38J-5@gated-at.bofh.it>
In reply to#1410262
On Di, 2016-05-31 at 15:36 +0300, Ville Syrjälä wrote:

> Why store it in the fb and not eg. the plane state?

Well, drm_plane_state is allocated by drm_atomic_helper_update_plane.

When sticking the hotspot into the the plane state we have to add hot_x
and hot_y parameters to drm_plane_funcs->update_plane() and cause quite
some churn all over the drm tree.

Or create a separate code path for cursor updates which uses a special
drm_atomic_helper_update_plane version, which doesn't look very
attractive too due to code duplication.

Sticking it into the drm_framebuffer instead looks like a reasonable
alternative.

I'm open to better suggestions.

cheers,
  Gerd

[toc] | [prev] | [next] | [standalone]


#1410336

FromVille Syrjälä <ville.syrjala@linux.intel.com>
Date2016-05-31 16:00 +0200
Message-ID<rESn8-3rp-25@gated-at.bofh.it>
In reply to#1410276
On Tue, May 31, 2016 at 03:09:13PM +0200, Gerd Hoffmann wrote:
> On Di, 2016-05-31 at 15:36 +0300, Ville Syrjälä wrote:
> 
> > Why store it in the fb and not eg. the plane state?
> 
> Well, drm_plane_state is allocated by drm_atomic_helper_update_plane.
> 
> When sticking the hotspot into the the plane state we have to add hot_x
> and hot_y parameters to drm_plane_funcs->update_plane() and cause quite
> some churn all over the drm tree.
> 
> Or create a separate code path for cursor updates which uses a special
> drm_atomic_helper_update_plane version, which doesn't look very
> attractive too due to code duplication.
> 
> Sticking it into the drm_framebuffer instead looks like a reasonable
> alternative.
> 
> I'm open to better suggestions.

Hmm. Too many layers. I guess this is the easiest solution then. I was
hoping to avoid fattening the fb for something so rarely used, but I
guess there's no sane way to achieve that.

-- 
Ville Syrjälä
Intel OTC

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web