diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-12-17 00:37:47 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-01-08 19:46:36 +0000 |
commit | f8a5d7737e014e99943b947d088a4f9f1b465d46 (patch) | |
tree | a2acebc3005e52128b6d51b11aaede37d329241c | |
parent | 968151898b807b06953b2f4170ac02889f16c8dc (diff) |
Delete some dead code
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/intel_driver.c | 213 |
1 files changed, 92 insertions, 121 deletions
diff --git a/src/intel_driver.c b/src/intel_driver.c index f9469813..803cf61d 100644 --- a/src/intel_driver.c +++ b/src/intel_driver.c @@ -37,10 +37,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "config.h" #endif -#ifndef PRINT_MODE_INFO -#define PRINT_MODE_INFO 0 -#endif - #include <assert.h> #include <string.h> #include <stdio.h> @@ -80,10 +76,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "i915_drm.h" #include <xf86drmMode.h> -#define BIT(x) (1 << (x)) -#define MAX(a,b) ((a) > (b) ? (a) : (b)) -#define NB_OF(x) (sizeof (x) / sizeof (*x)) - /* *INDENT-OFF* */ /* * Note: "ColorKey" is provided for compatibility with the i810 driver. @@ -607,12 +599,9 @@ static Bool I830PreInit(ScrnInfoPtr scrn, int flags) intel->tiling = TRUE; /* Allow user override if they set a value */ - if (!ALWAYS_TILING(intel) && xf86IsOptionSet(intel->Options, OPTION_TILING)) { - if (xf86ReturnOptValBool(intel->Options, OPTION_TILING, FALSE)) - intel->tiling = TRUE; - else - intel->tiling = FALSE; - } + if (!ALWAYS_TILING(intel)) + intel->tiling = xf86ReturnOptValBool(intel->Options, + OPTION_TILING, TRUE); intel->can_blt = can_accelerate_blt(intel); intel->use_shadow = !intel->can_blt; @@ -631,19 +620,11 @@ static Bool I830PreInit(ScrnInfoPtr scrn, int flags) } /* SwapBuffers delays to avoid tearing */ - intel->swapbuffers_wait = TRUE; - - /* Allow user override if they set a value */ - if (xf86IsOptionSet(intel->Options, OPTION_SWAPBUFFERS_WAIT)) { - if (xf86ReturnOptValBool - (intel->Options, OPTION_SWAPBUFFERS_WAIT, FALSE)) - intel->swapbuffers_wait = TRUE; - else - intel->swapbuffers_wait = FALSE; - } - + intel->swapbuffers_wait = xf86ReturnOptValBool(intel->Options, + OPTION_SWAPBUFFERS_WAIT, + TRUE); if (IS_GEN6(intel)) - intel->swapbuffers_wait = FALSE; + intel->swapbuffers_wait = FALSE; xf86DrvMsg(scrn->scrnIndex, X_CONFIG, "Tiling %sabled\n", intel->tiling ? "en" : "dis"); @@ -679,19 +660,12 @@ static Bool I830PreInit(ScrnInfoPtr scrn, int flags) } /* Load the dri2 module if requested. */ - if (xf86ReturnOptValBool(intel->Options, OPTION_DRI, FALSE) && - intel->directRenderingType != DRI_DISABLED) { + if (intel->directRenderingType != DRI_DISABLED) xf86LoadSubModule(scrn, "dri2"); - } return TRUE; } -enum pipe { - PIPE_A = 0, - PIPE_B, -}; - /** * Intialiazes the hardware for the 3D pipeline use in the 2D driver. * @@ -765,7 +739,7 @@ Bool intel_crtc_on(xf86CrtcPtr crtc) { ScrnInfoPtr scrn = crtc->scrn; xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn); - int i, active_outputs = 0; + int i; if (!crtc->enabled) return FALSE; @@ -775,11 +749,9 @@ Bool intel_crtc_on(xf86CrtcPtr crtc) xf86OutputPtr output = xf86_config->output[i]; if (output->crtc == crtc && intel_output_dpms_status(output) == DPMSModeOn) - active_outputs++; + return TRUE; } - if (active_outputs) - return TRUE; return FALSE; } @@ -805,103 +777,102 @@ intel_flush_callback(CallbackListPtr *list, static void I830HandleUEvents(int fd, void *closure) { - ScrnInfoPtr scrn = closure; + ScrnInfoPtr scrn = closure; intel_screen_private *intel = intel_get_screen_private(scrn); - struct udev_device *dev; - const char *hotplug; - struct stat s; - dev_t udev_devnum; - - dev = udev_monitor_receive_device(intel->uevent_monitor); - if (!dev) - return; - - udev_devnum = udev_device_get_devnum(dev); - fstat(intel->drmSubFD, &s); - /* - * Check to make sure this event is directed at our - * device (by comparing dev_t values), then make - * sure it's a hotplug event (HOTPLUG=1) - */ - - hotplug = udev_device_get_property_value(dev, "HOTPLUG"); - - if (memcmp(&s.st_rdev, &udev_devnum, sizeof (dev_t)) == 0 && - hotplug && atoi(hotplug) == 1) - RRGetInfo(screenInfo.screens[scrn->scrnIndex], TRUE); - - udev_device_unref(dev); + struct udev_device *dev; + const char *hotplug; + struct stat s; + dev_t udev_devnum; + + dev = udev_monitor_receive_device(intel->uevent_monitor); + if (!dev) + return; + + udev_devnum = udev_device_get_devnum(dev); + fstat(intel->drmSubFD, &s); + /* + * Check to make sure this event is directed at our + * device (by comparing dev_t values), then make + * sure it's a hotplug event (HOTPLUG=1) + */ + + hotplug = udev_device_get_property_value(dev, "HOTPLUG"); + + if (memcmp(&s.st_rdev, &udev_devnum, sizeof (dev_t)) == 0 && + hotplug && atoi(hotplug) == 1) + RRGetInfo(screenInfo.screens[scrn->scrnIndex], TRUE); + + udev_device_unref(dev); } static void I830UeventInit(ScrnInfoPtr scrn) { - intel_screen_private *intel = intel_get_screen_private(scrn); - struct udev *u; - struct udev_monitor *mon; - Bool hotplug; - MessageType from = X_CONFIG; - - if (!xf86GetOptValBool(intel->Options, OPTION_HOTPLUG, &hotplug)) { - from = X_DEFAULT; - hotplug = TRUE; - } - - xf86DrvMsg(scrn->scrnIndex, from, "hotplug detection: \"%s\"\n", - hotplug ? "enabled" : "disabled"); - if (!hotplug) - return; - - u = udev_new(); - if (!u) - return; - - mon = udev_monitor_new_from_netlink(u, "udev"); - - if (!mon) { - udev_unref(u); - return; - } - - if (udev_monitor_filter_add_match_subsystem_devtype(mon, - "drm", - "drm_minor") < 0 || - udev_monitor_enable_receiving(mon) < 0) - { - udev_monitor_unref(mon); - udev_unref(u); - return; - } - - intel->uevent_handler = - xf86AddGeneralHandler(udev_monitor_get_fd(mon), - I830HandleUEvents, - scrn); - if (!intel->uevent_handler) { - udev_monitor_unref(mon); - udev_unref(u); - return; - } - - intel->uevent_monitor = mon; + intel_screen_private *intel = intel_get_screen_private(scrn); + struct udev *u; + struct udev_monitor *mon; + Bool hotplug; + MessageType from = X_CONFIG; + + if (!xf86GetOptValBool(intel->Options, OPTION_HOTPLUG, &hotplug)) { + from = X_DEFAULT; + hotplug = TRUE; + } + + xf86DrvMsg(scrn->scrnIndex, from, "hotplug detection: \"%s\"\n", + hotplug ? "enabled" : "disabled"); + if (!hotplug) + return; + + u = udev_new(); + if (!u) + return; + + mon = udev_monitor_new_from_netlink(u, "udev"); + + if (!mon) { + udev_unref(u); + return; + } + + if (udev_monitor_filter_add_match_subsystem_devtype(mon, + "drm", + "drm_minor") < 0 || + udev_monitor_enable_receiving(mon) < 0) + { + udev_monitor_unref(mon); + udev_unref(u); + return; + } + + intel->uevent_handler = + xf86AddGeneralHandler(udev_monitor_get_fd(mon), + I830HandleUEvents, + scrn); + if (!intel->uevent_handler) { + udev_monitor_unref(mon); + udev_unref(u); + return; + } + + intel->uevent_monitor = mon; } static void I830UeventFini(ScrnInfoPtr scrn) { - intel_screen_private *intel = intel_get_screen_private(scrn); + intel_screen_private *intel = intel_get_screen_private(scrn); - if (intel->uevent_handler) - { - struct udev *u = udev_monitor_get_udev(intel->uevent_monitor); + if (intel->uevent_handler) { + struct udev *u = udev_monitor_get_udev(intel->uevent_monitor); - xf86RemoveGeneralHandler(intel->uevent_handler); + xf86RemoveGeneralHandler(intel->uevent_handler); - udev_monitor_unref(intel->uevent_monitor); - udev_unref(u); - intel->uevent_handler = NULL; - intel->uevent_monitor = NULL; - } + udev_monitor_unref(intel->uevent_monitor); + udev_unref(u); + intel->uevent_handler = NULL; + intel->uevent_monitor = NULL; + } } #endif /* HAVE_UDEV */ |