[PATCH 1/2] drm/mgag200: Added the hwcursor parameter to turn hardware cursor on/off.

Julia Lemire jlemire at matrox.com
Mon Feb 24 13:14:40 PST 2014


The hwcursor parameter is a boolean variable.  When set to true, the
hardware cursor is enabled.  When set to false, it is disabled.

Signed-off-by: Julia Lemire <jlemire at matrox.com>
---
 drivers/gpu/drm/mgag200/mgag200_cursor.c |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/drivers/gpu/drm/mgag200/mgag200_cursor.c b/drivers/gpu/drm/mgag200/mgag200_cursor.c
index 9f9780b..c9a94a6 100644
--- a/drivers/gpu/drm/mgag200/mgag200_cursor.c
+++ b/drivers/gpu/drm/mgag200/mgag200_cursor.c
@@ -10,9 +10,17 @@
 
 #include <drm/drmP.h>
 #include "mgag200_drv.h"
+#include <linux/moduleparam.h>
+
+static bool hwcursor = true;
 
 static bool warn_transparent = true;
 static bool warn_palette = true;
+static bool warn_user_input = true;
+
+module_param(hwcursor, bool, 0644);
+MODULE_PARM_DESC(hwcursor, "When true, the hardware cursor is enabled.  When false, it is disabled.");
+
 
 /*
   Hide the cursor off screen. We can't disable the cursor hardware because it
@@ -90,6 +98,16 @@ int mga_crtc_cursor_set(struct drm_crtc *crtc,
 		goto out1;
 	}
 
+	if (!hwcursor) {
+		if (warn_user_input) {
+			dev_info(&dev->pdev->dev, "User disabled hardware cursor.\n");
+			warn_user_input = false;
+		}
+		mga_hide_cursor(mdev);
+		ret = -EINVAL;
+		goto out1;
+	}
+
 	/* Move cursor buffers into VRAM if they aren't already */
 	if (!pixels_1->pin_count) {
 		ret = mgag200_bo_pin(pixels_1, TTM_PL_FLAG_VRAM,
-- 
1.7.10.4



More information about the dri-devel mailing list