summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/Makefile16
-rw-r--r--src/mesa/drivers/fbdev/glfbdev.c74
2 files changed, 44 insertions, 46 deletions
diff --git a/src/mesa/Makefile b/src/mesa/Makefile
index bf600e0578d..16cf6709ea5 100644
--- a/src/mesa/Makefile
+++ b/src/mesa/Makefile
@@ -38,7 +38,6 @@ default:
fi
-
######################################################################
# BeOS driver target
@@ -74,13 +73,17 @@ directfb: depend subdirs libgl-core
######################################################################
# Stand-alone Mesa libGL and libOSMesa
-
-STAND_ALONE_DRIVER_SOURCES = \
+STAND_ALONE_DRIVER_SOURCES_A = \
$(COMMON_DRIVER_SOURCES) \
- $(X11_DRIVER_SOURCES) \
$(GLIDE_DRIVER_SOURCES) \
- $(SVGA_DRIVER_SOURCES) \
- $(FBDEV_DRIVER_SOURCES)
+ $(SVGA_DRIVER_SOURCES)
+
+# if x11 is not installed, compiling with x11 sources will not work for fbdev
+ifeq ($(DRIVER_DIRS), fbdev)
+STAND_ALONE_DRIVER_SOURCES = $(STAND_ALONE_DRIVER_SOURCES_A) $(FBDEV_DRIVER_SOURCES)
+else
+STAND_ALONE_DRIVER_SOURCES = $(STAND_ALONE_DRIVER_SOURCES_A) $(X11_DRIVER_SOURCES)
+endif
STAND_ALONE_DRIVER_OBJECTS = $(STAND_ALONE_DRIVER_SOURCES:.c=.o)
@@ -133,6 +136,7 @@ ALL_SOURCES = \
$(X86_SOURCES) \
$(COMMON_DRIVER_SOURCES)\
$(X11_DRIVER_SOURCES) \
+ $(FBDEV_DRIVER_SOURCES) \
$(OSMESA_DRIVER_SOURCES)
diff --git a/src/mesa/drivers/fbdev/glfbdev.c b/src/mesa/drivers/fbdev/glfbdev.c
index 21b6165bb14..3a6b452065b 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;