I have been adding HD support to DirectFB.
After much internal discussion I decided that TV_STANDARDS implied to much
information and was very SD TV specific.
It was decided that what was meant when we specified a TV_STANDARD was
infact
Resolution
Frequency
Colour Encoding Standard
So I decided to have these as three separate parameters for Encoders and
Outputs.
I have made it backwards compatible (I believe) so that selecting a
TV_STANDARD fills in the Resolution and Frequency as appropriate.
This has made selecting output resolution very easy
Resolution
Scan Type
Frequency
For all HD/EDTV modes
Adding tv_standard for SD modes so that we get the colour encoding (pal,
ntsc etc)
I would expect usage to be either
flag DSECONF_TV_STANDARD and change the TV_STANDARD for Pal->Ntsc switching
or
Flag DSECONF_RESOLUTION | DSECONF_FREQUENCY | DSECONF_SCANMODE for setting
[EMAIL PROTECTED] for example.
Over time we would move away from flagging TV_STANDARD alone as this as
mentioned implies a lot of things. and move to using the combination of
RESOLUTION| FREQUENCY|SCANMODE.
I would welcome feedback on this proposed patch, or would obviously love to
see it go straight into DirectFB.
We have been using it for some time internally and it has held up very well
so far!
Cheers
Dan Laird
Patch below:
--- DirectFB-1.0.0/include/Makefile.am
+++ DirectFB-1.0.0.new/include/Makefile.am
@@ -88,6 +88,9 @@
$(MKNAMES) DFBScreenOutputSlowBlankingSignals DSOSB OFF
ScreenOutputSlowBlankingSignals slow_signal $(INCP)/directfb.h \
| grep -v DSOSB_ALL >> $@
+ $(MKNAMES) DFBScreenOutputResolution DSOR UNKNOWN ScreenOutputResolution
resolution $(INCP)/directfb.h \
+ | grep -v DSOR_ALL >> $@
+
$(MKNAMES) DFBScreenMixerCapabilities DSMCAPS NONE
ScreenMixerCapabilities
capability $(INCP)/directfb.h \
| grep -v DSMCAPS_ALL >> $@
--- DirectFB-1.0.0/include/Makefile.in
+++ DirectFB-1.0.0.new/include/Makefile.in
@@ -158,7 +158,6 @@
FREETYPE_PROVIDER_FALSE = @FREETYPE_PROVIDER_FALSE@
FREETYPE_PROVIDER_TRUE = @FREETYPE_PROVIDER_TRUE@
FUSION_BUILD_MULTI = @FUSION_BUILD_MULTI@
-FUSION_MESSAGE_SIZE = @FUSION_MESSAGE_SIZE@
GFX_ATI_FALSE = @GFX_ATI_FALSE@
GFX_ATI_TRUE = @GFX_ATI_TRUE@
GFX_CLE266_FALSE = @GFX_CLE266_FALSE@
@@ -662,6 +661,9 @@
$(MKNAMES) DFBScreenOutputSlowBlankingSignals DSOSB OFF
ScreenOutputSlowBlankingSignals slow_signal $(INCP)/directfb.h \
| grep -v DSOSB_ALL >> $@
+ $(MKNAMES) DFBScreenOutputResolution DSOR UNKNOWN ScreenOutputResolution
resolution $(INCP)/directfb.h \
+ | grep -v DSOR_ALL >> $@
+
$(MKNAMES) DFBScreenMixerCapabilities DSMCAPS NONE
ScreenMixerCapabilities
capability $(INCP)/directfb.h \
| grep -v DSMCAPS_ALL >> $@
--- DirectFB-1.0.0/include/directfb.h
+++ DirectFB-1.0.0.new/include/directfb.h
@@ -9,6 +9,7 @@
Sven Neumann <[EMAIL PROTECTED]>,
Ville Syrjälä <[EMAIL PROTECTED]> and
Claudio Ciccani <[EMAIL PROTECTED]>.
+ Daniel Laird <[EMAIL PROTECTED]>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -1922,7 +1923,8 @@
DSOCAPS_SIGNAL_SEL = 0x00000020, /* Signal(s) can be selected. */
DSOCAPS_CONNECTOR_SEL = 0x00000040, /* Connector(s) can be selected.
*/
DSOCAPS_SLOW_BLANKING = 0x00000080, /* Slow Blanking on outputs is
supported. */
- DSOCAPS_ALL = 0x000000F1
+ DSOCAPS_RESOLUTION = 0x00000100, /* Output Resolution can be
changed. (global screen size)*/
+ DSOCAPS_ALL = 0x000001F1
} DFBScreenOutputCapabilities;
/*
@@ -1967,6 +1969,28 @@
DSOSB_MONITOR = 0x00000008 /* Monitor */
} DFBScreenOutputSlowBlankingSignals;
+/**
+ * Resolutions. TV Standards implies too many things
+ * resolution / encoding / frequency.
+ */
+typedef enum {
+ DSOR_UNKNOWN = 0x00000000, /* Unknown Resolution */
+ DSOR_640_480 = 0x00000001, /* 640x480 Resolution */
+ DSOR_720_480 = 0x00000002, /* 720x480 Resolution */
+ DSOR_720_576 = 0x00000004, /* 720x576 Resolution */
+ DSOR_800_600 = 0x00000008, /* 800x600 Resolution */
+ DSOR_1024_768 = 0x00000010, /* 1024x768 Resolution */
+ DSOR_1152_864 = 0x00000020, /* 1152x864 Resolution */
+ DSOR_1280_720 = 0x00000040, /* 1280x720 Resolution */
+ DSOR_1280_768 = 0x00000080, /* 1280x768 Resolution */
+ DSOR_1280_960 = 0x00000100, /* 1280x960 Resolution */
+ DSOR_1280_1024 = 0x00000200, /* 1280x1024 Resolution */
+ DSOR_1400_1050 = 0x00000400, /* 1400x1050 Resolution */
+ DSOR_1600_1200 = 0x00000800, /* 1600x1200 Resolution */
+ DSOR_1920_1080 = 0x00001000, /* 1920x1080 Resolution */
+ DSOR_ALL = 0x00001FFF /* All Resolution */
+} DFBScreenOutputResolution;
+
#define DFB_SCREEN_OUTPUT_DESC_NAME_LENGTH 24
/*
@@ -1977,6 +2001,7 @@
DFBScreenOutputConnectors all_connectors; /* Output connectors.
*/
DFBScreenOutputSignals all_signals; /* Output signals. */
+ DFBScreenOutputResolution all_resolutions; /* Output Resolutions
*/
char name[DFB_SCREEN_OUTPUT_DESC_NAME_LENGTH]; /* Output name */
} DFBScreenOutputDescription;
@@ -1991,8 +2016,9 @@
DSOCONF_SIGNALS = 0x00000002, /* Select signal(s) from encoder.
*/
DSOCONF_CONNECTORS = 0x00000004, /* Select output connector(s). */
DSOCONF_SLOW_BLANKING= 0x00000008, /* Can select slow blanking
support. */
-
- DSOCONF_ALL = 0x0000000F
+ DSOCONF_RESOLUTION = 0x00000010, /* Can change output resolution */
+
+ DSOCONF_ALL = 0x0000001F
} DFBScreenOutputConfigFlags;
/*
@@ -2005,6 +2031,7 @@
DFBScreenOutputSignals out_signals; /* Selected encoder
signal(s). */
DFBScreenOutputConnectors out_connectors; /* Selected output
connector(s). */
DFBScreenOutputSlowBlankingSignals slow_blanking;/* Slow Blanking
signals. */
+ DFBScreenOutputResolution resolution; /* Output Resolution */
} DFBScreenOutputConfig;
@@ -2019,6 +2046,7 @@
DSECAPS_MIXER_SEL = 0x00000004, /* Mixer can be selected. */
DSECAPS_OUT_SIGNALS = 0x00000008, /* Different output signals are
supported. */
DSECAPS_SCANMODE = 0x00000010, /* Can switch between interlaced
and progressive output. */
+ DSECAPS_FREQUENCY = 0x00000020, /* Can switch between different
frequencies. */
DSECAPS_BRIGHTNESS = 0x00000100, /* Adjustment of brightness is
supported. */
DSECAPS_CONTRAST = 0x00000200, /* Adjustment of contrast is
supported. */
@@ -2028,7 +2056,9 @@
DSECAPS_CONNECTORS = 0x00001000, /* Select output connector(s). */
DSECAPS_SLOW_BLANKING = 0x00002000, /* Slow Blanking on outputs is
supported. */
- DSECAPS_ALL = 0x00003f3f
+ DSECAPS_RESOLUTION = 0x00004000, /* Different encoder resolutions
supported */
+
+ DSECAPS_ALL = 0x00007c3f
} DFBScreenEncoderCapabilities;
/*
@@ -2038,7 +2068,8 @@
DSET_UNKNOWN = 0x00000000, /* Unknown type */
DSET_CRTC = 0x00000001, /* Encoder is a CRTC. */
- DSET_TV = 0x00000002 /* TV output encoder. */
+ DSET_TV = 0x00000002, /* TV output encoder. */
+ DSET_DIGITAL = 0x00000004 /* Support signals other than SD TV
standards. */
} DFBScreenEncoderType;
/*
@@ -2050,7 +2081,15 @@
DSETV_PAL = 0x00000001, /* PAL */
DSETV_NTSC = 0x00000002, /* NTSC */
DSETV_SECAM = 0x00000004, /* SECAM */
- DSETV_PAL_60 = 0x00000008 /* PAL-60 */
+ DSETV_PAL_60 = 0x00000008, /* PAL-60 */
+ DSETV_PAL_BG = 0x00000010, /* PAL BG support (specific) */
+ DSETV_PAL_I = 0x00000020, /* PAL I support (specific) */
+ DSETV_PAL_M = 0x00000040, /* PAL M support (specific) */
+ DSETV_PAL_N = 0x00000080, /* PAL N support (specific) */
+ DSETV_PAL_NC = 0x00000100, /* PAL NC support (specific) */
+ DSETV_NTSC_M_JPN = 0x00000200, /* NTSC_JPN support */
+ DSETV_DIGITAL = 0x00000400, /* TV standards from the digital
domain. specify resolution, scantype, frequency.*/
+ DSETV_ALL = 0x000007FF /* All TV Standards*/
} DFBScreenEncoderTVStandards;
/*
@@ -2064,6 +2103,20 @@
} DFBScreenEncoderScanMode;
+/*
+ * Frequency of output signal.
+ */
+typedef enum {
+ DSEF_UNKNOWN = 0x00000000, /* Unknown Frequency */
+
+ DSEF_25HZ = 0x00000001, /* 25 Hz Output. */
+ DSEF_29_97HZ = 0x00000002, /* 29.97 Hz Output. */
+ DSEF_50HZ = 0x00000004, /* 50 Hz Output. */
+ DSEF_59_94HZ = 0x00000008, /* 59.94 Hz Output. */
+ DSEF_60HZ = 0x00000010, /* 60 Hz Output. */
+ DSEF_75HZ = 0x00000020, /* 75 Hz Output. */
+} DFBScreenEncoderFrequency;
+
#define DFB_SCREEN_ENCODER_DESC_NAME_LENGTH 24
/*
@@ -2077,6 +2130,7 @@
DFBScreenOutputSignals out_signals; /* Supported output
signals. */
DFBScreenOutputConnectors all_connectors; /* Supported output
connectors */
+ DFBScreenOutputResolution all_resolutions; /* Supported
Resolutions*/
char name[DFB_SCREEN_ENCODER_DESC_NAME_LENGTH]; /* Encoder name */
} DFBScreenEncoderDescription;
@@ -2094,10 +2148,12 @@
DSECONF_TEST_COLOR = 0x00000020, /* Set color for DSETP_SINGLE. */
DSECONF_ADJUSTMENT = 0x00000040, /* Set color adjustment. */
+ DSECONF_FREQUENCY = 0x00000080, /* Set Output Frequency*/
DSECONF_CONNECTORS = 0x00000100, /* Select output connector(s). */
DSECONF_SLOW_BLANKING = 0x00000200, /* Can select slow blanking
support. */
-
- DSECONF_ALL = 0x000003FF
+ DSECONF_RESOLUTION = 0x00000400, /* Can change resolution of the
encoder.*/
+
+ DSECONF_ALL = 0x000007FF
} DFBScreenEncoderConfigFlags;
/*
@@ -2137,6 +2193,9 @@
DFBColor test_color; /* Color for
DSETP_SINGLE. */
DFBColorAdjustment adjustment; /* Color adjustment. */
+ DFBScreenEncoderFrequency frequency; /* Selected Output
Frequency*/
+
+ DFBScreenOutputResolution resolution; /* Selected Output
resolution*/
} DFBScreenEncoderConfig;
--- DirectFB-1.0.0/src/display/idirectfbscreen.c
+++ DirectFB-1.0.0.new/src/display/idirectfbscreen.c
@@ -604,8 +604,50 @@
if (patch->flags & ~patched->flags)
return DFB_UNSUPPORTED;
+ if (patch->flags & DSECONF_RESOLUTION)
+ patched->resolution = patch->resolution;
+
+ if (patch->flags & DSECONF_FREQUENCY)
+ patched->frequency = patch->frequency;
+
+ /**
+ * Need to be backwards compatible with these so that
+ * they specify resolution and frequency as well.
+ * If you have set a TV_STANDARD
+ * (and set the flag) it will override the resolution and
+ * frequency chosen above.*/
if (patch->flags & DSECONF_TV_STANDARD)
+ {
patched->tv_standard = patch->tv_standard;
+ switch(patched->tv_standard)
+ {
+ case DSETV_PAL:
+ case DSETV_PAL_BG:
+ case DSETV_PAL_I:
+ case DSETV_PAL_N:
+ case DSETV_PAL_NC:
+ patched->resolution = DSOR_720_576;
+ patched->frequency = DSEF_50HZ;
+ break;
+
+ case DSETV_PAL_60:
+ case DSETV_PAL_M:
+ patched->resolution = DSOR_720_480;
+ patched->frequency = DSEF_60HZ;
+ break;
+
+ case DSETV_SECAM:
+ patched->resolution = DSOR_720_576;
+ patched->frequency = DSEF_50HZ;
+ break;
+
+ case DSETV_NTSC:
+ case DSETV_NTSC_M_JPN:
+ patched->resolution = DSOR_720_480;
+ patched->frequency = DSEF_60HZ;
+ break;
+ }
+ }
if (patch->flags & DSECONF_TEST_PICTURE)
patched->test_picture = patch->test_picture;
@@ -638,6 +680,9 @@
/* Check for unsupported flags. */
if (patch->flags & ~patched->flags)
return DFB_UNSUPPORTED;
+
+ if(patch->flags & DSOCONF_RESOLUTION)
+ patched->resolution = patch->resolution;
if (patch->flags & DSOCONF_ENCODER)
patched->encoder = patch->encoder;
--- DirectFB-1.0.0/tools/dfbinfo.c
+++ DirectFB-1.0.0.new/tools/dfbinfo.c
@@ -53,6 +53,7 @@
static const DirectFBScreenEncoderTVStandardsNames(tv_standards);
static const DirectFBScreenOutputCapabilitiesNames(output_caps);
static const DirectFBScreenOutputConnectorsNames(connectors);
+static const DirectFBScreenOutputResolutionNames(resolutions);
static const DirectFBScreenOutputSignalsNames(signals);
static const DirectFBScreenMixerCapabilitiesNames(mixer_caps);
@@ -406,6 +407,18 @@
printf( "\n" );
}
+
+ /* Output Resolutions */
+ if (descs[i].caps & DSECAPS_RESOLUTION) {
+ printf( " Output Resolutions: " );
+
+ for (n=0; resolutions[n].resolution; n++) {
+ if (descs[i].all_resolutions &
resolutions[n].resolution)
+ printf( "%s ", resolutions[n].name );
+ }
+
+ printf( "\n" );
+ }
/* Output connectors */
if (descs[i].caps & DSECAPS_CONNECTORS) {
@@ -418,7 +431,6 @@
printf( "\n" );
}
-
printf( "\n" );
}
@@ -454,16 +466,29 @@
printf( "\n" );
- /* Connectors */
- printf( " Connectors: " );
-
- for (n=0; connectors[n].connector; n++) {
- if (descs[i].all_connectors & connectors[n].connector)
- printf( "%s ", connectors[n].name );
- }
-
- printf( "\n" );
-
+ /* Connectors */
+ if (descs[i].caps & DSOCAPS_CONNECTORS) {
+ printf( " Connectors: " );
+
+ for (n=0; connectors[n].connector; n++) {
+ if (descs[i].all_connectors & connectors[n].connector)
+ printf( "%s ", connectors[n].name );
+ }
+
+ printf( "\n" );
+ }
+
+ /* Output Resolutions */
+ if (descs[i].caps & DSOCAPS_RESOLUTION) {
+ printf( " Resolutions: " );
+
+ for (n=0; resolutions[n].resolution; n++) {
+ if (descs[i].all_resolutions &
resolutions[n].resolution)
+ printf( "%s ", resolutions[n].name );
+ }
+
+ printf( "\n" );
+ }
/* Signals */
printf( " Signals: " );
http://www.nabble.com/file/7114/hd_resolution_support.patch
hd_resolution_support.patch
--
View this message in context:
http://www.nabble.com/HD-Resolution-Support---PROPOSAL-tf3390939.html#a9439036
Sent from the DirectFB Dev mailing list archive at Nabble.com.
_______________________________________________
directfb-dev mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev