]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - include/drm/drm_drv.h
drm: introduce sync objects (v4)
[karo-tx-linux.git] / include / drm / drm_drv.h
index 619da98533cd5374146161dc4008451715510565..d855f9ae41a80e4c77b396e7210609cbee91798e 100644 (file)
@@ -53,6 +53,7 @@ struct drm_mode_create_dumb;
 #define DRIVER_RENDER                  0x8000
 #define DRIVER_ATOMIC                  0x10000
 #define DRIVER_KMS_LEGACY_CONTEXT      0x20000
+#define DRIVER_SYNCOBJ                  0x40000
 
 /**
  * struct drm_driver - DRM driver structure
@@ -265,16 +266,8 @@ struct drm_driver {
         *
         * Returns:
         *
-        * Flags, or'ed together as follows:
-        *
-        * DRM_SCANOUTPOS_VALID:
-        *     Query successful.
-        * DRM_SCANOUTPOS_INVBL:
-        *     Inside vblank.
-        * DRM_SCANOUTPOS_ACCURATE: Returned position is accurate. A lack of
-        *     this flag means that returned position may be offset by a
-        *     constant but unknown small number of scanlines wrt. real scanout
-        *     position.
+        * True on success, false if a reliable scanout position counter could
+        * not be read out.
         *
         * FIXME:
         *
@@ -282,10 +275,10 @@ struct drm_driver {
         * move it to &struct drm_crtc_helper_funcs, like all the other
         * helper-internal hooks.
         */
-       int (*get_scanout_position) (struct drm_device *dev, unsigned int pipe,
-                                    unsigned int flags, int *vpos, int *hpos,
-                                    ktime_t *stime, ktime_t *etime,
-                                    const struct drm_display_mode *mode);
+       bool (*get_scanout_position) (struct drm_device *dev, unsigned int pipe,
+                                     bool in_vblank_irq, int *vpos, int *hpos,
+                                     ktime_t *stime, ktime_t *etime,
+                                     const struct drm_display_mode *mode);
 
        /**
         * @get_vblank_timestamp:
@@ -335,11 +328,40 @@ struct drm_driver {
                                     struct timeval *vblank_time,
                                     bool in_vblank_irq);
 
-       /* these have to be filled in */
-
+       /**
+        * @irq_handler:
+        *
+        * Interrupt handler called when using drm_irq_install(). Not used by
+        * drivers which implement their own interrupt handling.
+        */
        irqreturn_t(*irq_handler) (int irq, void *arg);
+
+       /**
+        * @irq_preinstall:
+        *
+        * Optional callback used by drm_irq_install() which is called before
+        * the interrupt handler is registered. This should be used to clear out
+        * any pending interrupts (from e.g. firmware based drives) and reset
+        * the interrupt handling registers.
+        */
        void (*irq_preinstall) (struct drm_device *dev);
+
+       /**
+        * @irq_postinstall:
+        *
+        * Optional callback used by drm_irq_install() which is called after
+        * the interrupt handler is registered. This should be used to enable
+        * interrupt generation in the hardware.
+        */
        int (*irq_postinstall) (struct drm_device *dev);
+
+       /**
+        * @irq_uninstall:
+        *
+        * Optional callback used by drm_irq_uninstall() which is called before
+        * the interrupt handler is unregistered. This should be used to disable
+        * interrupt generation in the hardware.
+        */
        void (*irq_uninstall) (struct drm_device *dev);
 
        /**