summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-12-17 00:57:01 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2011-01-08 19:46:36 +0000
commit03248a798409ca4dd1caf5e25a3d5f5a80173260 (patch)
tree77e169e2bde6135e3e89747ff65c8b13865cc833 /src
parent00a2aee38dc5cbbd4907a593fa8d617f5a20292e (diff)
Cache the fixed crtc<->pipe relationship
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/intel.h6
-rw-r--r--src/intel_display.c17
2 files changed, 11 insertions, 12 deletions
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;
+}