Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/drm2/dist/include/drm Move drm_device ifdef...



details:   https://anonhg.NetBSD.org/src/rev/22cb6b724ab2
branches:  trunk
changeset: 1028129:22cb6b724ab2
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 01:56:33 2021 +0000

description:
Move drm_device ifdef goo to drm_drv.h

And drm vblank stuff to drm_vblank.h


Author: Maya Rashish <maya%NetBSD.org@localhost>

diffstat:

 sys/external/bsd/drm2/dist/include/drm/drmP.h       |  381 +-------------------
 sys/external/bsd/drm2/dist/include/drm/drm_drv.h    |   23 +-
 sys/external/bsd/drm2/dist/include/drm/drm_vblank.h |   10 +-
 3 files changed, 32 insertions(+), 382 deletions(-)

diffs (truncated from 503 to 300 lines):

diff -r d9c519505af0 -r 22cb6b724ab2 sys/external/bsd/drm2/dist/include/drm/drmP.h
--- a/sys/external/bsd/drm2/dist/include/drm/drmP.h     Sun Dec 19 01:56:24 2021 +0000
+++ b/sys/external/bsd/drm2/dist/include/drm/drmP.h     Sun Dec 19 01:56:33 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: drmP.h,v 1.52 2021/12/19 01:56:24 riastradh Exp $      */
+/*     $NetBSD: drmP.h,v 1.53 2021/12/19 01:56:33 riastradh Exp $      */
 
 /*
  * Internal Header for the Direct Rendering Manager
@@ -263,288 +263,6 @@
        void *driver_priv;
 };
 
-/* Size of ringbuffer for vblank timestamps. Just double-buffer
- * in initial implementation.
- */
-#define DRM_VBLANKTIME_RBSIZE 2
-
-/* Flags and return codes for get_vblank_timestamp() driver function. */
-#define DRM_CALLED_FROM_VBLIRQ 1
-#define DRM_VBLANKTIME_SCANOUTPOS_METHOD (1 << 0)
-#define DRM_VBLANKTIME_IN_VBLANK         (1 << 1)
-
-/* get_scanout_position() return flags */
-#define DRM_SCANOUTPOS_VALID        (1 << 0)
-#define DRM_SCANOUTPOS_IN_VBLANK    (1 << 1)
-#define DRM_SCANOUTPOS_ACCURATE     (1 << 2)
-
-/**
- * DRM driver structure. This structure represent the common code for
- * a family of cards. There will one drm_device for each card present
- * in this family
- */
-struct drm_driver {
-       int (*load) (struct drm_device *, unsigned long flags);
-       int (*firstopen) (struct drm_device *);
-       int (*open) (struct drm_device *, struct drm_file *);
-       void (*preclose) (struct drm_device *, struct drm_file *file_priv);
-       void (*postclose) (struct drm_device *, struct drm_file *);
-       void (*lastclose) (struct drm_device *);
-       int (*unload) (struct drm_device *);
-       int (*suspend) (struct drm_device *, pm_message_t state);
-       int (*resume) (struct drm_device *);
-       int (*dma_ioctl) (struct drm_device *dev, void *data, struct drm_file *file_priv);
-       int (*dma_quiescent) (struct drm_device *);
-       int (*context_dtor) (struct drm_device *dev, int context);
-       int (*set_busid)(struct drm_device *dev, struct drm_master *master);
-       int (*set_unique)(struct drm_device *dev, struct drm_master *master,
-           struct drm_unique *);
-
-       /**
-        * get_vblank_counter - get raw hardware vblank counter
-        * @dev: DRM device
-        * @pipe: counter to fetch
-        *
-        * Driver callback for fetching a raw hardware vblank counter for @crtc.
-        * If a device doesn't have a hardware counter, the driver can simply
-        * return the value of drm_vblank_count. The DRM core will account for
-        * missed vblank events while interrupts where disabled based on system
-        * timestamps.
-        *
-        * Wraparound handling and loss of events due to modesetting is dealt
-        * with in the DRM core code.
-        *
-        * RETURNS
-        * Raw vblank counter value.
-        */
-       u32 (*get_vblank_counter) (struct drm_device *dev, unsigned int pipe);
-
-       /**
-        * enable_vblank - enable vblank interrupt events
-        * @dev: DRM device
-        * @pipe: which irq to enable
-        *
-        * Enable vblank interrupts for @crtc.  If the device doesn't have
-        * a hardware vblank counter, this routine should be a no-op, since
-        * interrupts will have to stay on to keep the count accurate.
-        *
-        * RETURNS
-        * Zero on success, appropriate errno if the given @crtc's vblank
-        * interrupt cannot be enabled.
-        */
-       int (*enable_vblank) (struct drm_device *dev, unsigned int pipe);
-
-       /**
-        * disable_vblank - disable vblank interrupt events
-        * @dev: DRM device
-        * @pipe: which irq to enable
-        *
-        * Disable vblank interrupts for @crtc.  If the device doesn't have
-        * a hardware vblank counter, this routine should be a no-op, since
-        * interrupts will have to stay on to keep the count accurate.
-        */
-       void (*disable_vblank) (struct drm_device *dev, unsigned int pipe);
-
-       /**
-        * Called by \c drm_device_is_agp.  Typically used to determine if a
-        * card is really attached to AGP or not.
-        *
-        * \param dev  DRM device handle
-        *
-        * \returns
-        * One of three values is returned depending on whether or not the
-        * card is absolutely \b not AGP (return of 0), absolutely \b is AGP
-        * (return of 1), or may or may not be AGP (return of 2).
-        */
-       int (*device_is_agp) (struct drm_device *dev);
-
-       /**
-        * Called by vblank timestamping code.
-        *
-        * Return the current display scanout position from a crtc, and an
-        * optional accurate ktime_get timestamp of when position was measured.
-        *
-        * \param dev  DRM device.
-        * \param pipe Id of the crtc to query.
-        * \param flags Flags from the caller (DRM_CALLED_FROM_VBLIRQ or 0).
-        * \param *vpos Target location for current vertical scanout position.
-        * \param *hpos Target location for current horizontal scanout position.
-        * \param *stime Target location for timestamp taken immediately before
-        *               scanout position query. Can be NULL to skip timestamp.
-        * \param *etime Target location for timestamp taken immediately after
-        *               scanout position query. Can be NULL to skip timestamp.
-        * \param mode Current display timings.
-        *
-        * Returns vpos as a positive number while in active scanout area.
-        * Returns vpos as a negative number inside vblank, counting the number
-        * of scanlines to go until end of vblank, e.g., -1 means "one scanline
-        * until start of active scanout / end of vblank."
-        *
-        * \return 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.
-        *
-        */
-       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);
-
-       /**
-        * Called by \c drm_get_last_vbltimestamp. Should return a precise
-        * timestamp when the most recent VBLANK interval ended or will end.
-        *
-        * Specifically, the timestamp in @vblank_time should correspond as
-        * closely as possible to the time when the first video scanline of
-        * the video frame after the end of VBLANK will start scanning out,
-        * the time immediately after end of the VBLANK interval. If the
-        * @crtc is currently inside VBLANK, this will be a time in the future.
-        * If the @crtc is currently scanning out a frame, this will be the
-        * past start time of the current scanout. This is meant to adhere
-        * to the OpenML OML_sync_control extension specification.
-        *
-        * \param dev dev DRM device handle.
-        * \param pipe crtc for which timestamp should be returned.
-        * \param *max_error Maximum allowable timestamp error in nanoseconds.
-        *                   Implementation should strive to provide timestamp
-        *                   with an error of at most *max_error nanoseconds.
-        *                   Returns true upper bound on error for timestamp.
-        * \param *vblank_time Target location for returned vblank timestamp.
-        * \param flags 0 = Defaults, no special treatment needed.
-        * \param       DRM_CALLED_FROM_VBLIRQ = Function is called from vblank
-        *              irq handler. Some drivers need to apply some workarounds
-        *              for gpu-specific vblank irq quirks if flag is set.
-        *
-        * \returns
-        * Zero if timestamping isn't supported in current display mode or a
-        * negative number on failure. A positive status code on success,
-        * which describes how the vblank_time timestamp was computed.
-        */
-       int (*get_vblank_timestamp) (struct drm_device *dev, unsigned int pipe,
-                                    int *max_error,
-                                    struct timeval *vblank_time,
-                                    unsigned flags);
-
-       /* these have to be filled in */
-
-       irqreturn_t(*irq_handler) (DRM_IRQ_ARGS);
-       void (*irq_preinstall) (struct drm_device *dev);
-       int (*irq_postinstall) (struct drm_device *dev);
-       void (*irq_uninstall) (struct drm_device *dev);
-
-#ifdef __NetBSD__
-       int (*request_irq)(struct drm_device *, int);
-       void (*free_irq)(struct drm_device *);
-#endif
-
-       /* Master routines */
-       int (*master_create)(struct drm_device *dev, struct drm_master *master);
-       void (*master_destroy)(struct drm_device *dev, struct drm_master *master);
-       /**
-        * master_set is called whenever the minor master is set.
-        * master_drop is called whenever the minor master is dropped.
-        */
-
-       int (*master_set)(struct drm_device *dev, struct drm_file *file_priv,
-                         bool from_open);
-       void (*master_drop)(struct drm_device *dev, struct drm_file *file_priv,
-                           bool from_release);
-
-       int (*debugfs_init)(struct drm_minor *minor);
-       void (*debugfs_cleanup)(struct drm_minor *minor);
-
-       /**
-        * Driver-specific constructor for drm_gem_objects, to set up
-        * obj->driver_private.
-        *
-        * Returns 0 on success.
-        */
-       void (*gem_free_object) (struct drm_gem_object *obj);
-       int (*gem_open_object) (struct drm_gem_object *, struct drm_file *);
-       void (*gem_close_object) (struct drm_gem_object *, struct drm_file *);
-
-       /* prime: */
-       /* export handle -> fd (see drm_gem_prime_handle_to_fd() helper) */
-       int (*prime_handle_to_fd)(struct drm_device *dev, struct drm_file *file_priv,
-                               uint32_t handle, uint32_t flags, int *prime_fd);
-       /* import fd -> handle (see drm_gem_prime_fd_to_handle() helper) */
-       int (*prime_fd_to_handle)(struct drm_device *dev, struct drm_file *file_priv,
-                               int prime_fd, uint32_t *handle);
-       /* export GEM -> dmabuf */
-       struct dma_buf * (*gem_prime_export)(struct drm_device *dev,
-                               struct drm_gem_object *obj, int flags);
-       /* import dmabuf -> GEM */
-       struct drm_gem_object * (*gem_prime_import)(struct drm_device *dev,
-                               struct dma_buf *dma_buf);
-       /* low-level interface used by drm_gem_prime_{import,export} */
-       int (*gem_prime_pin)(struct drm_gem_object *obj);
-       void (*gem_prime_unpin)(struct drm_gem_object *obj);
-       struct reservation_object * (*gem_prime_res_obj)(
-                               struct drm_gem_object *obj);
-       struct sg_table *(*gem_prime_get_sg_table)(struct drm_gem_object *obj);
-       struct drm_gem_object *(*gem_prime_import_sg_table)(
-                               struct drm_device *dev,
-                               struct dma_buf_attachment *attach,
-                               struct sg_table *sgt);
-       void *(*gem_prime_vmap)(struct drm_gem_object *obj);
-       void (*gem_prime_vunmap)(struct drm_gem_object *obj, void *vaddr);
-#ifdef __NetBSD__
-       int (*gem_prime_mmap)(struct drm_gem_object *obj, off_t *offp,
-           size_t len, int prot, int *flagsp, int *advicep,
-           struct uvm_object **uobjp, int *maxprotp);
-#else
-       int (*gem_prime_mmap)(struct drm_gem_object *obj,
-                               struct vm_area_struct *vma);
-#endif
-
-       /* vga arb irq handler */
-       void (*vgaarb_irq)(struct drm_device *dev, bool state);
-
-       /* dumb alloc support */
-       int (*dumb_create)(struct drm_file *file_priv,
-                          struct drm_device *dev,
-                          struct drm_mode_create_dumb *args);
-       int (*dumb_map_offset)(struct drm_file *file_priv,
-                              struct drm_device *dev, uint32_t handle,
-                              uint64_t *offset);
-       int (*dumb_destroy)(struct drm_file *file_priv,
-                           struct drm_device *dev,
-                           uint32_t handle);
-
-       /* Driver private ops for this object */
-#ifdef __NetBSD__
-       int (*mmap_object)(struct drm_device *, off_t, size_t, int,
-           struct uvm_object **, voff_t *, struct file *);
-       const struct uvm_pagerops *gem_uvm_ops;
-#else
-       const struct vm_operations_struct *gem_vm_ops;
-#endif
-
-       int major;
-       int minor;
-       int patchlevel;
-       const char *name;
-       const char *desc;
-       const char *date;
-
-       u32 driver_features;
-       int dev_priv_size;
-       const struct drm_ioctl_desc *ioctls;
-       int num_ioctls;
-       const struct file_operations *fops;
-
-#ifdef __NetBSD__
-       int (*ioctl_override)(struct file *, unsigned long, void *);
-#endif
-
-       /* List of devices hanging off this driver with stealth attach. */
-       struct list_head legacy_dev_list;
-};
-
 enum drm_minor_type {
        DRM_MINOR_LEGACY,
        DRM_MINOR_CONTROL,
@@ -598,38 +316,6 @@
 };



Home | Main Index | Thread Index | Old Index