summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/ttpci/av7110_hw.c
diff options
context:
space:
mode:
authorOliver Endriss <devnull@localhost>2004-12-14 17:16:55 +0000
committerOliver Endriss <devnull@localhost>2004-12-14 17:16:55 +0000
commit6a47e978da8b4e451995dec3b35f6e2a51663851 (patch)
tree310a033ee237b0ebee924c97f8e5b4881ee88b87 /linux/drivers/media/dvb/ttpci/av7110_hw.c
parent2da7a0afdf8aeed1b67089ac06bc38b283d236df (diff)
downloadmediapointer-dvb-s2-6a47e978da8b4e451995dec3b35f6e2a51663851.tar.gz
mediapointer-dvb-s2-6a47e978da8b4e451995dec3b35f6e2a51663851.tar.bz2
- OSD timeout handling fixed, no crashes anymore with firmware 261d-rc5 or later
- avoid race conditions when sending COMTYPE_MISC commands
Diffstat (limited to 'linux/drivers/media/dvb/ttpci/av7110_hw.c')
-rw-r--r--linux/drivers/media/dvb/ttpci/av7110_hw.c31
1 files changed, 24 insertions, 7 deletions
diff --git a/linux/drivers/media/dvb/ttpci/av7110_hw.c b/linux/drivers/media/dvb/ttpci/av7110_hw.c
index 5a11d3da5..f5e753851 100644
--- a/linux/drivers/media/dvb/ttpci/av7110_hw.c
+++ b/linux/drivers/media/dvb/ttpci/av7110_hw.c
@@ -375,6 +375,13 @@ int __av7110_send_fw_cmd(struct av7110 *av7110, u16* buf, int length)
flags[0] = OSDQOver;
flags[1] = OSDQFull;
break;
+ case COMTYPE_MISC:
+ if (FW_VERSION(av7110->arm_app) >= 0x261d) {
+ type = "MSG";
+ flags[0] = GPMQOver;
+ flags[1] = GPMQBusy;
+ }
+ break;
default:
break;
}
@@ -876,11 +883,12 @@ static int BlitBitmap(struct av7110 *av7110, u16 win, u16 x, u16 y, u16 trans)
BUG_ON (av7110->bmp_state == BMP_NONE);
- ret = wait_event_interruptible_timeout(av7110->bmpq, av7110->bmp_state != BMP_LOADING, HZ);
+ ret = wait_event_interruptible_timeout(av7110->bmpq,
+ av7110->bmp_state != BMP_LOADING, 10*HZ);
if (ret == -ERESTARTSYS || ret == 0) {
printk("dvb-ttpci: warning: timeout waiting in %s()\n", __FUNCTION__);
av7110->bmp_state = BMP_NONE;
- return -1;
+ return (ret == 0) ? -ETIMEDOUT : ret;
}
BUG_ON (av7110->bmp_state != BMP_LOADED);
@@ -958,6 +966,7 @@ static int OSDSetBlock(struct av7110 *av7110, int x0, int y0,
{
uint w, h, bpp, bpl, size, lpb, bnum, brest;
int i;
+ int rc;
w = x1 - x0 + 1;
h = y1 - y0 + 1;
@@ -973,15 +982,23 @@ static int OSDSetBlock(struct av7110 *av7110, int x0, int y0,
brest = size - bnum * lpb * bpl;
for (i = 0; i < bnum; i++) {
- LoadBitmap(av7110, bpp2bit[av7110->osdbpp[av7110->osdwin]],
+ rc = LoadBitmap(av7110, bpp2bit[av7110->osdbpp[av7110->osdwin]],
w, lpb, inc, data);
- BlitBitmap(av7110, av7110->osdwin, x0, y0 + i * lpb, 0);
+ if (rc)
+ return rc;
+ rc = BlitBitmap(av7110, av7110->osdwin, x0, y0 + i * lpb, 0);
+ if (rc)
+ return rc;
data += lpb * inc;
}
if (brest) {
- LoadBitmap(av7110, bpp2bit[av7110->osdbpp[av7110->osdwin]],
+ rc = LoadBitmap(av7110, bpp2bit[av7110->osdbpp[av7110->osdwin]],
w, brest / bpl, inc, data);
- BlitBitmap(av7110, av7110->osdwin, x0, y0 + bnum * lpb, 0);
+ if (rc)
+ return rc;
+ rc = BlitBitmap(av7110, av7110->osdwin, x0, y0 + bnum * lpb, 0);
+ if (rc)
+ return rc;
}
ReleaseBitmap(av7110);
return 0;
@@ -1063,7 +1080,7 @@ int av7110_osd_cmd(struct av7110 *av7110, osd_cmd_t *dc)
dc->y1 = dc->y0;
/* fall through */
case OSD_SetBlock:
- OSDSetBlock(av7110, dc->x0, dc->y0, dc->x1, dc->y1, dc->color, dc->data);
+ ret = OSDSetBlock(av7110, dc->x0, dc->y0, dc->x1, dc->y1, dc->color, dc->data);
goto out;
case OSD_FillRow:
DrawBlock(av7110, av7110->osdwin, dc->x0, dc->y0,