summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/fbdev
diff options
context:
space:
mode:
authorSean D'Epagnier <geckosenator@freedesktop.org>2006-08-18 10:38:15 +0000
committerSean D'Epagnier <geckosenator@freedesktop.org>2006-08-18 10:38:15 +0000
commit7e4152f0ed46f644a4247444e18dc7ad6c9832b0 (patch)
treee281f83eff5b387fa4a92d81ced80c91716e0899 /src/mesa/drivers/fbdev
parentbd87c303e94659941a7c623d0b836e3ff317cfb4 (diff)
The driver now compiles correctly without any x headers or libraries installed
The bitmap and stroke code can't be shared with glx anymore because of this. The model for the mini teapot is restored and I have tested it to work with linux-fbdev and linux-solo The driver recognizes 32bpp where there is no alpha (my radeon 7500) It also sets the correct number of cmap entrees (instead of 256 which can be an error)
Diffstat (limited to 'src/mesa/drivers/fbdev')
-rw-r--r--src/mesa/drivers/fbdev/glfbdev.c74
1 files changed, 34 insertions, 40 deletions
diff --git a/src/mesa/drivers/fbdev/glfbdev.c b/src/mesa/drivers/fbdev/glfbdev.c
index 21b6165bb1..3a6b452065 100644
--- a/src/mesa/drivers/fbdev/glfbdev.c
+++ b/src/mesa/drivers/fbdev/glfbdev.c
@@ -152,8 +152,8 @@ static void
get_buffer_size( GLframebuffer *buffer, GLuint *width, GLuint *height )
{
const GLFBDevBufferPtr fbdevbuffer = GLFBDEV_BUFFER(buffer);
- *width = fbdevbuffer->var.xres_virtual;
- *height = fbdevbuffer->var.yres_virtual;
+ *width = fbdevbuffer->var.xres;
+ *height = fbdevbuffer->var.yres;
}
@@ -389,43 +389,37 @@ glFBDevCreateVisual( const struct fb_fix_screeninfo *fixInfo,
blueBits = varInfo->blue.length;
alphaBits = varInfo->transp.length;
- if ((fixInfo->visual == FB_VISUAL_TRUECOLOR ||
- fixInfo->visual == FB_VISUAL_DIRECTCOLOR)
- && varInfo->bits_per_pixel == 24
- && varInfo->red.offset == 16
- && varInfo->green.offset == 8
- && varInfo->blue.offset == 0) {
- vis->pixelFormat = PF_B8G8R8;
- }
- else if ((fixInfo->visual == FB_VISUAL_TRUECOLOR ||
- fixInfo->visual == FB_VISUAL_DIRECTCOLOR)
- && varInfo->bits_per_pixel == 32
- && varInfo->red.offset == 16
- && varInfo->green.offset == 8
- && varInfo->blue.offset == 0
- && varInfo->transp.offset == 24) {
- vis->pixelFormat = PF_B8G8R8A8;
- }
- else if ((fixInfo->visual == FB_VISUAL_TRUECOLOR ||
- fixInfo->visual == FB_VISUAL_DIRECTCOLOR)
- && varInfo->bits_per_pixel == 16
- && varInfo->red.offset == 11
- && varInfo->green.offset == 5
- && varInfo->blue.offset == 0) {
- vis->pixelFormat = PF_B5G6R5;
- }
- else if ((fixInfo->visual == FB_VISUAL_TRUECOLOR ||
- fixInfo->visual == FB_VISUAL_DIRECTCOLOR)
- && varInfo->bits_per_pixel == 16
- && varInfo->red.offset == 10
- && varInfo->green.offset == 5
- && varInfo->blue.offset == 0) {
- vis->pixelFormat = PF_B5G5R5;
- }
- else {
- _mesa_problem(NULL, "Unsupported fbdev RGB visual/bitdepth!\n");
- _mesa_free(vis);
- return NULL;
+ if (fixInfo->visual == FB_VISUAL_TRUECOLOR ||
+ fixInfo->visual == FB_VISUAL_DIRECTCOLOR) {
+ if(varInfo->bits_per_pixel == 24
+ && varInfo->red.offset == 16
+ && varInfo->green.offset == 8
+ && varInfo->blue.offset == 0)
+ vis->pixelFormat = PF_B8G8R8;
+
+ else if(varInfo->bits_per_pixel == 32
+ && varInfo->red.offset == 16
+ && varInfo->green.offset == 8
+ && varInfo->blue.offset == 0)
+ vis->pixelFormat = PF_B8G8R8A8;
+
+ else if(varInfo->bits_per_pixel == 16
+ && varInfo->red.offset == 11
+ && varInfo->green.offset == 5
+ && varInfo->blue.offset == 0)
+ vis->pixelFormat = PF_B5G6R5;
+
+ else if(varInfo->bits_per_pixel == 16
+ && varInfo->red.offset == 10
+ && varInfo->green.offset == 5
+ && varInfo->blue.offset == 0)
+ vis->pixelFormat = PF_B5G5R5;
+
+ else {
+ _mesa_problem(NULL, "Unsupported fbdev RGB visual/bitdepth!\n");
+ _mesa_free(vis);
+ return NULL;
+ }
}
}
else {
@@ -568,7 +562,7 @@ new_glfbdev_renderbuffer(void *bufferStart, const GLFBDevVisualPtr visual)
rb->rowStride = visual->var.xres_virtual * visual->var.bits_per_pixel / 8;
rb->bottom = (GLubyte *) bufferStart
- + (visual->var.yres_virtual - 1) * rb->rowStride;
+ + (visual->var.yres - 1) * rb->rowStride;
rb->Base.Width = visual->var.xres;
rb->Base.Height = visual->var.yres;