[PATCH] support more DCON output modes

Albert Cahalan acahalan at gmail.com
Sat Mar 17 15:15:43 EDT 2007


This is helpful for doing greyscale (the astronomy program), for doing
better anti-aliasing, and for getting a full 18-bit color while in 5:6:5.
The query functionality, accessed via -1, gets a #define to document it.

Somehow there needs to be a way for apps to control this, but I did
not do anything about that. Perhaps the permissions should change.

The patch is inserted for review and attached to preserve whitespace.

diff -Naurd old/drivers/video/geode/gxfb_dcon.c
new/drivers/video/geode/gxfb_dcon.c
--- old/drivers/video/geode/gxfb_dcon.c 2007-03-17 14:32:21.000000000 -0400
+++ new/drivers/video/geode/gxfb_dcon.c 2007-03-17 15:01:22.000000000 -0400
@@ -143,7 +143,18 @@
                dcon_disp_mode &= ~(MODE_CSWIZZLE | MODE_COL_AA);
                dcon_disp_mode |= MODE_MONO_LUMA;
        }
-       else {
+       else if (arg == DCON_OUTPUT_GREEN) {
+               dcon_disp_mode &= ~(MODE_MONO_LUMA | MODE_CSWIZZLE |
MODE_COL_AA);
+       }
+       else if (arg == DCON_OUTPUT_UNFILTERED) {
+               dcon_disp_mode &= ~(MODE_MONO_LUMA | MODE_COL_AA);
+               dcon_disp_mode |= MODE_CSWIZZLE;
+       }
+       else if (arg == DCON_OUTPUT_FILTERED) {
+               dcon_disp_mode &= ~(MODE_MONO_LUMA);
+               dcon_disp_mode |= (MODE_CSWIZZLE | MODE_COL_AA);
+       }
+       else /* if (arg == DCON_OUTPUT_COLOR) */ {
                dcon_disp_mode &= ~(MODE_MONO_LUMA);
                dcon_disp_mode |= MODE_CSWIZZLE;
                if (useaa)
@@ -281,7 +292,7 @@
                if (get_user(karg, (int __user *)arg))
                        return -EFAULT;

-               if (karg > 1 || karg < -1)
+               if (karg > DCON_OUTPUT_MAX || karg < -1)
                        return -EINVAL;

                if (karg > -1)
@@ -412,7 +423,7 @@
        if (_strtoul(buf, count, &output))
                return -EINVAL;

-       if (output == DCON_OUTPUT_COLOR || output == DCON_OUTPUT_MONO) {
+       if (output >= 0 && output <= DCON_OUTPUT_MAX) {
                dcon_set_output(output);
                rc = count;
        }
diff -Naurd old/drivers/video/geode/gxfb_dcon.h
new/drivers/video/geode/gxfb_dcon.h
--- old/drivers/video/geode/gxfb_dcon.h 2007-03-17 14:32:21.000000000 -0400
+++ new/drivers/video/geode/gxfb_dcon.h 2007-03-17 15:01:25.000000000 -0400
@@ -62,8 +62,13 @@
 #define DCON_SOURCE_CPU         1

 /* Output values */
+#define DCON_OUTPUT_QUERY      -1
 #define DCON_OUTPUT_COLOR       0
 #define DCON_OUTPUT_MONO        1
+#define DCON_OUTPUT_GREEN       2
+#define DCON_OUTPUT_FILTERED    3
+#define DCON_OUTPUT_UNFILTERED  4
+#define DCON_OUTPUT_MAX         DCON_OUTPUT_UNFILTERED

 /* Sleep values */
 #define DCON_ACTIVE             0
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dcon.patch
Type: text/x-patch
Size: 1960 bytes
Desc: not available
URL: <http://lists.laptop.org/pipermail/devel/attachments/20070317/c23f7ff7/attachment.bin>


More information about the Devel mailing list