min() moved out of #if, applied brightness/contrast patch by Brian J. Murrell

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@5014 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
arpi 2002-03-10 03:36:16 +00:00
parent f2dbd24e31
commit bf5be677e2
2 changed files with 22 additions and 2 deletions

View File

@ -97,11 +97,11 @@ static uint8_t *mga_param_buff = NULL;
static uint32_t mga_param_buff_size=0;
static uint32_t mga_param_buff_len=0;
#define min(x,y) (((x)<(y))?(x):(y))
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0)
#include <linux/ctype.h>
#define min(x,y) (((x)<(y))?(x):(y))
unsigned long simple_strtoul(const char *cp,char **endp,unsigned int base)
{
unsigned long result = 0,value;
@ -1141,6 +1141,8 @@ void mga_handle_irq(int irq, void *dev_id, struct pt_regs *pregs) {
static int mga_vid_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
{
int frame;
uint32_t tmp;
switch(cmd)
{
@ -1231,6 +1233,22 @@ static int mga_vid_ioctl(struct inode *inode, struct file *file, unsigned int cm
mga_vid_frame_sel(frame);
break;
case MGA_VID_GET_LUMA:
tmp = regs.beslumactl - 0x80;
if (copy_to_user((uint32_t *) arg, &tmp, sizeof(uint32_t)))
{
printk(KERN_ERR "mga_vid: failed copy %p to userspace %p\n",
&tmp, (uint32_t *) arg);
return(-EFAULT);
}
break;
case MGA_VID_SET_LUMA:
tmp = arg;
regs.beslumactl = tmp + 0x80;
mga_vid_write_regs(0);
break;
default:
printk(KERN_ERR "mga_vid: Invalid ioctl\n");
return (-EINVAL);

View File

@ -47,6 +47,8 @@ uint32_t num_frames;
#define MGA_VID_ON _IO ('J', 2)
#define MGA_VID_OFF _IO ('J', 3)
#define MGA_VID_FSEL _IOR('J', 4, int)
#define MGA_VID_GET_LUMA _IOR('J', 5, int)
#define MGA_VID_SET_LUMA _IOR('J', 6, int)
#define MGA_G200 0x1234
#define MGA_G400 0x5678