linux/drivers/media/pci/ivtv/ivtvfb.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
    On Screen Display cx23415 Framebuffer driver

    This module presents the cx23415 OSD (onscreen display) framebuffer memory
    as a standard Linux /dev/fb style framebuffer device. The framebuffer has
    support for 8, 16 & 32 bpp packed pixel formats with alpha channel. In 16bpp
    mode, there is a choice of a three color depths (12, 15 or 16 bits), but no
    local alpha. The colorspace is selectable between rgb & yuv.
    Depending on the TV standard configured in the ivtv module at load time,
    the initial resolution is either 640x400 (NTSC) or 640x480 (PAL) at 8bpp.
    Video timings are locked to ensure a vertical refresh rate of 50Hz (PAL)
    or 59.94 (NTSC)

    Copyright (c) 2003 Matt T. Yourst <[email protected]>

    Derived from drivers/video/vesafb.c
    Portions (c) 1998 Gerd Knorr <[email protected]>

    2.6 kernel port:
    Copyright (C) 2004 Matthias Badaire

    Copyright (C) 2004  Chris Kennedy <[email protected]>

    Copyright (C) 2006  Ian Armstrong <[email protected]>

 */

#include "ivtv-driver.h"
#include "ivtv-cards.h"
#include "ivtv-i2c.h"
#include "ivtv-udma.h"
#include "ivtv-mailbox.h"
#include "ivtv-firmware.h"

#include <linux/fb.h>
#include <linux/ivtvfb.h>

#if defined(CONFIG_X86_64) && !defined(CONFIG_UML)
#include <asm/memtype.h>
#endif

/* card parameters */
static int ivtvfb_card_id =;
static int ivtvfb_debug;
static bool ivtvfb_force_pat = IS_ENABLED();
static bool osd_laced;
static int osd_depth;
static int osd_upper;
static int osd_left;
static unsigned int osd_yres;
static unsigned int osd_xres;

module_param(ivtvfb_card_id, int, 0444);
module_param_named(debug,ivtvfb_debug, int, 0644);
module_param_named(force_pat, ivtvfb_force_pat, bool, 0644);
module_param(osd_laced, bool, 0444);
module_param(osd_depth, int, 0444);
module_param(osd_upper, int, 0444);
module_param(osd_left, int, 0444);
module_param(osd_yres, uint, 0444);
module_param(osd_xres, uint, 0444);

MODULE_PARM_DESC();

MODULE_PARM_DESC();

MODULE_PARM_DESC();

/* Why upper, left, xres, yres, depth, laced ? To match terminology used
   by fbset.
   Why start at 1 for left & upper coordinate ? Because X doesn't allow 0 */

MODULE_PARM_DESC();

MODULE_PARM_DESC();

MODULE_PARM_DESC();

MODULE_PARM_DESC();

MODULE_PARM_DESC();

MODULE_PARM_DESC();

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();

/* --------------------------------------------------------------------- */

#define IVTVFB_DBGFLG_WARN
#define IVTVFB_DBGFLG_INFO

#define IVTVFB_DEBUG(x, type, fmt, args...)
#define IVTVFB_DEBUG_WARN(fmt, args...)
#define IVTVFB_DEBUG_INFO(fmt, args...)

/* Standard kernel messages */
#define IVTVFB_ERR(fmt, args...)
#define IVTVFB_WARN(fmt, args...)
#define IVTVFB_INFO(fmt, args...)

/* --------------------------------------------------------------------- */

#define IVTV_OSD_MAX_WIDTH
#define IVTV_OSD_MAX_HEIGHT

#define IVTV_OSD_BPP_8
#define IVTV_OSD_BPP_16_444
#define IVTV_OSD_BPP_16_555
#define IVTV_OSD_BPP_16_565
#define IVTV_OSD_BPP_32

struct osd_info {};

struct ivtv_osd_coords {};

/* --------------------------------------------------------------------- */

/* ivtv API calls for framebuffer related support */

static int ivtvfb_get_framebuffer(struct ivtv *itv, u32 *fbbase,
				       u32 *fblength)
{}

static int ivtvfb_get_osd_coords(struct ivtv *itv,
				      struct ivtv_osd_coords *osd)
{}

static int ivtvfb_set_osd_coords(struct ivtv *itv, const struct ivtv_osd_coords *osd)
{}

static int ivtvfb_set_display_window(struct ivtv *itv, struct v4l2_rect *ivtv_window)
{}

static int ivtvfb_prep_dec_dma_to_device(struct ivtv *itv,
				  unsigned long ivtv_dest_addr, void __user *userbuf,
				  int size_in_bytes)
{}

static int ivtvfb_prep_frame(struct ivtv *itv, int cmd, void __user *source,
			      unsigned long dest_offset, int count)
{}

static ssize_t ivtvfb_write(struct fb_info *info, const char __user *buf,
						size_t count, loff_t *ppos)
{}

static int ivtvfb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
{}

/* Framebuffer device handling */

static int ivtvfb_set_var(struct ivtv *itv, struct fb_var_screeninfo *var)
{}

static int ivtvfb_get_fix(struct ivtv *itv, struct fb_fix_screeninfo *fix)
{}

/* Check the requested display mode, returning -EINVAL if we can't
   handle it. */

static int _ivtvfb_check_var(struct fb_var_screeninfo *var, struct ivtv *itv)
{}

static int ivtvfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
{}

static int ivtvfb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
{}

static int ivtvfb_set_par(struct fb_info *info)
{}

static int ivtvfb_setcolreg(unsigned regno, unsigned red, unsigned green,
				unsigned blue, unsigned transp,
				struct fb_info *info)
{}

/* We don't really support blanking. All this does is enable or
   disable the OSD. */
static int ivtvfb_blank(int blank_mode, struct fb_info *info)
{}

static const struct fb_ops ivtvfb_ops =;

/* Restore hardware after firmware restart */
static void ivtvfb_restore(struct ivtv *itv)
{}

/* Initialization */


/* Setup our initial video mode */
static int ivtvfb_init_vidmode(struct ivtv *itv)
{}

/* Find OSD buffer base & size. Add to mtrr. Zero osd buffer. */

static int ivtvfb_init_io(struct ivtv *itv)
{}

/* Release any memory we've grabbed & remove mtrr entry */
static void ivtvfb_release_buffers (struct ivtv *itv)
{}

/* Initialize the specified card */

static int ivtvfb_init_card(struct ivtv *itv)
{}

static int __init ivtvfb_callback_init(struct device *dev, void *p)
{}

static int ivtvfb_callback_cleanup(struct device *dev, void *p)
{}

static int __init ivtvfb_init(void)
{}

static void ivtvfb_cleanup(void)
{}

module_init();
module_exit(ivtvfb_cleanup);