From c6322b3e8d28cb5a6987e119f27eae70a73ca72f Mon Sep 17 00:00:00 2001 From: Thomas Hilber Date: Wed, 27 May 2009 06:23:20 +0200 Subject: Add new scheduling option. - new scheduling option added Signed-off-by: Thomas Hilber Signed-off-by: Paul Menzel --- src/i830_driver.c | 16 +++++++++++++++- src/i830_video.c | 2 +- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/i830_driver.c b/src/i830_driver.c index c7244b55..7de87691 100644 --- a/src/i830_driver.c +++ b/src/i830_driver.c @@ -201,6 +201,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include #endif #include "sys/resource.h" +#include #ifdef INTEL_XVMC #define _INTEL_XVMC_SERVER_ @@ -1832,7 +1833,20 @@ I830PreInit(ScrnInfoPtr pScrn, int flags) } if (pI830->sync_fields) { if (pI830->SchedPrio != ~0) { - if (pI830->SchedPrio) { + if (pI830->SchedPrio < -20) { + struct sched_param sched; + + sched.sched_priority = -pI830->SchedPrio; + if (sched_setscheduler(0, SCHED_FIFO, &sched)) { + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + "failed to set SCHED_FIFO priority as requested: %s\n", strerror(errno)); + } else { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "set SCHED_FIFO priority to (policy %d/ priority %d) as requested\n", + sched_getscheduler(0), + sched_getparam(0, &sched) ? ~0 : sched.sched_priority); + } + } else if (pI830->SchedPrio) { if (setpriority(PRIO_PROCESS, 0, pI830->SchedPrio)) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "failed to set scheduling priority as requested: %s\n", strerror(errno)); diff --git a/src/i830_video.c b/src/i830_video.c index 474647c7..5d14c5d7 100644 --- a/src/i830_video.c +++ b/src/i830_video.c @@ -3235,7 +3235,7 @@ vga_sync_fields(pI830) if (abs(vbl_usec - vbl_usec_prev) > SYF_WARN_RANGE) { log_graph(vbl_usec - vbl_usec_prev, '%'); } - if (abs(vbl_usec - SYF_PAL_FIELD_CYCLE) > SYF_WARN_RANGE) { + if (abs(vbl_usec - SYF_SYNC_POINT) > SYF_WARN_RANGE) { log_graph(vbl_usec - SYF_SYNC_POINT, ':'); } } -- cgit v1.2.3