diff options
author | Rob Clark <rob@ti.com> | 2011-02-15 21:45:51 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2011-02-22 20:09:13 -0500 |
commit | 9da12b6aeb8bde8cc3aecba12b0ec1114d6dcfea (patch) | |
tree | bc4050f4033eaa4b43c44c22e04f68504644a212 /drivers/gpu/drm/drm_fb_helper.c | |
parent | a250b9fdc53a286d32e22f21170382a46b3a3ef5 (diff) |
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 <rob@ti.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/drm_fb_helper.c')
-rw-r--r-- | drivers/gpu/drm/drm_fb_helper.c | 5 |
1 files changed, 5 insertions, 0 deletions
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, | |||
627 | value = (red << info->var.red.offset) | | 627 | value = (red << info->var.red.offset) | |
628 | (green << info->var.green.offset) | | 628 | (green << info->var.green.offset) | |
629 | (blue << info->var.blue.offset); | 629 | (blue << info->var.blue.offset); |
630 | if (info->var.transp.length > 0) { | ||
631 | u32 mask = (1 << info->var.transp.length) - 1; | ||
632 | mask <<= info->var.transp.offset; | ||
633 | value |= mask; | ||
634 | } | ||
630 | palette[regno] = value; | 635 | palette[regno] = value; |
631 | return 0; | 636 | return 0; |
632 | } | 637 | } |