diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-06-17 07:00:54 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-06-17 07:03:05 +0100 |
commit | 665bc1735748f266fad5255f82c40edc59ef98e5 (patch) | |
tree | ed2aa93e5f88a7e4b9808c01ed19760df5f76180 /src/sna/sna_display.c | |
parent | ad6235cfb11a5dfdd27106ac45106aaacba73bde (diff) |
sna/display: Remove the caching of the drmModeCrtc
We only use it for the id. Everything else stored on it, like the
buffer_id, is not permanent and we need to query the current status as
required.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_display.c')
-rw-r--r-- | src/sna/sna_display.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c index 85879229..e3f0e98f 100644 --- a/src/sna/sna_display.c +++ b/src/sna/sna_display.c @@ -51,11 +51,12 @@ struct sna_crtc { struct sna *sna; drmModeModeInfo kmode; - drmModeCrtcPtr mode_crtc; PixmapPtr shadow; uint32_t shadow_fb_id; uint32_t cursor; xf86CrtcPtr crtc; + int num; + int id; int pipe; int active; struct list link; @@ -121,7 +122,7 @@ static const char *backlight_interfaces[] = { static inline int crtc_id(struct sna_crtc *crtc) { - return crtc->mode_crtc->crtc_id; + return crtc->id; } int sna_crtc_id(xf86CrtcPtr crtc) @@ -687,6 +688,7 @@ static void sna_crtc_init(ScrnInfoPtr scrn, struct sna_mode *mode, int num) { struct sna *sna = to_sna(scrn); + drmModeCrtcPtr mode_crtc; xf86CrtcPtr crtc; struct sna_crtc *sna_crtc; struct drm_i915_get_pipe_from_crtc_id get_pipe; @@ -695,10 +697,14 @@ sna_crtc_init(ScrnInfoPtr scrn, struct sna_mode *mode, int num) if (sna_crtc == NULL) return; - sna_crtc->mode_crtc = drmModeGetCrtc(sna->kgem.fd, - mode->mode_res->crtcs[num]); + sna_crtc->num = num; + + mode_crtc = drmModeGetCrtc(sna->kgem.fd, mode->mode_res->crtcs[num]); + sna_crtc->id = mode_crtc->crtc_id; + drmModeFreeCrtc(mode_crtc); + get_pipe.pipe = 0; - get_pipe.crtc_id = sna_crtc->mode_crtc->crtc_id; + get_pipe.crtc_id = sna_crtc->id; drmIoctl(sna->kgem.fd, DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID, &get_pipe); |