[MPlayer-dev-eng] [PATCH] mga_vid scaler limits

Kalev Soikonen ksop at hot.ee
Sat Dec 16 12:38:02 CET 2006


Hello

Disappointed that -vo xmga would refuse 1280x720 even when scaling was unnecessary,
I went abit poking at my matrox and the mga_vid. It appears G550 can scale larger
frames too, provided filtering is disabled (blockiness or jaggedy edges may result,
but it works).  As long as the short dimension needs no scaling, it looks great.

With this patch, the ...ResolutionTooHigh message is kept as a warning, while the
source is accepted (well, assuming the maximum frame size isn't exceeded, mga_vid
may be overly restrictive in that regard also).

-------------- next part --------------
diff -ur trunk/drivers/mga_vid.c main/drivers/mga_vid.c
--- trunk/drivers/mga_vid.c	2006-06-05 13:29:08.000000000 +0000
+++ main/drivers/mga_vid.c	2006-12-14 07:58:29.000000000 +0000
@@ -799,6 +799,12 @@
 	return -1;
 }
 
+	// hardware limitation?
+	if(sw > 1023)
+		card->regs.besctl &= ~(1<<11);
+	if(sh > 1023)
+		card->regs.besctl &= ~(1<<10);
+
 	// setting black&white mode 
 	card->regs.besctl|=(card->regs.blackie<<20); 
 
diff -ur trunk/libvo/mga_common.c main/libvo/mga_common.c
--- trunk/libvo/mga_common.c	2006-08-01 13:58:19.000000000 +0000
+++ main/libvo/mga_common.c	2006-12-14 07:51:57.000000000 +0000
@@ -374,7 +374,9 @@
 	if(width>1023 || height >1023)
 	{
 		mp_msg(MSGT_VO,MSGL_ERR, MGSTR_LIBVO_MGA_ResolutionTooHigh);
+#if 0
 		return (-1);
+#endif
 	}
 
 	mga_vid_config.src_width = width;
diff -ur trunk/vidix/drivers/mga_vid.c main/vidix/drivers/mga_vid.c
--- trunk/vidix/drivers/mga_vid.c	2006-06-05 13:27:37.000000000 +0000
+++ main/vidix/drivers/mga_vid.c	2006-12-14 07:59:26.000000000 +0000
@@ -863,6 +863,12 @@
 
     }
 
+	// hardware limitation?
+	if(sw > 1023)
+		regs.besctl &= ~(1<<11);
+	if(sh > 1023)
+		regs.besctl &= ~(1<<10);
+
 	//Disable contrast and brightness control
 	regs.besglobctl |= (1<<5) + (1<<7);
 	regs.beslumactl = (0x7f << 16) + (0x80<<0);


More information about the MPlayer-dev-eng mailing list