summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authorarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-09-10 20:41:13 +0000
committerarpi <arpi@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-09-10 20:41:13 +0000
commit36abc4832ba772878c66080c93ee4604d9e661ae (patch)
treeed3764beef0fa25ffa82b842e94242e314152edf /libvo
parent6f66631ef54173ce18723bc3a7ef1652452f8ce7 (diff)
downloadmpv-36abc4832ba772878c66080c93ee4604d9e661ae.tar.bz2
mpv-36abc4832ba772878c66080c93ee4604d9e661ae.tar.xz
It prevents mode change when Hsync out of range.
Supports non-countinous Hsync freq spec. patch by Rudolf Marek <MAREKR2@cs.felk.cvut.cz> git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7361 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r--libvo/vo_vesa.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/libvo/vo_vesa.c b/libvo/vo_vesa.c
index 1f788e6bd9..fc17b53c9e 100644
--- a/libvo/vo_vesa.c
+++ b/libvo/vo_vesa.c
@@ -527,6 +527,7 @@ unsigned fillMultiBuffer( unsigned long vsize, unsigned nbuffs )
return i;
}
+
static int set_refresh(unsigned x, unsigned y, unsigned mode,struct VesaCRTCInfoBlock *crtc_pass)
{
unsigned pixclk;
@@ -552,11 +553,12 @@ static int set_refresh(unsigned x, unsigned y, unsigned mode,struct VesaCRTCInfo
do
{
- H_freq -= 0.1;
+ H_freq -= 0.01;
GTF_calcTimings(x,y,H_freq,GTF_HF,0, 0,crtc_pass);
// printf("PixelCLK %d\n",(unsigned)crtc_pass->PixelClock);
}
- while (!in_range(monitor_vfreq,crtc_pass->RefreshRate/100));
+ while ( (!in_range(monitor_vfreq,crtc_pass->RefreshRate/100)||
+ !in_range(monitor_hfreq,H_freq*1000))&&(H_freq>0));
pixclk = crtc_pass->PixelClock;
// printf("PIXclk before %d\n",pixclk);
@@ -575,8 +577,17 @@ static int set_refresh(unsigned x, unsigned y, unsigned mode,struct VesaCRTCInfo
printf("RR %d\n",crtc_pass->RefreshRate);
printf("PixelCLK %d\n",(unsigned)crtc_pass->PixelClock);*/
+
+ if (!in_range(monitor_vfreq,crtc_pass->RefreshRate/100)||
+ !in_range(monitor_hfreq,H_freq*1000)) {
+ printf( "vo_vesa: Unable to fit the mode into monitor's limitation."
+ " Not changing refresh rate.\n");
+ return 0;
+ }
+
return 1;
}
+
/* fullscreen:
* bit 0 (0x01) means fullscreen (-fs)
* bit 1 (0x02) means mode switching (-vm)
@@ -886,11 +897,13 @@ config(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uin
PRINT_VBE_ERR("vbeSaveState",err);
return -1;
}
- /* TODO: check for VBE 3, monitor limitation
- user might pass refresh value
+
+ /* TODO:
+ user might pass refresh value,
GTF constants might be read from monitor
- for best results
+ for best results, I don't have a spec (RM)
*/
+
if (((int)(vib.VESAVersion >> 8) & 0xff) > 2) {
if (set_refresh(dstW,dstH,video_mode,&crtc_pass))