drm: psuedocolor support for ARGB modes
authorRob Clark <rob@ti.com>
Wed, 16 Feb 2011 02:45:51 +0000 (02:45 +0000)
committerDave Airlie <airlied@redhat.com>
Wed, 23 Feb 2011 01:09:13 +0000 (11:09 +1000)
If there is an alpha channel, need to mask in 1's in the alpha channel
to prevent the fb from being completely transparent.

Signed-off-by: Rob Clark <rob@ti.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/drm_fb_helper.c

index 6977a1ce9d98171b9f5e43cc0127e13d87ea3b5b..d421f9d58d46c81a8003a508046493dc3552617f 100644 (file)
@@ -627,6 +627,11 @@ static int setcolreg(struct drm_crtc *crtc, u16 red, u16 green,
                value = (red << info->var.red.offset) |
                        (green << info->var.green.offset) |
                        (blue << info->var.blue.offset);
+               if (info->var.transp.length > 0) {
+                       u32 mask = (1 << info->var.transp.length) - 1;
+                       mask <<= info->var.transp.offset;
+                       value |= mask;
+               }
                palette[regno] = value;
                return 0;
        }