From 720b6e62a42909a17969d5be40ca907d5752cc09 Mon Sep 17 00:00:00 2001 From: austriancoder Date: Wed, 15 Sep 2004 13:46:19 +0000 Subject: we get now videomode from driver and set only a new one, if the wanted one is different to the driver defaults one. --- HISTORY | 4 +++- dxr3interface.c | 24 ++++++++++++++++++------ 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/HISTORY b/HISTORY index f8ff2f1..daf9c25 100644 --- a/HISTORY +++ b/HISTORY @@ -239,4 +239,6 @@ NOTE: I havent found time to include all of the languages, will be done in pre2 - dxr3memcpy.c/h: fix to support older compilers like gcc-2.95 - dxr3memcpy.c/h: should now compile on alpha and powerpc - added many comments into source -- using doxygen for docs \ No newline at end of file +- using doxygen for docs +- cDxr3Interface::ConfigureDevice(): we get now videomode from driver and set only a + new one, if the wanted one is different to the driver defaults one. \ No newline at end of file diff --git a/dxr3interface.c b/dxr3interface.c index 90cd990..6562a3c 100644 --- a/dxr3interface.c +++ b/dxr3interface.c @@ -919,9 +919,17 @@ void cDxr3Interface::UploadMicroCode() //! config and setup device via ioctl calls void cDxr3Interface::ConfigureDevice() { - uint32_t videomode = 0; + // get videomode from driver + uint32_t videomode_from_driver = 0; + + if (ioctl(m_fdControl, EM8300_IOCTL_GET_VIDEOMODE, &videomode_from_driver) == -1) + { + cLog::Instance() << "Unable to get videomode\n"; + exit(1); + } // set video mode + uint32_t videomode = 0; if (cDxr3ConfigData::Instance().GetVideoMode() == PAL) { videomode = EM8300_VIDEOMODE_PAL; @@ -947,12 +955,16 @@ void cDxr3Interface::ConfigureDevice() } } - // make ioctl - if (ioctl(m_fdControl, EM8300_IOCTL_SET_VIDEOMODE, &videomode) == -1) + // are the two videmodes different? + if (videomode_from_driver != videomode) { - cLog::Instance() << "Unable to set videomode\n"; - exit(1); - } + // make ioctl + if (ioctl(m_fdControl, EM8300_IOCTL_SET_VIDEOMODE, &videomode) == -1) + { + cLog::Instance() << "Unable to set videomode\n"; + exit(1); + } + } // set audio mode if (!cDxr3ConfigData::Instance().GetUseDigitalOut()) -- cgit v1.2.3