All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/radeon: Hide cursor on CRTCs used by fbdev
@ 2014-11-28  2:48 Michel Dänzer
  2014-11-28 13:38 ` Daniel Vetter
  2014-12-01  3:29 ` Alex Deucher
  0 siblings, 2 replies; 4+ messages in thread
From: Michel Dänzer @ 2014-11-28  2:48 UTC (permalink / raw)
  To: dri-devel

From: Michel Dänzer <michel.daenzer@amd.com>

Since we are now preserving the cursor across modesets, the cursor could
be left over in console if e.g. X crashed.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
---
 drivers/gpu/drm/radeon/radeon_fb.c | 29 ++++++++++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/radeon/radeon_fb.c b/drivers/gpu/drm/radeon/radeon_fb.c
index 0ea1db8..311886b 100644
--- a/drivers/gpu/drm/radeon/radeon_fb.c
+++ b/drivers/gpu/drm/radeon/radeon_fb.c
@@ -48,10 +48,37 @@ struct radeon_fbdev {
 	struct radeon_device *rdev;
 };
 
+/**
+ * radeon_fb_helper_set_par - Hide cursor on CRTCs used by fbdev.
+ *
+ * @info: fbdev info
+ *
+ * This function hides the cursor on all CRTCs used by fbdev.
+ */
+static int radeon_fb_helper_set_par(struct fb_info *info)
+{
+	int ret;
+
+	ret = drm_fb_helper_set_par(info);
+
+	if (ret == 0) {
+		struct drm_fb_helper *fb_helper = info->par;
+		int i;
+
+		for (i = 0; i < fb_helper->crtc_count; i++) {
+			struct drm_crtc *crtc = fb_helper->crtc_info[i].mode_set.crtc;
+
+			radeon_crtc_cursor_set2(crtc, NULL, 0, 0, 0, 0, 0);
+		}
+	}
+
+	return ret;
+}
+
 static struct fb_ops radeonfb_ops = {
 	.owner = THIS_MODULE,
 	.fb_check_var = drm_fb_helper_check_var,
-	.fb_set_par = drm_fb_helper_set_par,
+	.fb_set_par = radeon_fb_helper_set_par,
 	.fb_fillrect = cfb_fillrect,
 	.fb_copyarea = cfb_copyarea,
 	.fb_imageblit = cfb_imageblit,
-- 
2.1.3

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm/radeon: Hide cursor on CRTCs used by fbdev
  2014-11-28  2:48 [PATCH] drm/radeon: Hide cursor on CRTCs used by fbdev Michel Dänzer
@ 2014-11-28 13:38 ` Daniel Vetter
  2014-12-01  3:31   ` Michel Dänzer
  2014-12-01  3:29 ` Alex Deucher
  1 sibling, 1 reply; 4+ messages in thread
From: Daniel Vetter @ 2014-11-28 13:38 UTC (permalink / raw)
  To: Michel Dänzer; +Cc: dri-devel

On Fri, Nov 28, 2014 at 11:48:48AM +0900, Michel Dänzer wrote:
> From: Michel Dänzer <michel.daenzer@amd.com>
> 
> Since we are now preserving the cursor across modesets, the cursor could
> be left over in console if e.g. X crashed.

I'd add a fixme for this since if you implement universal plane support
fbdev will automatically disable all non-primary planes (and so the
cursor).

Cheers, Daniel

> 
> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
> ---
>  drivers/gpu/drm/radeon/radeon_fb.c | 29 ++++++++++++++++++++++++++++-
>  1 file changed, 28 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/radeon/radeon_fb.c b/drivers/gpu/drm/radeon/radeon_fb.c
> index 0ea1db8..311886b 100644
> --- a/drivers/gpu/drm/radeon/radeon_fb.c
> +++ b/drivers/gpu/drm/radeon/radeon_fb.c
> @@ -48,10 +48,37 @@ struct radeon_fbdev {
>  	struct radeon_device *rdev;
>  };
>  
> +/**
> + * radeon_fb_helper_set_par - Hide cursor on CRTCs used by fbdev.
> + *
> + * @info: fbdev info
> + *
> + * This function hides the cursor on all CRTCs used by fbdev.
> + */
> +static int radeon_fb_helper_set_par(struct fb_info *info)
> +{
> +	int ret;
> +
> +	ret = drm_fb_helper_set_par(info);
> +
> +	if (ret == 0) {
> +		struct drm_fb_helper *fb_helper = info->par;
> +		int i;
> +
> +		for (i = 0; i < fb_helper->crtc_count; i++) {
> +			struct drm_crtc *crtc = fb_helper->crtc_info[i].mode_set.crtc;
> +
> +			radeon_crtc_cursor_set2(crtc, NULL, 0, 0, 0, 0, 0);
> +		}
> +	}
> +
> +	return ret;
> +}
> +
>  static struct fb_ops radeonfb_ops = {
>  	.owner = THIS_MODULE,
>  	.fb_check_var = drm_fb_helper_check_var,
> -	.fb_set_par = drm_fb_helper_set_par,
> +	.fb_set_par = radeon_fb_helper_set_par,
>  	.fb_fillrect = cfb_fillrect,
>  	.fb_copyarea = cfb_copyarea,
>  	.fb_imageblit = cfb_imageblit,
> -- 
> 2.1.3
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm/radeon: Hide cursor on CRTCs used by fbdev
  2014-11-28  2:48 [PATCH] drm/radeon: Hide cursor on CRTCs used by fbdev Michel Dänzer
  2014-11-28 13:38 ` Daniel Vetter
@ 2014-12-01  3:29 ` Alex Deucher
  1 sibling, 0 replies; 4+ messages in thread
From: Alex Deucher @ 2014-12-01  3:29 UTC (permalink / raw)
  To: Michel Dänzer; +Cc: Maling list - DRI developers

On Thu, Nov 27, 2014 at 9:48 PM, Michel Dänzer <michel@daenzer.net> wrote:
> From: Michel Dänzer <michel.daenzer@amd.com>
>
> Since we are now preserving the cursor across modesets, the cursor could
> be left over in console if e.g. X crashed.
>
> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>

Added to my -next tree with a comment about universal plane support.

Thanks,

Alex

> ---
>  drivers/gpu/drm/radeon/radeon_fb.c | 29 ++++++++++++++++++++++++++++-
>  1 file changed, 28 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_fb.c b/drivers/gpu/drm/radeon/radeon_fb.c
> index 0ea1db8..311886b 100644
> --- a/drivers/gpu/drm/radeon/radeon_fb.c
> +++ b/drivers/gpu/drm/radeon/radeon_fb.c
> @@ -48,10 +48,37 @@ struct radeon_fbdev {
>         struct radeon_device *rdev;
>  };
>
> +/**
> + * radeon_fb_helper_set_par - Hide cursor on CRTCs used by fbdev.
> + *
> + * @info: fbdev info
> + *
> + * This function hides the cursor on all CRTCs used by fbdev.
> + */
> +static int radeon_fb_helper_set_par(struct fb_info *info)
> +{
> +       int ret;
> +
> +       ret = drm_fb_helper_set_par(info);
> +
> +       if (ret == 0) {
> +               struct drm_fb_helper *fb_helper = info->par;
> +               int i;
> +
> +               for (i = 0; i < fb_helper->crtc_count; i++) {
> +                       struct drm_crtc *crtc = fb_helper->crtc_info[i].mode_set.crtc;
> +
> +                       radeon_crtc_cursor_set2(crtc, NULL, 0, 0, 0, 0, 0);
> +               }
> +       }
> +
> +       return ret;
> +}
> +
>  static struct fb_ops radeonfb_ops = {
>         .owner = THIS_MODULE,
>         .fb_check_var = drm_fb_helper_check_var,
> -       .fb_set_par = drm_fb_helper_set_par,
> +       .fb_set_par = radeon_fb_helper_set_par,
>         .fb_fillrect = cfb_fillrect,
>         .fb_copyarea = cfb_copyarea,
>         .fb_imageblit = cfb_imageblit,
> --
> 2.1.3
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH] drm/radeon: Hide cursor on CRTCs used by fbdev
  2014-11-28 13:38 ` Daniel Vetter
@ 2014-12-01  3:31   ` Michel Dänzer
  0 siblings, 0 replies; 4+ messages in thread
From: Michel Dänzer @ 2014-12-01  3:31 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: dri-devel

On 28.11.2014 22:38, Daniel Vetter wrote:
> On Fri, Nov 28, 2014 at 11:48:48AM +0900, Michel Dänzer wrote:
>> From: Michel Dänzer <michel.daenzer@amd.com>
>>
>> Since we are now preserving the cursor across modesets, the cursor could
>> be left over in console if e.g. X crashed.
>
> I'd add a fixme for this since if you implement universal plane support
> fbdev will automatically disable all non-primary planes (and so the
> cursor).

Thanks Daniel for the suggestion, and Alex for merging the patch.


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2014-12-01  3:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-28  2:48 [PATCH] drm/radeon: Hide cursor on CRTCs used by fbdev Michel Dänzer
2014-11-28 13:38 ` Daniel Vetter
2014-12-01  3:31   ` Michel Dänzer
2014-12-01  3:29 ` Alex Deucher

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.