changeset 3369:13c202356a41

Fixed scaling in doublescan modes
author nick
date Fri, 07 Dec 2001 12:01:43 +0000
parents 39ad81ffebf9
children 963c109b0b7e
files drivers/radeon/radeon_vid.c
diffstat 1 files changed, 10 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/drivers/radeon/radeon_vid.c	Fri Dec 07 10:48:17 2001 +0000
+++ b/drivers/radeon/radeon_vid.c	Fri Dec 07 12:01:43 2001 +0000
@@ -37,7 +37,6 @@
 		Y42T, V422, V655, CLJR, YUVP, UYVP, Mpeg PES (mpeg-1,2) support
   ...........................................................
   BUGS and LACKS:
-    Wrong aspect of scaling if image_height < 200 && screen_height == 200
     Color and video keys don't work
     Contrast and brightness are unconfigurable on radeons
 */
@@ -327,6 +326,12 @@
   return retval;
 }
 
+static int radeon_is_dbl_scan( void )
+{
+  return (INREG(CRTC_GEN_CNTL))&CRTC_DBL_SCAN_EN;
+}
+
+
 static void __init radeon_vid_save_state( void )
 {
   size_t i;
@@ -471,12 +476,6 @@
 #define XXX_SRC_X   0
 #define XXX_SRC_Y   0
 
-#define XXX_WIDTH   config->src_width
-#define XXX_HEIGHT  config->src_height
-
-#define XXX_DRW_W   config->dest_width
-#define XXX_DRW_H   config->dest_height
-
 static int radeon_vid_init_video( mga_vid_config_t *config )
 {
     uint32_t tmp,src_w,src_h,pitch,h_inc,step_by,left,leftUV,top;
@@ -497,6 +496,8 @@
     radeon_vid_stop_video();
     left = XXX_SRC_X << 16;
     top = XXX_SRC_Y << 16;
+/* FIXME !!! interlace? */
+    if(radeon_is_dbl_scan()) config->dest_height *= 2;
     src_h = config->src_height;
     src_w = config->src_width;
     switch(config->format)
@@ -553,8 +554,8 @@
     
     besr.dest_bpp = radeon_vid_get_dbpp();
     besr.fourcc = config->format;
-    besr.v_inc = (src_h << 20) / XXX_DRW_H;
-    h_inc = (src_w << 12) / XXX_DRW_W;
+    besr.v_inc = (src_h << 20) / config->dest_height;
+    h_inc = (src_w << 12) / config->dest_width;
     step_by = 1;
 
     while(h_inc >= (2 << 12)) {