summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2008-06-10 14:11:29 -0400
committerRay Strode <rstrode@redhat.com>2008-06-10 14:11:29 -0400
commit321a08fc0feaee41ad5c70a67cc9b1fa1fcdc234 (patch)
treeab339cc09b8cec78afa2ed7d605b6c51e49127cc
parent1d30484098b9ad8cb837ee7d3359c45b24eebade (diff)
downloadplymouth-321a08fc0feaee41ad5c70a67cc9b1fa1fcdc234.tar.gz
plymouth-321a08fc0feaee41ad5c70a67cc9b1fa1fcdc234.tar.xz
plymouth-321a08fc0feaee41ad5c70a67cc9b1fa1fcdc234.zip
Check for truecolor in a more direct way
-rw-r--r--src/libply/ply-frame-buffer.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/libply/ply-frame-buffer.c b/src/libply/ply-frame-buffer.c
index beb8021..50bb70b 100644
--- a/src/libply/ply-frame-buffer.c
+++ b/src/libply/ply-frame-buffer.c
@@ -233,12 +233,6 @@ ply_frame_buffer_query_device (ply_frame_buffer_t *buffer)
buffer->alpha_bit_position = variable_screen_info.transp.offset;
buffer->bits_for_alpha = variable_screen_info.transp.length;
- /* Normally the pixel is divided between the color components.
- * If we have less bits per pixel than bits per color component,
- * then we know we aren't using a direct color mapping. Instead
- * we must be using an indexed palette and a pseudocolor mode, which
- * we don't support.
- */
if (variable_screen_info.bits_per_pixel <
buffer->bits_for_red + buffer->bits_for_green + buffer->bits_for_blue)
{
@@ -251,6 +245,20 @@ ply_frame_buffer_query_device (ply_frame_buffer_t *buffer)
return false;
}
+ /* Normally the pixel is divided into channels between the color components.
+ * Each channel directly maps to a color channel on the hardware.
+ *
+ * There are some odd ball modes that use an indexed palette instead. In
+ * those cases (pseudocolor, direct color, etc), the pixel value is just an
+ * index into a lookup table of the real color values.
+ *
+ * We don't support that.
+ */
+ if (fixed_screen_info.visual != FB_VISUAL_TRUECOLOR)
+ {
+ return false;
+ }
+
buffer->bytes_per_pixel = variable_screen_info.bits_per_pixel >> 3;
buffer->row_stride = fixed_screen_info.line_length / buffer->bytes_per_pixel;
buffer->size = buffer->area.height * buffer->row_stride * buffer->bytes_per_pixel;