From: Rob Clark Date: Wed, 16 Feb 2011 02:45:51 +0000 (+0000) Subject: drm: psuedocolor support for ARGB modes X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9da12b6aeb8bde8cc3aecba12b0ec1114d6dcfea;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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. Signed-off-by: Rob Clark Signed-off-by: Dave Airlie --- diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index 6977a1ce9d98..d421f9d58d46 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -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; }