Add new function for getting a CRTC pointer given a pipe number.
authorJesse Barnes <jbarnes@hobbes.virtuousgeek.org>
Thu, 12 Apr 2007 19:41:56 +0000 (12:41 -0700)
committerJesse Barnes <jbarnes@hobbes.virtuousgeek.org>
Thu, 12 Apr 2007 19:41:56 +0000 (12:41 -0700)
linux-core/intel_display.c

index aed8623..e58b31b 100644 (file)
@@ -1101,6 +1101,18 @@ void intel_crtc_init(drm_device_t *dev, int pipe)
        crtc->driver_private = intel_crtc;
 }
 
+struct drm_crtc *intel_get_crtc_from_pipe(drm_device_t *dev, int pipe)
+{
+       struct drm_crtc *crtc = NULL;
+
+       list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
+               struct intel_crtc *intel_crtc = crtc->driver_private;
+               if (intel_crtc->pipe == pipe)
+                       break;
+       }
+       return crtc;
+}
+
 int intel_output_clones(drm_device_t *dev, int type_mask)
 {
        int index_mask = 0;