I am working on a project where we are using DirectFB in an embedded device.
Whilst working on this project we have added a few things to DirectFB.
I have just moved these patches to 0.9.24 and hope they can get put into the
main line.
The Changes are
->More internal headers getting moved.
We have found some internal headers that we were requiring were not being
copied into the internal-headers directory so this patch adds three files to
this directory.
->Slow Blanking
We have a ScartSwitch on our device and wanted DirectFB to be able to
control the slow blanking of this device. (Slow blanking is used as one
method of signalling WideScreen 4*3 16*9 etc)
We have added this to DFBScreen as a capability. It is very useful for us
and hope it will be for others
Within this patch we have also added a second scart connector as we have 2
scarts.
We have also added an HDMI connector as this will need to be supported from
directfb on our device.
->Extra Pixel formats
We have added 2 extra pixel formats XRGB4444 and XRGB1555 these are used on
our device and ww need to support them. This patch also patches fbdev.c to
support this new formats.
I hope these patches will be of use and can get into the main line so that
other can use them.
I look forward to hearing peoples feedback
Daniel Laird
diff -ruN DirectFB-0.9.24/src/core/Makefile.am
DirectFB-0.9.24_updated/src/core/Makefile.am
--- DirectFB-0.9.24/src/core/Makefile.am 2005-10-27 10:57:51.000000000
+0100
+++ DirectFB-0.9.24_updated/src/core/Makefile.am 2005-10-27
11:07:21.000000000 +0100
@@ -44,7 +44,10 @@
windows.h \
windowstack.h \
wm.h \
- wm_module.h
+ wm_module.h \
+ layers_internal.h \
+ screens_internal.h \
+ windows_internal.h
noinst_LTLIBRARIES = libdirectfb_core.la
diff -ruN DirectFB-0.9.24/src/core/Makefile.in
DirectFB-0.9.24_updated/src/core/Makefile.in
--- DirectFB-0.9.24/src/core/Makefile.in 2005-10-27 10:57:51.000000000
+0100
+++ DirectFB-0.9.24_updated/src/core/Makefile.in 2005-10-27
11:06:05.000000000 +0100
@@ -147,7 +147,7@@
internalincludedir = $(INTERNALINCLUDEDIR)/core
-internalinclude_HEADERS =
accelerators.h clipboard.h colorhash.h coredefs.h coretypes.h core_parts.h core_system.h core.h fonts.h gfxcard.h graphics_driver.h input.h input_driver.h layer_context.h layer_control.h layer_region.h layers.h palette.h screen.h screens.h state.h surfaces.h surfacemanager.h system.h windows.h windowstack.h wm.h wm_module.h
+internalinclude_HEADERS =
accelerators.h clipboard.h colorhash.h coredefs.h coretypes.h core_parts.h core_system.h core.h fonts.h gfxcard.h graphics_driver.h input.h input_driver.h layer_context.h layer_control.h layer_region.h layers.h palette.h screen.h screens.h state.h surfaces.h surfacemanager.h system.h windows.h windowstack.h wm.h wm_module.h layers_internal.h screens_internal.h windows_internal.h
noinst_LTLIBRARIES = libdirectfb_core.la
libdirectfb_core_la_SOURCES = \
diff -ruN DirectFB-0.9.24/include/directfb.h
DirectFB-0.9.24_updated/include/directfb.h
--- DirectFB-0.9.24/include/directfb.h 2005-10-27 11:48:03.000000000 +0100
+++ DirectFB-0.9.24_updated/include/directfb.h 2005-10-27 11:55:42.000000000
+0100
@@ -1864,7 +1864,9 @@
DSOCAPS_SIGNAL_SEL = 0x00000020, /* Signal(s) can be selected. */
DSOCAPS_CONNECTOR_SEL = 0x00000040, /* Connector(s) can be selected.
*/
- DSOCAPS_ALL = 0x00000071
+ DSOCAPS_SLOW_BLANKING = 0x00000080, /* Slow Blanking on outputs is
supported. */
+
+ DSOCAPS_ALL = 0x000000F1
} DFBScreenOutputCapabilities;
/*
@@ -1876,7 +1878,10 @@
DSOC_VGA = 0x00000001, /* VGA connector */
DSOC_SCART = 0x00000002, /* SCART connector */
DSOC_YC = 0x00000004, /* Y/C connector */
- DSOC_CVBS = 0x00000008 /* CVBS connector */
+ DSOC_CVBS = 0x00000008, /* CVBS connector */
+ DSOC_SCART2 = 0x00000010, /* 2nd SCART connector */
+ DSOC_COMPONENT = 0x00000020, /* Component video connector */
+ DSOC_HDMI = 0x00000040 /* HDMI connector */
} DFBScreenOutputConnectors;
/*
@@ -1889,9 +1894,20 @@
DSOS_YC = 0x00000002, /* Y/C signal */
DSOS_CVBS = 0x00000004, /* CVBS signal */
DSOS_RGB = 0x00000008, /* R/G/B signal */
- DSOS_YCBCR = 0x00000010 /* Y/Cb/Cr signal */
+ DSOS_YCBCR = 0x00000010, /* Y/Cb/Cr signal */
+ DSOS_HDMI = 0x00000020 /* HDMI signal */
} DFBScreenOutputSignals;
+/*
+ * Type of slow blanking signalling.
+ */
+typedef enum {
+ DSOSB_OFF = 0x00000000, /* No signal */
+ DSOSB_16x9 = 0x00000001, /* 16*9 Widescreen signalling */
+ DSOSB_4x3 = 0x00000002, /* 4*3 widescreen signalling */
+ DSOSB_FOLLOW = 0x00000004, /* Follow signalling */
+ DSOSB_MONITOR = 0x00000008 /* Monitor */
+} DFBScreenOutputSlowBlankingSignals;
#define DFB_SCREEN_OUTPUT_DESC_NAME_LENGTH 24
@@ -1917,7 +1933,9 @@
DSOCONF_SIGNALS = 0x00000002, /* Select signal(s) from encoder.
*/
DSOCONF_CONNECTORS = 0x00000004, /* Select output connector(s). */
- DSOCONF_ALL = 0x00000007
+ DSOCONF_SLOW_BLANKING= 0x00000008, /* Can select slow blanking
support. */
+
+ DSOCONF_ALL = 0x0000000F
} DFBScreenOutputConfigFlags;
/*
@@ -1929,6 +1947,7 @@
int encoder; /* Chosen encoder. */
DFBScreenOutputSignals out_signals; /* Selected encoder
signal(s). */
DFBScreenOutputConnectors out_connectors; /* Selected output
connector(s). */
+ DFBScreenOutputSlowBlankingSignals slow_blanking;/* Slow Blanking
signals. */
} DFBScreenOutputConfig;
diff -ruN DirectFB-0.9.24/include/Makefile.am
DirectFB-0.9.24_updated/include/Makefile.am
--- DirectFB-0.9.24/include/Makefile.am 2005-10-27 11:48:03.000000000 +0100
+++ DirectFB-0.9.24_updated/include/Makefile.am 2005-10-27
11:56:23.000000000 +0100
@@ -81,6 +81,9 @@
$(MKNAMES) DFBScreenOutputSignals DSOS NONE ScreenOutputSignals signal
$(INCP)/directfb.h \
| grep -v DSOS_ALL >> $@
+ $(MKNAMES) DFBScreenOutputSlowBlankingSignals DSOSB OFF
ScreenOutputSlowBlankingSignals slow_signal $(INCP)/directfb.h \
+ | grep -v DSOSB_ALL >> $@
+
$(MKNAMES) DFBScreenMixerCapabilities DSMCAPS NONE ScreenMixerCapabilities
capability $(INCP)/directfb.h \
| grep -v DSMCAPS_ALL >> $@
diff -ruN DirectFB-0.9.24/include/Makefile.in
DirectFB-0.9.24_updated/include/Makefile.in
--- DirectFB-0.9.24/include/Makefile.in 2005-10-27 11:48:03.000000000 +0100
+++ DirectFB-0.9.24_updated/include/Makefile.in 2005-10-27
11:56:55.000000000 +0100
@@ -360,6 +360,9 @@
$(MKNAMES) DFBScreenOutputSignals DSOS NONE ScreenOutputSignals signal
$(INCP)/directfb.h \
| grep -v DSOS_ALL >> $@
+ $(MKNAMES) DFBScreenOutputSlowBlankingSignals DSOSB OFF
ScreenOutputSlowBlankingSignals slow_signal $(INCP)/directfb.h \
+ | grep -v DSOSB_ALL >> $@
+
$(MKNAMES) DFBScreenMixerCapabilities DSMCAPS NONE ScreenMixerCapabilities
capability $(INCP)/directfb.h \
| grep -v DSMCAPS_ALL >> $@
diff -ruN DirectFB-0.9.24/src/display/idirectfbscreen.c
DirectFB-0.9.24_updated/src/display/idirectfbscreen.c
--- DirectFB-0.9.24/src/display/idirectfbscreen.c 2005-10-27
11:48:03.000000000 +0100
+++ DirectFB-0.9.24_updated/src/display/idirectfbscreen.c 2005-10-27
11:48:34.000000000 +0100
@@ -584,6 +584,9 @@
if (patch->flags & DSOCONF_CONNECTORS)
patched->out_connectors = patch->out_connectors;
+ if (patch->flags & DSOCONF_SLOW_BLANKING)
+ patched->slow_blanking = patch->slow_blanking;
+
return DFB_OK;
}
diff -urN DirectFB-0.9.24/include/directfb.h
DirectFB-0.9.24_updated/include/directfb.h
--- DirectFB-0.9.24/include/directfb.h 2005-10-27 14:36:07.000000000 +0100
+++ DirectFB-0.9.24_updated/include/directfb.h 2005-10-27 14:23:16.000000000
+0100
@@ -976,11 +976,17 @@
DSPF_ARGB4444 = DFB_SURFACE_PIXELFORMAT( 18, 12, 4, 1, 0, 2, 0, 0, 0,
0, 0 ),
/* 12 bit YUV (8 bit Y plane followed by one 16 bit quarter size
CrCb [15:0] plane) */
- DSPF_NV21 = DFB_SURFACE_PIXELFORMAT( 19, 12, 0, 0, 0, 1, 0, 2, 0,
0, 0 )
+ DSPF_NV21 = DFB_SURFACE_PIXELFORMAT( 19, 12, 0, 0, 0, 1, 0, 2, 0,
0, 0 ),
+
+ /* 16 bit XRGB (2 byte, nothing @12, red [EMAIL PROTECTED], green [EMAIL
PROTECTED], blue [EMAIL PROTECTED]) */
+ DSPF_XRGB4444 = DFB_SURFACE_PIXELFORMAT( 20, 12, 0, 0, 0, 2, 0, 0, 0,
0, 0 ),
+
+ /* 16 bit XRGB (2 byte, nothing @15, red [EMAIL PROTECTED], green [EMAIL PROTECTED], blue [EMAIL PROTECTED])
*/
+ DSPF_XRGB1555 = DFB_SURFACE_PIXELFORMAT( 21, 15, 0, 0, 0, 2, 0, 0, 0,
0, 0 )
} DFBSurfacePixelFormat;
/* Number of pixelformats defined */
-#define DFB_NUM_PIXELFORMATS 20
+#define DFB_NUM_PIXELFORMATS 22
/* These macros extract information about the pixel format. */
#define DFB_PIXELFORMAT_INDEX(fmt) (((fmt) & 0x0000007F) )
diff -urN DirectFB-0.9.24/systems/fbdev/fbdev.c
DirectFB-0.9.24_updated/systems/fbdev/fbdev.c
--- DirectFB-0.9.24/systems/fbdev/fbdev.c 2005-10-18 11:57:32.000000000
+0100
+++ DirectFB-0.9.24_updated/systems/fbdev/fbdev.c 2005-10-27
14:30:19.000000000 +0100
@@ -1453,21 +1453,25 @@
return DSPF_RGB332;
case 15:
- if (dfb_fbdev_compatible_format( var, 0, 5, 5, 5, 0, 10, 5,
0 ) |
- dfb_fbdev_compatible_format( var, 1, 5, 5, 5,15, 10, 5,
0 ) )
- return DSPF_ARGB1555;
+ if (dfb_fbdev_compatible_format( var, 0, 5, 5, 5, 0, 10, 5,
0 ))
+ return DSPF_XRGB1555;
- break;
+ if(dfb_fbdev_compatible_format( var, 1, 5, 5, 5, 15, 10, 5,
0 ))
+ return DSPF_ARGB1555;
case 16:
- if (dfb_fbdev_compatible_format( var, 0, 5, 5, 5, 0, 10, 5,
0 ) |
- dfb_fbdev_compatible_format( var, 1, 5, 5, 5,15, 10, 5,
0 ) )
- return DSPF_ARGB1555;
+ if (dfb_fbdev_compatible_format( var, 0, 5, 5, 5, 0, 10, 5,
0 ))
+ return DSPF_XRGB1555;
+
+ if(dfb_fbdev_compatible_format( var, 1, 5, 5, 5, 15, 10, 5,
0 ))
+ return DSPF_ARGB1555;
- if (dfb_fbdev_compatible_format( var, 0, 4, 4, 4, 0, 8, 4,
0 ) |
- dfb_fbdev_compatible_format( var, 4, 4, 4, 4, 12, 8, 4,
0 ) )
+ if (dfb_fbdev_compatible_format( var, 4, 4, 4, 4, 12, 8, 4,
0 ))
return DSPF_ARGB4444;
+ if (dfb_fbdev_compatible_format( var, 0, 4, 4, 4, 0, 8, 4, 0
))
+ return DSPF_XRGB4444;
+
if (dfb_fbdev_compatible_format( var, 0, 5, 6, 5, 0, 11, 5,
0 ))
return DSPF_RGB16;
@@ -1607,6 +1611,15 @@
var.blue.offset = 0;
break;
+ case DSPF_XRGB1555:
+ var.red.length = 5;
+ var.green.length = 5;
+ var.blue.length = 5;
+ var.red.offset = 10;
+ var.green.offset = 5;
+ var.blue.offset = 0;
+ break;
+
case DSPF_ARGB4444:
var.transp.length = 4;
var.red.length = 4;
@@ -1618,6 +1631,24 @@
var.blue.offset = 0;
break;
+ case DSPF_XRGB4444:
+ var.red.length = 4;
+ var.green.length = 4;
+ var.blue.length = 4;
+ var.red.offset = 8;
+ var.green.offset = 4;
+ var.blue.offset = 0;
+ break;
+
+ case DSPF_RGB32:
+ var.red.length = 8;
+ var.green.length = 8;
+ var.blue.length = 8;
+ var.red.offset = 16;
+ var.green.offset = 8;
+ var.blue.offset = 0;
+ break;
+
case DSPF_RGB16:
var.red.length = 5;
var.green.length = 6;
@@ -1641,7 +1672,6 @@
case DSPF_LUT8:
case DSPF_RGB24:
- case DSPF_RGB32:
case DSPF_RGB332:
break;
@@ -2042,11 +2072,14 @@
switch (format) {
case DSPF_ARGB1555:
+ case DSPF_XRGB1555:
red_size = 32;
green_size = 32;
blue_size = 32;
break;
case DSPF_RGB16:
+ case DSPF_ARGB4444:
+ case DSPF_XRGB4444:
red_size = 32;
green_size = 64;
blue_size = 32;
_______________________________________________
directfb-dev mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev