mirror of
https://github.com/mpv-player/mpv.git
synced 2026-10-28 23:13:18 +08:00
Update the SuperH VEU vidix driver with experimental support for VEU3F.
Patch by Magnus Damm, damm opensource se git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29990 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
+37
-2
@@ -219,6 +219,8 @@ static int get_fb_info(char *device, struct fb_info *fip)
|
||||
#define VCOFFR 0x224 /* color conversion offset */
|
||||
#define VCBR 0x228 /* color conversion clip */
|
||||
|
||||
#define VRPBR 0xc8 /* resize passband */
|
||||
|
||||
/* Helper functions for reading registers. */
|
||||
|
||||
static unsigned long read_reg(struct uio_map *ump, int reg_offs)
|
||||
@@ -323,14 +325,19 @@ static void sh_veu_wait_irq(vidix_playback_t *info)
|
||||
|
||||
static int sh_veu_is_veu2h(void)
|
||||
{
|
||||
return uio_mmio.size > 0xb8;
|
||||
return uio_mmio.size == 0x27c;
|
||||
}
|
||||
|
||||
static int sh_veu_is_veu3f(void)
|
||||
{
|
||||
return uio_mmio.size == 0xcc;
|
||||
}
|
||||
|
||||
static unsigned long sh_veu_do_scale(struct uio_map *ump,
|
||||
int vertical, int size_in,
|
||||
int size_out, int crop_out)
|
||||
{
|
||||
unsigned long fixpoint, mant, frac, value, rep;
|
||||
unsigned long fixpoint, mant, frac, value, rep, vb;
|
||||
|
||||
/* calculate FRAC and MANT */
|
||||
do {
|
||||
@@ -402,6 +409,34 @@ static unsigned long sh_veu_do_scale(struct uio_map *ump,
|
||||
}
|
||||
write_reg(ump, value, VRFSR);
|
||||
|
||||
/* VEU3F needs additional VRPBR register handling */
|
||||
if (sh_veu_is_veu3f()) {
|
||||
if (size_out > size_in)
|
||||
vb = 64;
|
||||
else {
|
||||
if ((mant >= 8) && (mant < 16))
|
||||
value = 4;
|
||||
else if ((mant >= 4) && (mant < 8))
|
||||
value = 2;
|
||||
else
|
||||
value = 1;
|
||||
|
||||
vb = 64 * 4096 * value;
|
||||
vb /= 4096 * mant + frac;
|
||||
}
|
||||
|
||||
/* set resize passband register */
|
||||
value = read_reg(ump, VRPBR);
|
||||
if (vertical) {
|
||||
value &= ~0xffff0000;
|
||||
value |= vb << 16;
|
||||
} else {
|
||||
value &= ~0xffff;
|
||||
value |= vb;
|
||||
}
|
||||
write_reg(ump, value, VRPBR);
|
||||
}
|
||||
|
||||
return (((size_in * crop_out) / size_out) + 0x03) & ~0x03;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user