diff options
author | Scott Wood <scottwood@freescale.com> | 2014-04-07 23:49:35 (GMT) |
---|---|---|
committer | Scott Wood <scottwood@freescale.com> | 2014-04-07 23:49:35 (GMT) |
commit | 62b8c978ee6b8d135d9e7953221de58000dba986 (patch) | |
tree | 683b04b2e627f6710c22c151b23c8cc9a165315e /include/drm/drmP.h | |
parent | 78fd82238d0e5716578c326404184a27ba67fd6e (diff) | |
download | linux-fsl-qoriq-62b8c978ee6b8d135d9e7953221de58000dba986.tar.xz |
Rewind v3.13-rc3+ (78fd82238d0e5716) to v3.12
Diffstat (limited to 'include/drm/drmP.h')
-rw-r--r-- | include/drm/drmP.h | 111 |
1 files changed, 65 insertions, 46 deletions
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 1d4a920..b46fb45 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -150,7 +150,6 @@ int drm_err(const char *func, const char *format, ...); #define DRIVER_BUS_PCI 0x1 #define DRIVER_BUS_PLATFORM 0x2 #define DRIVER_BUS_USB 0x3 -#define DRIVER_BUS_HOST1X 0x4 /***********************************************************************/ /** \name Begin the DRM... */ @@ -413,12 +412,7 @@ struct drm_prime_file_private { /** File private data */ struct drm_file { - unsigned always_authenticated :1; - unsigned authenticated :1; - unsigned is_master :1; /* this file private is a master for a minor */ - /* true when the client has asked us to expose stereo 3D mode flags */ - unsigned stereo_allowed :1; - + int authenticated; struct pid *pid; kuid_t uid; drm_magic_t magic; @@ -435,8 +429,10 @@ struct drm_file { struct file *filp; void *driver_priv; + int is_master; /* this file private is a master for a minor */ struct drm_master *master; /* master this node is currently associated with N.B. not always minor->master */ + /** * fbs - List of framebuffers associated with this file. * @@ -671,6 +667,8 @@ struct drm_gem_object { uint32_t pending_read_domains; uint32_t pending_write_domain; + void *driver_private; + /** * dma_buf - dma buf associated with this GEM object * @@ -836,17 +834,12 @@ struct drm_driver { /** * 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. + * Return the current display scanout position from a crtc. * * \param dev DRM device. * \param crtc Id of the crtc to query. * \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. * * Returns vpos as a positive number while in active scanout area. * Returns vpos as a negative number inside vblank, counting the number @@ -863,8 +856,7 @@ struct drm_driver { * */ int (*get_scanout_position) (struct drm_device *dev, int crtc, - int *vpos, int *hpos, ktime_t *stime, - ktime_t *etime); + int *vpos, int *hpos); /** * Called by \c drm_get_last_vbltimestamp. Should return a precise @@ -930,6 +922,7 @@ struct drm_driver { * * Returns 0 on success. */ + int (*gem_init_object) (struct drm_gem_object *obj); 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 *); @@ -1004,6 +997,27 @@ struct drm_driver { #define DRM_MINOR_CONTROL 2 #define DRM_MINOR_RENDER 3 + +/** + * debugfs node list. This structure represents a debugfs file to + * be created by the drm core + */ +struct drm_debugfs_list { + const char *name; /** file name */ + int (*show)(struct seq_file*, void*); /** show callback */ + u32 driver_features; /**< Required driver features for this entry */ +}; + +/** + * debugfs node structure. This structure represents a debugfs file. + */ +struct drm_debugfs_node { + struct list_head list; + struct drm_minor *minor; + struct drm_debugfs_list *debugfs_ent; + struct dentry *dent; +}; + /** * Info file list entry. This structure represents a debugfs or proc file to * be created by the drm core @@ -1032,7 +1046,7 @@ struct drm_minor { int index; /**< Minor device number */ int type; /**< Control or render */ dev_t device; /**< Device number for mknod */ - struct device *kdev; /**< Linux device */ + struct device kdev; /**< Linux device */ struct drm_device *dev; struct dentry *debugfs_root; @@ -1067,19 +1081,6 @@ struct drm_pending_vblank_event { struct drm_event_vblank event; }; -struct drm_vblank_crtc { - wait_queue_head_t queue; /**< VBLANK wait queue */ - struct timeval time[DRM_VBLANKTIME_RBSIZE]; /**< timestamp of current count */ - atomic_t count; /**< number of VBLANK interrupts */ - atomic_t refcount; /* number of users of vblank interruptsper crtc */ - u32 last; /* protected by dev->vbl_lock, used */ - /* for wraparound handling */ - u32 last_wait; /* Last vblank seqno waited per CRTC */ - unsigned int inmodeset; /* Display driver is setting mode */ - bool enabled; /* so we don't call enable more than - once per disable */ -}; - /** * DRM device structure. This structure represent a complete card that * may contain multiple heads. @@ -1104,16 +1105,25 @@ struct drm_device { atomic_t buf_alloc; /**< Buffer allocation in progress */ /*@} */ + /** \name Performance counters */ + /*@{ */ + unsigned long counters; + enum drm_stat_type types[15]; + atomic_t counts[15]; + /*@} */ + struct list_head filelist; /** \name Memory management */ /*@{ */ struct list_head maplist; /**< Linked list of regions */ + int map_count; /**< Number of mappable regions */ struct drm_open_hash map_hash; /**< User token hash table for maps */ /** \name Context handle management */ /*@{ */ struct list_head ctxlist; /**< Linked list of context handles */ + int ctx_count; /**< Number of context handles */ struct mutex ctxlist_mutex; /**< For ctxlist */ struct idr ctx_idr; @@ -1129,11 +1139,12 @@ struct drm_device { /** \name Context support */ /*@{ */ - bool irq_enabled; /**< True if irq handler is enabled */ + int irq_enabled; /**< True if irq handler is enabled */ __volatile__ long context_flag; /**< Context swapping flag */ int last_context; /**< Last current context */ /*@} */ + struct work_struct work; /** \name VBLANK IRQ support */ /*@{ */ @@ -1143,13 +1154,20 @@ struct drm_device { * Once the modeset ioctl *has* been called though, we can safely * disable them when unused. */ - bool vblank_disable_allowed; - - /* array of size num_crtcs */ - struct drm_vblank_crtc *vblank; + int vblank_disable_allowed; + wait_queue_head_t *vbl_queue; /**< VBLANK wait queue */ + atomic_t *_vblank_count; /**< number of VBLANK interrupts (driver must alloc the right number of counters) */ + struct timeval *_vblank_time; /**< timestamp of current vblank_count (drivers must alloc right number of fields) */ spinlock_t vblank_time_lock; /**< Protects vblank count and time updates during vblank enable/disable */ spinlock_t vbl_lock; + atomic_t *vblank_refcount; /* number of users of vblank interruptsper crtc */ + u32 *last_vblank; /* protected by dev->vbl_lock, used */ + /* for wraparound handling */ + int *vblank_enabled; /* so we don't call enable more than + once per disable */ + int *vblank_inmodeset; /* Display driver is setting mode */ + u32 *last_vblank_wait; /* Last vblank seqno waited per CRTC */ struct timer_list vblank_disable_timer; u32 max_vblank_count; /**< size of vblank counter register */ @@ -1166,6 +1184,8 @@ struct drm_device { struct device *dev; /**< Device structure */ struct pci_dev *pdev; /**< PCI device structure */ + int pci_vendor; /**< PCI vendor id */ + int pci_device; /**< PCI device id */ #ifdef __alpha__ struct pci_controller *hose; #endif @@ -1283,8 +1303,6 @@ extern int drm_getstats(struct drm_device *dev, void *data, struct drm_file *file_priv); extern int drm_getcap(struct drm_device *dev, void *data, struct drm_file *file_priv); -extern int drm_setclientcap(struct drm_device *dev, void *data, - struct drm_file *file_priv); extern int drm_setversion(struct drm_device *dev, void *data, struct drm_file *file_priv); extern int drm_noop(struct drm_device *dev, void *data, @@ -1436,6 +1454,7 @@ extern struct drm_master *drm_master_get(struct drm_master *master); extern void drm_master_put(struct drm_master **master); extern void drm_put_dev(struct drm_device *dev); +extern int drm_put_minor(struct drm_minor **minor); extern void drm_unplug_dev(struct drm_device *dev); extern unsigned int drm_debug; extern unsigned int drm_rnodes; @@ -1455,11 +1474,10 @@ extern struct drm_local_map *drm_getsarea(struct drm_device *dev); #if defined(CONFIG_DEBUG_FS) extern int drm_debugfs_init(struct drm_minor *minor, int minor_id, struct dentry *root); -extern int drm_debugfs_create_files(const struct drm_info_list *files, - int count, struct dentry *root, - struct drm_minor *minor); -extern int drm_debugfs_remove_files(const struct drm_info_list *files, - int count, struct drm_minor *minor); +extern int drm_debugfs_create_files(struct drm_info_list *files, int count, + struct dentry *root, struct drm_minor *minor); +extern int drm_debugfs_remove_files(struct drm_info_list *files, int count, + struct drm_minor *minor); extern int drm_debugfs_cleanup(struct drm_minor *minor); #endif @@ -1538,6 +1556,8 @@ int drm_gem_init(struct drm_device *dev); void drm_gem_destroy(struct drm_device *dev); void drm_gem_object_release(struct drm_gem_object *obj); void drm_gem_object_free(struct kref *kref); +struct drm_gem_object *drm_gem_object_alloc(struct drm_device *dev, + size_t size); int drm_gem_object_init(struct drm_device *dev, struct drm_gem_object *obj, size_t size); void drm_gem_private_object_init(struct drm_device *dev, @@ -1625,11 +1645,10 @@ static __inline__ void drm_core_dropmap(struct drm_local_map *map) #include <drm/drm_mem_util.h> -struct drm_device *drm_dev_alloc(struct drm_driver *driver, - struct device *parent); -void drm_dev_free(struct drm_device *dev); -int drm_dev_register(struct drm_device *dev, unsigned long flags); -void drm_dev_unregister(struct drm_device *dev); +extern int drm_fill_in_dev(struct drm_device *dev, + const struct pci_device_id *ent, + struct drm_driver *driver); +int drm_get_minor(struct drm_device *dev, struct drm_minor **minor, int type); /*@}*/ /* PCI section */ |