summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
authorKlaus Schmidinger <devnull@localhost>2003-06-15 15:31:24 +0000
committerKlaus Schmidinger <devnull@localhost>2003-06-15 15:31:24 +0000
commit15f26b4337ed1ccf2230590e7d6b744d4b481898 (patch)
tree0d8a9ccdf718fc96a7e118936b4df2a0d4eec6e8 /linux
parente4f6038277c22a046f5c2a2715ae8090819e77f5 (diff)
downloadmediapointer-dvb-s2-15f26b4337ed1ccf2230590e7d6b744d4b481898.tar.gz
mediapointer-dvb-s2-15f26b4337ed1ccf2230590e7d6b744d4b481898.tar.bz2
Improved performance when setting palette with full 256 color OSD (untested, see DVB for tested version)
Diffstat (limited to 'linux')
-rw-r--r--linux/drivers/media/dvb/ttpci/av7110.c44
-rw-r--r--linux/drivers/media/dvb/ttpci/av7110.h6
2 files changed, 39 insertions, 11 deletions
diff --git a/linux/drivers/media/dvb/ttpci/av7110.c b/linux/drivers/media/dvb/ttpci/av7110.c
index 2df03db9d..4551e101e 100644
--- a/linux/drivers/media/dvb/ttpci/av7110.c
+++ b/linux/drivers/media/dvb/ttpci/av7110.c
@@ -112,7 +112,8 @@ static int hw_sections = 1;
int av7110_num = 0;
-#define FW_CI_LL_SUPPORT(arm_app) (((arm_app) >> 16) & 0x8000)
+#define FW_CI_LL_SUPPORT(arm_app) (arm_app & 0x80000000)
+#define FW_VERSION(arm_app) (arm_app & 0x0000FFFF)
/****************************************************************************
* DEBI functions
@@ -1695,6 +1696,25 @@ OSDSetColor(struct av7110 *av7110, u8 color, u8 r, u8 g, u8 b, u8 blend)
}
static int
+OSDSetPalette(av7110_t *av7110, u32 *colors, u8 first, u8 last)
+{
+ int i;
+ int length = last - first + 1;
+
+ if (length * 4 > DATA_BUFF3_SIZE)
+ return -1;
+
+ for (i=0; i<length; i++) {
+ u32 blend = (colors[i] & 0xF0000000) >> 4;
+ u32 yuv = blend ? RGB2YUV(colors[i] & 0xFF, (colors[i] >> 8) & 0xFF, (colors[i] >> 16) & 0xFF) | blend : 0;
+ yuv = ((yuv & 0xFFFF0000) >> 16) | ((yuv & 0x0000FFFF) << 16); // TODO kls2003-06-15: not sure if this is endian-proof
+ wdebi(av7110, DEBINOSWAP, DATA_BUFF3_BASE + i*4, yuv, 4);
+ }
+ return outcom(av7110, COMTYPE_OSD, Set_Palette, 4,
+ av7110->osdwin, bpp2pal[av7110->osdbpp[av7110->osdwin]], first, last);
+}
+
+static int
OSDSetBlock(struct av7110 *av7110, int x0, int y0, int x1, int y1, int inc, u8 *data)
{
uint w, h, bpp, bpl, size, lpb, bnum, brest;
@@ -1758,13 +1778,17 @@ OSD_DrawCommand(struct av7110 *av7110, osd_cmd_t *dc)
return 0;
case OSD_SetPalette:
{
- int i, len=dc->x0-dc->color+1;
- u8 *colors=(u8 *)dc->data;
-
- for (i=0; i<len; i++)
- OSDSetColor(av7110, dc->color+i,
- colors[i*4] , colors[i*4+1],
- colors[i*4+2], colors[i*4+3]);
+ if (FW_VERSION(av7110->arm_app) >= 0x2618)
+ OSDSetPalette(av7110, (u32 *)dc->data, dc->color, dc->x0);
+ else {
+ int i, len=dc->x0-dc->color+1;
+ u8 *colors=(u8 *)dc->data;
+
+ for (i=0; i<len; i++)
+ OSDSetColor(av7110, dc->color+i,
+ colors[i*4] , colors[i*4+1],
+ colors[i*4+2], colors[i*4+3]);
+ }
return 0;
}
case OSD_SetTrans:
@@ -4519,9 +4543,9 @@ int av7110_attach (struct saa7146_dev* dev, struct saa7146_pci_extension_data *p
bootarm(av7110);
firmversion(av7110);
- if ((av7110->arm_app&0xffff)<0x2501)
+ if (FW_VERSION(av7110->arm_app)<0x2501) {
printk ("av7110: Warning, firmware version 0x%04x is too old. "
- "System might be unstable!\n", av7110->arm_app&0xffff);
+ "System might be unstable!\n", FW_VERSION(av7110->arm_app));
kernel_thread(arm_thread, (void *) av7110, 0);
diff --git a/linux/drivers/media/dvb/ttpci/av7110.h b/linux/drivers/media/dvb/ttpci/av7110.h
index 920efcb93..1754aa0b3 100644
--- a/linux/drivers/media/dvb/ttpci/av7110.h
+++ b/linux/drivers/media/dvb/ttpci/av7110.h
@@ -153,7 +153,8 @@ enum av7110_osd_command {
BlitBmp,
ReleaseBmp,
SetWTrans,
- SetWNoTrans
+ SetWNoTrans,
+ Set_Palette
};
enum av7110_pid_command {
@@ -577,6 +578,9 @@ struct av7110 {
#define DATA_BUFF2_BASE (DATA_BUFF1_BASE+DATA_BUFF1_SIZE)
#define DATA_BUFF2_SIZE 0x0800
+#define DATA_BUFF3_BASE (DATA_BUFF2_BASE+DATA_BUFF2_SIZE)
+#define DATA_BUFF3_SIZE 0x0400
+
#define Reserved (DPRAM_BASE + 0x1E00)
#define Reserved_SIZE 0x1C0