comparison drivers/radeon/radeon_vid.c @ 3380:ae092b46d3c8

Fixed scaling in doublescan & interlaced modes
author nick
date Sat, 08 Dec 2001 08:06:11 +0000
parents 13c202356a41
children 1a1669d42306
comparison
equal deleted inserted replaced
3379:84ed0593187c 3380:ae092b46d3c8
22 /* 22 /*
23 It's entirely possible this major conflicts with something else 23 It's entirely possible this major conflicts with something else
24 mknod /dev/radeon_vid c 178 0 24 mknod /dev/radeon_vid c 178 0
25 or 25 or
26 mknod /dev/rage128_vid c 178 0 26 mknod /dev/rage128_vid c 178 0
27 for Rage128/Rage128Pro chips (althrough it doesn't matter) 27 for Rage128/Rage128Pro chips (although it doesn't matter)
28 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 28 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
29 TESTED and WORKING formats: YUY2, UYVY, IYUV, I420, YV12 29 TESTED and WORKING formats: YUY2, UYVY, IYUV, I420, YV12
30 ----------------------------------------------------------- 30 -----------------------------------------------------------
31 TODO: 31 TODO:
32 Highest priority: fbvid.h compatibility 32 Highest priority: fbvid.h compatibility
329 static int radeon_is_dbl_scan( void ) 329 static int radeon_is_dbl_scan( void )
330 { 330 {
331 return (INREG(CRTC_GEN_CNTL))&CRTC_DBL_SCAN_EN; 331 return (INREG(CRTC_GEN_CNTL))&CRTC_DBL_SCAN_EN;
332 } 332 }
333 333
334 static int radeon_is_interlace( void )
335 {
336 return (INREG(CRTC_GEN_CNTL))&CRTC_INTERLACE_EN;
337 }
334 338
335 static void __init radeon_vid_save_state( void ) 339 static void __init radeon_vid_save_state( void )
336 { 340 {
337 size_t i; 341 size_t i;
338 for(i=0;i<sizeof(vregs)/sizeof(video_registers_t);i++) 342 for(i=0;i<sizeof(vregs)/sizeof(video_registers_t);i++)
494 ,(uint32_t)config->frame_size 498 ,(uint32_t)config->frame_size
495 ,(uint32_t)config->num_frames); 499 ,(uint32_t)config->num_frames);
496 radeon_vid_stop_video(); 500 radeon_vid_stop_video();
497 left = XXX_SRC_X << 16; 501 left = XXX_SRC_X << 16;
498 top = XXX_SRC_Y << 16; 502 top = XXX_SRC_Y << 16;
499 /* FIXME !!! interlace? */
500 if(radeon_is_dbl_scan()) config->dest_height *= 2;
501 src_h = config->src_height; 503 src_h = config->src_height;
502 src_w = config->src_width; 504 src_w = config->src_width;
503 switch(config->format) 505 switch(config->format)
504 { 506 {
505 case IMGFMT_RGB15: 507 case IMGFMT_RGB15:
549 case IMGFMT_RGB24: 551 case IMGFMT_RGB24:
550 case IMGFMT_BGR24: pitch = ((src_w*3) + 15) & ~15; break; 552 case IMGFMT_BGR24: pitch = ((src_w*3) + 15) & ~15; break;
551 case IMGFMT_RGB32: 553 case IMGFMT_RGB32:
552 case IMGFMT_BGR32: pitch = ((src_w*4) + 15) & ~15; break; 554 case IMGFMT_BGR32: pitch = ((src_w*4) + 15) & ~15; break;
553 } 555 }
554 556 if(radeon_is_dbl_scan()) config->dest_height *= 2;
557 else
558 if(radeon_is_interlace()) config->dest_height /= 2;
555 besr.dest_bpp = radeon_vid_get_dbpp(); 559 besr.dest_bpp = radeon_vid_get_dbpp();
556 besr.fourcc = config->format; 560 besr.fourcc = config->format;
557 besr.v_inc = (src_h << 20) / config->dest_height; 561 besr.v_inc = (src_h << 20) / config->dest_height;
558 h_inc = (src_w << 12) / config->dest_width; 562 h_inc = (src_w << 12) / config->dest_width;
559 step_by = 1; 563 step_by = 1;