From 53cd7f5e10c66ccd232b8c96d286e456cccca25f Mon Sep 17 00:00:00 2001 From: John Fredriksson Date: Mon, 8 Aug 2011 16:56:41 +0000 Subject: Add xvideo driver. --- man/mali.4 | 63 ++++++ src/Makefile.am | 9 +- src/Makefile.in | 12 +- src/mali_fbdev.c | 26 ++- src/mali_fbdev.h | 59 +++++- src/u8500_video.c | 571 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/u8500_video.h | 29 +++ 7 files changed, 756 insertions(+), 13 deletions(-) create mode 100644 man/mali.4 create mode 100644 src/u8500_video.c create mode 100644 src/u8500_video.h diff --git a/man/mali.4 b/man/mali.4 new file mode 100644 index 0000000..536f40b --- /dev/null +++ b/man/mali.4 @@ -0,0 +1,63 @@ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/fbdev/fbdev.man,v 1.2 2001/01/27 18:20:47 dawes Exp $ +.\" shorthand for double quote that works everywhere. +.ds q \N'34' +.TH FBDEV __drivermansuffix__ __vendorversion__ +.SH NAME +fbdev \- video driver for framebuffer device +.SH SYNOPSIS +.nf +.B "Section \*qDevice\*q" +.BI " Identifier \*q" devname \*q +.B " Driver \*qfbdev\*q" +.BI " BusID \*qpci:" bus : dev : func \*q +\ \ ... +.B EndSection +.fi +.SH DESCRIPTION +.B fbdev +is an __xservername__ driver for framebuffer devices. This is a non-accelerated +driver, the following framebuffer depths are supported: 8, 15, 16, 24. +All visual types are supported for depth 8, and TrueColor visual is +supported for the other depths. Multi-head configurations are supported. +.SH SUPPORTED HARDWARE +The +.B fbdev +driver supports all hardware where a framebuffer driver is available. +fbdev uses the os-specific submodule fbdevhw(__drivermansuffix__) to talk +to the kernel +device driver. Currently a fbdevhw module is available for linux. +.SH CONFIGURATION DETAILS +Please refer to __xconfigfile__(__filemansuffix__) for general configuration +details. This section only covers configuration details specific to +this driver. +.PP +For this driver it is not required to specify modes in the screen +section of the config file. The +.B fbdev +driver can pick up the currently used video mode from the framebuffer +driver and will use it if there are no video modes configured. +.PP +For PCI boards you might have to add a BusID line to the Device +section. See above for a sample line. You can use \*q\__xservername__ +-scanpci\*q +to figure out the correct values. +.PP +The following driver +.B Options +are supported: +.TP +.BI "Option \*qfbdev\*q \*q" string \*q +The framebuffer device to use. Default: /dev/fb0. +.TP +.BI "Option \*qShadowFB\*q \*q" boolean \*q +Enable or disable use of the shadow framebuffer layer. Default: on. +.TP +.BI "Option \*qRotate\*q \*q" string \*q +Enable rotation of the display. The supported values are "CW" (clockwise, +90 degrees), "UD" (upside down, 180 degrees) and "CCW" (counter clockwise, +270 degrees). Implies use of the shadow framebuffer layer. Default: off. +.SH "SEE ALSO" +__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), Xserver(__appmansuffix__), +X(__miscmansuffix__), fbdevhw(__drivermansuffix__) +.SH AUTHORS +Authors include: Gerd Knorr, Michel D\(:anzer, Geert Uytterhoeven diff --git a/src/Makefile.am b/src/Makefile.am index 540cf1c..26f8ec1 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -30,7 +30,8 @@ mali_drv_ladir = @moduledir@/drivers LIBS = -lblt_hw mali_drv_la_SOURCES = \ - mali_fbdev.c \ - mali_exa.c \ - mali_dri.c \ - mali_lcd.c + mali_fbdev.c \ + mali_exa.c \ + mali_dri.c \ + mali_lcd.c \ + u8500_video.c diff --git a/src/Makefile.in b/src/Makefile.in index 32d4ee7..f2fb0dd 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -89,7 +89,7 @@ am__installdirs = "$(DESTDIR)$(mali_drv_ladir)" LTLIBRARIES = $(mali_drv_la_LTLIBRARIES) mali_drv_la_LIBADD = am_mali_drv_la_OBJECTS = mali_fbdev.lo mali_exa.lo mali_dri.lo \ - mali_lcd.lo + mali_lcd.lo u8500_video.lo mali_drv_la_OBJECTS = $(am_mali_drv_la_OBJECTS) AM_V_lt = $(am__v_lt_$(V)) am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) @@ -278,10 +278,11 @@ mali_drv_la_LTLIBRARIES = mali_drv.la mali_drv_la_LDFLAGS = -module -avoid-version mali_drv_ladir = @moduledir@/drivers mali_drv_la_SOURCES = \ - mali_fbdev.c \ - mali_exa.c \ - mali_dri.c \ - mali_lcd.c + mali_fbdev.c \ + mali_exa.c \ + mali_dri.c \ + mali_lcd.c \ + u8500_video.c all: all-am @@ -361,6 +362,7 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mali_exa.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mali_fbdev.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mali_lcd.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/u8500_video.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< diff --git a/src/mali_fbdev.c b/src/mali_fbdev.c index 9abf2e2..e96d6d0 100644 --- a/src/mali_fbdev.c +++ b/src/mali_fbdev.c @@ -1166,10 +1166,27 @@ static Bool MaliScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **ar { XF86VideoAdaptorPtr *ptr; + XF86VideoAdaptorPtr adaptor; + int i = 0; - int n = xf86XVListGenericAdaptors(pScrn,&ptr); - if (n) xf86XVScreenInit(pScreen,ptr,n); - } + ptr = realloc(ptr, (i + 1) * sizeof(XF86VideoAdaptorPtr)); + if (!ptr) + return FALSE; + + /* b2r2 overlay video adaptor */ + if ((adaptor = U8500overlaySetupImageVideo(pScreen))) { + ptr[i] = adaptor; + i++; + } + + if (!xf86XVScreenInit(pScreen, ptr, i)) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "XVScreenInit failed\n"); + return FALSE; + } + + //int n = xf86XVListGenericAdaptors(pScrn,&ptr); + //if (n) xf86XVScreenInit(pScreen,ptr,n); + } return TRUE; } @@ -1182,6 +1199,9 @@ static Bool MaliCloseScreen(int scrnIndex, ScreenPtr pScreen) MaliHWRestore(pScrn); MaliHWUnmapVidmem(pScrn); + + U8500overlayFreeAdaptor(fPtr, fPtr->overlay_adaptor); + pScrn->vtSema = FALSE; pScreen->CreateScreenResources = fPtr->CreateScreenResources; diff --git a/src/mali_fbdev.h b/src/mali_fbdev.h index 0aaff9a..7c569fa 100644 --- a/src/mali_fbdev.h +++ b/src/mali_fbdev.h @@ -28,6 +28,7 @@ #include #include #include "exa.h" +#include #include