Skip to content

Commit

Permalink
V4L/DVB (5902): Add ivtv-fb framebuffer driver.
Browse files Browse the repository at this point in the history
Add the ivtv-fb framebuffer driver for cx23415 devices (currently
only the Hauppauge PVR-350 cards). This makes it possible to use
the On-Screen Display functionality of these cards, either for menus
during MPEG playback, or as a console or X display.

Signed-off-by: Kevin Thayer <nufan_wfk@yahoo.com>
Signed-off-by: Chris Kennedy <c@groovy.org>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: John P Harvey <john.p.harvey@btinternet.com>
Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Oct 10, 2007
1 parent d3c35ac commit 32db775
Show file tree
Hide file tree
Showing 6 changed files with 1,283 additions and 25 deletions.
16 changes: 16 additions & 0 deletions drivers/media/video/ivtv/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,19 @@ config VIDEO_IVTV

To compile this driver as a module, choose M here: the
module will be called ivtv.

config VIDEO_IVTV_FB
tristate "Conexant cx23415 framebuffer support"
depends on VIDEO_IVTV && FB && EXPERIMENTAL
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
---help---
This is a framebuffer driver for the Conexant cx23415 MPEG
encoder/decoder.

This is used in the Hauppauge PVR-350 card. There is a driver
homepage at <http://www.ivtvdriver.org>.

To compile this driver as a module, choose M here: the
module will be called ivtv-fb.
1 change: 1 addition & 0 deletions drivers/media/video/ivtv/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ ivtv-objs := ivtv-audio.o ivtv-cards.o ivtv-controls.o \
ivtv-vbi.o ivtv-video.o ivtv-yuv.o

obj-$(CONFIG_VIDEO_IVTV) += ivtv.o
obj-$(CONFIG_VIDEO_IVTV_FB) += ivtv-fb.o
15 changes: 13 additions & 2 deletions drivers/media/video/ivtv/ivtv-driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,14 @@ const u32 yuv_offset[4] = {

/* Parameter declarations */
static int cardtype[IVTV_MAX_CARDS];
static int tuner[IVTV_MAX_CARDS] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 };
static int radio[IVTV_MAX_CARDS] = { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 };
static int tuner[IVTV_MAX_CARDS] = { -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1 };
static int radio[IVTV_MAX_CARDS] = { -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1 };

static int cardtype_c = 1;
static int tuner_c = 1;
Expand Down Expand Up @@ -1242,8 +1248,10 @@ static int __devinit ivtv_probe(struct pci_dev *dev,
retval = -ENODEV;
IVTV_ERR("Error %d on initialization\n", retval);

spin_lock(&ivtv_cards_lock);
kfree(ivtv_cards[ivtv_cards_active]);
ivtv_cards[ivtv_cards_active] = NULL;
spin_unlock(&ivtv_cards_lock);
return retval;
}

Expand Down Expand Up @@ -1346,6 +1354,7 @@ static void module_cleanup(void)

pci_unregister_driver(&ivtv_pci_driver);

spin_lock(&ivtv_cards_lock);
for (i = 0; i < ivtv_cards_active; i++) {
if (ivtv_cards[i] == NULL)
continue;
Expand All @@ -1354,13 +1363,15 @@ static void module_cleanup(void)
}
kfree(ivtv_cards[i]);
}
spin_unlock(&ivtv_cards_lock);
}

/* Note: These symbols are exported because they are used by the ivtv-fb
framebuffer module and an infrared module for the IR-blaster. */
EXPORT_SYMBOL(ivtv_set_irq_mask);
EXPORT_SYMBOL(ivtv_cards_active);
EXPORT_SYMBOL(ivtv_cards);
EXPORT_SYMBOL(ivtv_cards_lock);
EXPORT_SYMBOL(ivtv_api);
EXPORT_SYMBOL(ivtv_vapi);
EXPORT_SYMBOL(ivtv_vapi_result);
Expand Down
26 changes: 3 additions & 23 deletions drivers/media/video/ivtv/ivtv-driver.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,9 @@

extern const u32 yuv_offset[4];

/* Maximum ivtv driver instances.
Based on 6 PVR500s each with two PVR15s...
TODO: make this dynamic. I believe it is only a global in order to support
ivtv-fb. There must be a better way to do that. */
#define IVTV_MAX_CARDS 12
/* Maximum ivtv driver instances. Some people have a huge number of
capture cards, so set this to a high value. */
#define IVTV_MAX_CARDS 32

/* Supported cards */
#define IVTV_CARD_PVR_250 0 /* WinTV PVR 250 */
Expand Down Expand Up @@ -303,28 +301,10 @@ extern const u32 yuv_offset[4];
#define IVTV_DEBUG_HI_DEC(fmt, args...) IVTV_DEBUG_HIGH_VOL(IVTV_DBGFLG_DEC, "dec", fmt , ## args)
#define IVTV_DEBUG_HI_YUV(fmt, args...) IVTV_DEBUG_HIGH_VOL(IVTV_DBGFLG_YUV, "yuv", fmt , ## args)

#define IVTV_FB_DEBUG(x, type, fmt, args...) \
do { \
if ((x) & ivtv_debug) \
printk(KERN_INFO "ivtv%d-fb " type ": " fmt, itv->num , ## args); \
} while (0)
#define IVTV_FB_DEBUG_WARN(fmt, args...) IVTV_FB_DEBUG(IVTV_DBGFLG_WARN, "warning", fmt , ## args)
#define IVTV_FB_DEBUG_INFO(fmt, args...) IVTV_FB_DEBUG(IVTV_DBGFLG_INFO, "info", fmt , ## args)
#define IVTV_FB_DEBUG_API(fmt, args...) IVTV_FB_DEBUG(IVTV_DBGFLG_API, "api", fmt , ## args)
#define IVTV_FB_DEBUG_DMA(fmt, args...) IVTV_FB_DEBUG(IVTV_DBGFLG_DMA, "dma", fmt , ## args)
#define IVTV_FB_DEBUG_IOCTL(fmt, args...) IVTV_FB_DEBUG(IVTV_DBGFLG_IOCTL, "ioctl", fmt , ## args)
#define IVTV_FB_DEBUG_I2C(fmt, args...) IVTV_FB_DEBUG(IVTV_DBGFLG_I2C, "i2c", fmt , ## args)
#define IVTV_FB_DEBUG_IRQ(fmt, args...) IVTV_FB_DEBUG(IVTV_DBGFLG_IRQ, "irq", fmt , ## args)
#define IVTV_FB_DEBUG_DEC(fmt, args...) IVTV_FB_DEBUG(IVTV_DBGFLG_DEC, "dec", fmt , ## args)
#define IVTV_FB_DEBUG_YUV(fmt, args...) IVTV_FB_DEBUG(IVTV_DBGFLG_YUV, "yuv", fmt , ## args)

/* Standard kernel messages */
#define IVTV_ERR(fmt, args...) printk(KERN_ERR "ivtv%d: " fmt, itv->num , ## args)
#define IVTV_WARN(fmt, args...) printk(KERN_WARNING "ivtv%d: " fmt, itv->num , ## args)
#define IVTV_INFO(fmt, args...) printk(KERN_INFO "ivtv%d: " fmt, itv->num , ## args)
#define IVTV_FB_ERR(fmt, args...) printk(KERN_ERR "ivtv%d-fb: " fmt, itv->num , ## args)
#define IVTV_FB_WARN(fmt, args...) printk(KERN_WARNING "ivtv%d-fb: " fmt, itv->num , ## args)
#define IVTV_FB_INFO(fmt, args...) printk(KERN_INFO "ivtv%d-fb: " fmt, itv->num , ## args)

/* Values for IVTV_API_DEC_PLAYBACK_SPEED mpeg_frame_type_mask parameter: */
#define MPEG_FRAME_TYPE_IFRAME 1
Expand Down
Loading

0 comments on commit 32db775

Please sign in to comment.