[Mplayer-cvslog] CVS: main/vidix/drivers radeon_vid.c,1.54,1.55
Alex Beregszaszi
alex at mplayerhq.hu
Tue Dec 24 18:41:00 CET 2002
Update of /cvsroot/mplayer/main/vidix/drivers
In directory mail:/var/tmp.root/cvs-serv18329
Modified Files:
radeon_vid.c
Log Message:
correctly save and restore colorkey settings (based on patch by Svante Signell <svante.signell at telia.com>)
Index: radeon_vid.c
===================================================================
RCS file: /cvsroot/mplayer/main/vidix/drivers/radeon_vid.c,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -r1.54 -r1.55
--- radeon_vid.c 22 Dec 2002 14:59:41 -0000 1.54
+++ radeon_vid.c 24 Dec 2002 17:40:57 -0000 1.55
@@ -198,6 +198,12 @@
static void * radeon_mem_base = 0;
static int32_t radeon_overlay_off = 0;
static uint32_t radeon_ram_size = 0;
+/* Restore on exit */
+static uint32_t SAVED_OV0_GRAPHICS_KEY_CLR = 0;
+static uint32_t SAVED_OV0_GRAPHICS_KEY_MSK = 0;
+static uint32_t SAVED_OV0_VID_KEY_CLR = 0;
+static uint32_t SAVED_OV0_VID_KEY_MSK = 0;
+static uint32_t SAVED_OV0_KEY_CNTL = 0;
#define GETREG(TYPE,PTR,OFFZ) (*((volatile TYPE*)((PTR)+(OFFZ))))
#define SETREG(TYPE,PTR,OFFZ,VAL) (*((volatile TYPE*)((PTR)+(OFFZ))))=VAL
@@ -932,6 +938,14 @@
err = mtrr_set_type(pci_info.base0,radeon_ram_size,MTRR_TYPE_WRCOMB);
if(!err) printf(RADEON_MSG" Set write-combining type of video memory\n");
+ radeon_fifo_wait(3);
+ SAVED_OV0_GRAPHICS_KEY_CLR = INREG(OV0_GRAPHICS_KEY_CLR);
+ SAVED_OV0_GRAPHICS_KEY_MSK = INREG(OV0_GRAPHICS_KEY_MSK);
+ SAVED_OV0_VID_KEY_CLR = INREG(OV0_VID_KEY_CLR);
+ SAVED_OV0_VID_KEY_MSK = INREG(OV0_VID_KEY_MSK);
+ SAVED_OV0_KEY_CNTL = INREG(OV0_KEY_CNTL);
+ printf(RADEON_MSG" Saved overlay colorkey settings\n");
+
#ifdef RADEON
switch(def_cap.device_id)
{
@@ -963,11 +977,12 @@
{
/* remove colorkeying */
radeon_fifo_wait(3);
- OUTREG(OV0_GRAPHICS_KEY_CLR, 0);
- OUTREG(OV0_GRAPHICS_KEY_MSK, 0);
- OUTREG(OV0_VID_KEY_CLR, 0);
- OUTREG(OV0_VID_KEY_MSK, 0);
- OUTREG(OV0_KEY_CNTL, 0);
+ OUTREG(OV0_GRAPHICS_KEY_CLR, SAVED_OV0_GRAPHICS_KEY_CLR);
+ OUTREG(OV0_GRAPHICS_KEY_MSK, SAVED_OV0_GRAPHICS_KEY_MSK);
+ OUTREG(OV0_VID_KEY_CLR, SAVED_OV0_VID_KEY_CLR);
+ OUTREG(OV0_VID_KEY_MSK, SAVED_OV0_VID_KEY_MSK);
+ OUTREG(OV0_KEY_CNTL, SAVED_OV0_KEY_CNTL);
+ printf(RADEON_MSG" Restored overlay colorkey settings\n");
unmap_phys_mem(radeon_mem_base,radeon_ram_size);
unmap_phys_mem(radeon_mmio_base,0xFFFF);
More information about the MPlayer-cvslog
mailing list