summaryrefslogtreecommitdiff
path: root/linux
diff options
context:
space:
mode:
authorOliver Endriss <devnull@localhost>2004-07-27 12:36:01 +0000
committerOliver Endriss <devnull@localhost>2004-07-27 12:36:01 +0000
commitb539cb9174fdb32e76306b242af7dc20416b7e9d (patch)
tree970da63897d73f4a76b3fc9f2da167ec68aec669 /linux
parent2a3e3f58e72cc7698a97a1a9071cbc93854e19da (diff)
downloadmediapointer-dvb-s2-b539cb9174fdb32e76306b242af7dc20416b7e9d.tar.gz
mediapointer-dvb-s2-b539cb9174fdb32e76306b242af7dc20416b7e9d.tar.bz2
dditional OSD window types:
applied patch by Jeremy Jones mr.lebowski (at) gmail.com with some modifications
Diffstat (limited to 'linux')
-rw-r--r--linux/drivers/media/dvb/ttpci/av7110_hw.c33
-rw-r--r--linux/drivers/media/dvb/ttpci/av7110_hw.h23
-rw-r--r--linux/include/linux/dvb/osd.h24
3 files changed, 49 insertions, 31 deletions
diff --git a/linux/drivers/media/dvb/ttpci/av7110_hw.c b/linux/drivers/media/dvb/ttpci/av7110_hw.c
index ff7b0b99a..d39ec3608 100644
--- a/linux/drivers/media/dvb/ttpci/av7110_hw.c
+++ b/linux/drivers/media/dvb/ttpci/av7110_hw.c
@@ -720,7 +720,7 @@ static inline int DestroyOSDWindow(struct av7110 *av7110, u8 windownr)
}
static inline int CreateOSDWindow(struct av7110 *av7110, u8 windownr,
- enum av7110_window_display_type disptype,
+ osd_raw_window_t disptype,
u16 width, u16 height)
{
return av7110_fw_cmd(av7110, COMTYPE_OSD, WCreate, 4,
@@ -731,8 +731,8 @@ static inline int CreateOSDWindow(struct av7110 *av7110, u8 windownr,
static enum av7110_osd_palette_type bpp2pal[8] = {
Pal1Bit, Pal2Bit, 0, Pal4Bit, 0, 0, 0, Pal8Bit
};
-static enum av7110_window_display_type bpp2bit[8] = {
- BITMAP1, BITMAP2, 0, BITMAP4, 0, 0, 0, BITMAP8
+static osd_raw_window_t bpp2bit[8] = {
+ OSD_BITMAP1, OSD_BITMAP2, 0, OSD_BITMAP4, 0, 0, 0, OSD_BITMAP8
};
static inline int LoadBitmap(struct av7110 *av7110, u16 format,
@@ -761,13 +761,13 @@ static inline int LoadBitmap(struct av7110 *av7110, u16 format,
if (av7110->bmp_state == BMP_LOADING)
return -1;
av7110->bmp_state = BMP_LOADING;
- if (format == BITMAP8) {
+ if (format == OSD_BITMAP8) {
bpp=8; delta = 1;
- } else if (format == BITMAP4) {
+ } else if (format == OSD_BITMAP4) {
bpp=4; delta = 2;
- } else if (format == BITMAP2) {
+ } else if (format == OSD_BITMAP2) {
bpp=2; delta = 4;
- } else if (format == BITMAP1) {
+ } else if (format == OSD_BITMAP1) {
bpp=1; delta = 8;
} else {
av7110->bmp_state = BMP_NONE;
@@ -785,7 +785,7 @@ static inline int LoadBitmap(struct av7110 *av7110, u16 format,
return -1;
}
}
- if (format != BITMAP8) {
+ if (format != OSD_BITMAP8) {
for (i = 0; i < dx * dy / delta; i++) {
c = ((u8 *)av7110->bmpbuf)[1024 + i * delta + delta - 1];
for (d = delta - 2; d >= 0; d--) {
@@ -1030,6 +1030,23 @@ int av7110_osd_cmd(struct av7110 *av7110, osd_cmd_t *dc)
MoveWindowAbs(av7110, av7110->osdwin, dc->x0, dc->y0);
SetColorBlend(av7110, av7110->osdwin);
return 0;
+ case OSD_OpenRaw:
+ if (dc->color < OSD_BITMAP1 || dc->color > OSD_CURSOR) {
+ return -EINVAL;
+ }
+ if (dc->color >= OSD_BITMAP1 && dc->color <= OSD_BITMAP8HR) {
+ av7110->osdbpp[av7110->osdwin] = (1 << (dc->color & 3)) - 1;
+ }
+ else {
+ av7110->osdbpp[av7110->osdwin] = 0;
+ }
+ CreateOSDWindow(av7110, av7110->osdwin, (osd_raw_window_t)dc->color,
+ dc->x1 - dc->x0 + 1, dc->y1 - dc->y0 + 1);
+ if (!dc->data) {
+ MoveWindowAbs(av7110, av7110->osdwin, dc->x0, dc->y0);
+ SetColorBlend(av7110, av7110->osdwin);
+ }
+ return 0;
default:
return -EINVAL;
}
diff --git a/linux/drivers/media/dvb/ttpci/av7110_hw.h b/linux/drivers/media/dvb/ttpci/av7110_hw.h
index cdbdbfee7..049f23f2c 100644
--- a/linux/drivers/media/dvb/ttpci/av7110_hw.h
+++ b/linux/drivers/media/dvb/ttpci/av7110_hw.h
@@ -39,29 +39,6 @@ enum av7110_osd_palette_type
Pal8Bit = 256 /* 256 colors for 16 bit palette */
};
-enum av7110_window_display_type {
- BITMAP1, /* 1 bit bitmap */
- BITMAP2, /* 2 bit bitmap */
- BITMAP4, /* 4 bit bitmap */
- BITMAP8, /* 8 bit bitmap */
- BITMAP1HR, /* 1 Bit bitmap half resolution */
- BITMAP2HR, /* 2 bit bitmap half resolution */
- BITMAP4HR, /* 4 bit bitmap half resolution */
- BITMAP8HR, /* 8 bit bitmap half resolution */
- YCRCB422, /* 4:2:2 YCRCB Graphic Display */
- YCRCB444, /* 4:4:4 YCRCB Graphic Display */
- YCRCB444HR, /* 4:4:4 YCRCB graphic half resolution */
- VIDEOTSIZE, /* True Size Normal MPEG Video Display */
- VIDEOHSIZE, /* MPEG Video Display Half Resolution */
- VIDEOQSIZE, /* MPEG Video Display Quarter Resolution */
- VIDEODSIZE, /* MPEG Video Display Double Resolution */
- VIDEOTHSIZE, /* True Size MPEG Video Display Half Resolution */
- VIDEOTQSIZE, /* True Size MPEG Video Display Quarter Resolution*/
- VIDEOTDSIZE, /* True Size MPEG Video Display Double Resolution */
- VIDEONSIZE, /* Full Size MPEG Video Display */
- CURSOR /* Cursor */
-};
-
/* switch defines */
#define SB_GPIO 3
#define SB_OFF SAA7146_GPIO_OUTLO /* SlowBlank off (TV-Mode) */
diff --git a/linux/include/linux/dvb/osd.h b/linux/include/linux/dvb/osd.h
index d8b9e51f1..d12d7e83e 100644
--- a/linux/include/linux/dvb/osd.h
+++ b/linux/include/linux/dvb/osd.h
@@ -92,6 +92,7 @@ typedef enum {
OSD_Text, // (x0,y0,size,color,text)
OSD_SetWindow, // (x0) set window with number 0<x0<8 as current
OSD_MoveWindow, // move current window to (x0, y0)
+ OSD_OpenRaw, // Open other types of OSD windows
} OSD_Command;
typedef struct osd_cmd_s {
@@ -104,6 +105,29 @@ typedef struct osd_cmd_s {
void *data;
} osd_cmd_t;
+/* OSD_OpenRaw: set 'color' to desired window type */
+typedef enum {
+ OSD_BITMAP1, /* 1 bit bitmap */
+ OSD_BITMAP2, /* 2 bit bitmap */
+ OSD_BITMAP4, /* 4 bit bitmap */
+ OSD_BITMAP8, /* 8 bit bitmap */
+ OSD_BITMAP1HR, /* 1 Bit bitmap half resolution */
+ OSD_BITMAP2HR, /* 2 bit bitmap half resolution */
+ OSD_BITMAP4HR, /* 4 bit bitmap half resolution */
+ OSD_BITMAP8HR, /* 8 bit bitmap half resolution */
+ OSD_YCRCB422, /* 4:2:2 YCRCB Graphic Display */
+ OSD_YCRCB444, /* 4:4:4 YCRCB Graphic Display */
+ OSD_YCRCB444HR, /* 4:4:4 YCRCB graphic half resolution */
+ OSD_VIDEOTSIZE, /* True Size Normal MPEG Video Display */
+ OSD_VIDEOHSIZE, /* MPEG Video Display Half Resolution */
+ OSD_VIDEOQSIZE, /* MPEG Video Display Quarter Resolution */
+ OSD_VIDEODSIZE, /* MPEG Video Display Double Resolution */
+ OSD_VIDEOTHSIZE, /* True Size MPEG Video Display Half Resolution */
+ OSD_VIDEOTQSIZE, /* True Size MPEG Video Display Quarter Resolution*/
+ OSD_VIDEOTDSIZE, /* True Size MPEG Video Display Double Resolution */
+ OSD_VIDEONSIZE, /* Full Size MPEG Video Display */
+ OSD_CURSOR /* Cursor */
+} osd_raw_window_t;
typedef struct osd_cap_s {
int cmd;