Skip to contentSkip to conversation

drm: psuedocolor support for ARGB modes

PATCH New Rob Clark 1 participant 1 message Feb 16, 2011

Subsystems (2)
lore
Share & tools
lore

Rob Clark

author
#0 lore raw

PATCH 1/1 drm: psuedocolor support for ARGB modes

If there is an alpha channel, need to mask in 1's in the alpha channel to prevent the fb from being completely transparent.

---
 drivers/gpu/drm/drm_fb_helper.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
drivers/gpu/drm/drm_fb_helper.c +5 -0
index 7196620..9190011 100644
@@ -526,6 +526,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;
 	}
Signature · 1 line
1.7.1