From 03248a798409ca4dd1caf5e25a3d5f5a80173260 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 17 Dec 2010 00:57:01 +0000 Subject: Cache the fixed crtc<->pipe relationship Signed-off-by: Chris Wilson --- src/intel.h | 6 +----- src/intel_display.c | 17 ++++++++++------- 2 files changed, 11 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/intel.h b/src/intel.h index fff0fbb9..46e6758e 100644 --- a/src/intel.h +++ b/src/intel.h @@ -500,11 +500,7 @@ void I830DRI2FlipEventHandler(unsigned int frame, unsigned int tv_sec, unsigned int tv_usec, void *user_data); extern Bool intel_crtc_on(xf86CrtcPtr crtc); -static inline int intel_crtc_to_pipe(xf86CrtcPtr crtc) -{ - intel_screen_private *intel = intel_get_screen_private(crtc->scrn); - return intel_get_pipe_from_crtc_id(intel->bufmgr, crtc); -} +int intel_crtc_to_pipe(xf86CrtcPtr crtc); /* intel_memory.c */ unsigned long intel_get_fence_size(intel_screen_private *intel, unsigned long size); diff --git a/src/intel_display.c b/src/intel_display.c index 11980135..e3d783c0 100644 --- a/src/intel_display.c +++ b/src/intel_display.c @@ -70,6 +70,7 @@ struct intel_crtc { struct intel_mode *mode; drmModeModeInfo kmode; drmModeCrtcPtr mode_crtc; + int pipe; dri_bo *cursor; dri_bo *rotate_bo; uint32_t rotate_pitch; @@ -678,6 +679,9 @@ intel_crtc_init(ScrnInfoPtr scrn, struct intel_mode *mode, int num) intel_crtc->mode = mode; crtc->driver_private = intel_crtc; + intel_crtc->pipe = drm_intel_get_pipe_from_crtc_id(intel->bufmgr, + crtc_id(intel_crtc)); + intel_crtc->cursor = drm_intel_bo_alloc(intel->bufmgr, "ARGB cursor", HWCURSOR_SIZE_ARGB, GTT_PAGE_SIZE); @@ -1671,16 +1675,15 @@ intel_mode_fini(intel_screen_private *intel) intel->modes = NULL; } -int -intel_get_pipe_from_crtc_id(drm_intel_bufmgr *bufmgr, xf86CrtcPtr crtc) -{ - return drm_intel_get_pipe_from_crtc_id(bufmgr, - crtc_id(crtc->driver_private)); -} - /* for the mode overlay */ int intel_crtc_id(xf86CrtcPtr crtc) { return crtc_id(crtc->driver_private); } + +int intel_crtc_to_pipe(xf86CrtcPtr crtc) +{ + struct intel_crtc *intel_crtc = crtc->driver_private; + return intel_crtc->pipe; +} -- cgit v1.2.3