Module Name: src Committed By: riastradh Date: Sun Dec 19 01:55:45 UTC 2021
Modified Files: src/sys/external/bsd/drm2/dist/include/drm: drmP.h drm_device.h Log Message: struct drm_device is now in drm_device.h. move netbsd ifdef goo there Author: Maya Rashish <m...@netbsd.org> To generate a diff of this commit: cvs rdiff -u -r1.47 -r1.48 src/sys/external/bsd/drm2/dist/include/drm/drmP.h cvs rdiff -u -r1.2 -r1.3 \ src/sys/external/bsd/drm2/dist/include/drm/drm_device.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/external/bsd/drm2/dist/include/drm/drmP.h diff -u src/sys/external/bsd/drm2/dist/include/drm/drmP.h:1.47 src/sys/external/bsd/drm2/dist/include/drm/drmP.h:1.48 --- src/sys/external/bsd/drm2/dist/include/drm/drmP.h:1.47 Sun Dec 19 01:55:37 2021 +++ src/sys/external/bsd/drm2/dist/include/drm/drmP.h Sun Dec 19 01:55:45 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: drmP.h,v 1.47 2021/12/19 01:55:37 riastradh Exp $ */ +/* $NetBSD: drmP.h,v 1.48 2021/12/19 01:55:45 riastradh Exp $ */ /* * Internal Header for the Direct Rendering Manager @@ -654,159 +654,6 @@ struct drm_vblank_crtc { once per disable */ }; -/** - * DRM device structure. This structure represent a complete card that - * may contain multiple heads. - */ -struct drm_device { - struct list_head legacy_dev_list;/**< list of devices per driver for stealth attach cleanup */ - int if_version; /**< Highest interface version set */ - - /** \name Lifetime Management */ - /*@{ */ - struct kref ref; /**< Object ref-count */ - struct device *dev; /**< Device structure of bus-device */ - struct drm_driver *driver; /**< DRM driver managing the device */ - void *dev_private; /**< DRM driver private data */ - struct drm_minor *control; /**< Control node */ - struct drm_minor *primary; /**< Primary node */ - struct drm_minor *render; /**< Render node */ - atomic_t unplugged; /**< Flag whether dev is dead */ - struct inode *anon_inode; /**< inode for private address-space */ - char *unique; /**< unique name of the device */ - /*@} */ - - /** \name Locks */ - /*@{ */ - struct mutex struct_mutex; /**< For others */ - struct mutex master_mutex; /**< For drm_minor::master and drm_file::is_master */ - /*@} */ - - /** \name Usage Counters */ - /*@{ */ - int open_count; /**< Outstanding files open, protected by drm_global_mutex. */ - spinlock_t buf_lock; /**< For drm_device::buf_use and a few other things. */ - int buf_use; /**< Buffers in use -- cannot alloc */ - atomic_t buf_alloc; /**< Buffer allocation in progress */ - /*@} */ - - struct list_head filelist; - - /** \name Memory management */ - /*@{ */ - struct list_head maplist; /**< Linked list of 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 */ - struct mutex ctxlist_mutex; /**< For ctxlist */ - - struct idr ctx_idr; - - struct list_head vmalist; /**< List of vmas (for debugging) */ - - /*@} */ - - /** \name DMA support */ - /*@{ */ - struct drm_device_dma *dma; /**< Optional pointer for DMA support */ - /*@} */ - - /** \name Context support */ - /*@{ */ - - __volatile__ long context_flag; /**< Context swapping flag */ - int last_context; /**< Last current context */ - /*@} */ - - /** \name VBLANK IRQ support */ - /*@{ */ - bool irq_enabled; - int irq; -#ifdef __NetBSD__ - struct drm_bus_irq_cookie *irq_cookie; -#endif - - /* - * At load time, disabling the vblank interrupt won't be allowed since - * old clients may not call the modeset ioctl and therefore misbehave. - * Once the modeset ioctl *has* been called though, we can safely - * disable them when unused. - */ - bool vblank_disable_allowed; - - /* - * If true, vblank interrupt will be disabled immediately when the - * refcount drops to zero, as opposed to via the vblank disable - * timer. - * This can be set to true it the hardware has a working vblank - * counter and the driver uses drm_vblank_on() and drm_vblank_off() - * appropriately. - */ - bool vblank_disable_immediate; - - /* array of size num_crtcs */ - struct drm_vblank_crtc *vblank; - - spinlock_t vblank_time_lock; /**< Protects vblank count and time updates during vblank enable/disable */ - spinlock_t vbl_lock; - - u32 max_vblank_count; /**< size of vblank counter register */ - - /** - * List of events - */ - struct list_head vblank_event_list; - spinlock_t event_lock; - - /*@} */ - - struct drm_agp_head *agp; /**< AGP data */ - - struct pci_dev *pdev; /**< PCI device structure */ -#ifdef __alpha__ - struct pci_controller *hose; -#endif - - struct platform_device *platformdev; /**< Platform device struture */ - struct virtio_device *virtdev; - -#ifdef __NetBSD__ - bus_space_tag_t bst; - struct drm_bus_map *bus_maps; - unsigned bus_nmaps; - bus_dma_tag_t bus_dmat; /* bus's full DMA tag, for internal use */ - bus_dma_tag_t bus_dmat32; /* bus's 32-bit DMA tag */ - bus_dma_tag_t dmat; /* DMA tag for driver, may be subregion */ - bool dmat_subregion_p; - bus_addr_t dmat_subregion_min; - bus_addr_t dmat_subregion_max; - vmem_t *cma_pool; -#endif - - struct drm_sg_mem *sg; /**< Scatter gather memory */ - unsigned int num_crtcs; /**< Number of CRTCs on this device */ - - struct { - int context; - struct drm_hw_lock *lock; - } sigdata; - - struct drm_local_map *agp_buffer_map; - unsigned int agp_buffer_token; - - struct drm_mode_config mode_config; /**< Current mode config */ - - /** \name GEM information */ - /*@{ */ - struct mutex object_name_lock; - struct idr object_name_idr; - struct drm_vma_offset_manager *vma_offset_manager; - /*@} */ - int switch_power_state; -}; - #define DRM_SWITCH_POWER_ON 0 #define DRM_SWITCH_POWER_OFF 1 #define DRM_SWITCH_POWER_CHANGING 2 Index: src/sys/external/bsd/drm2/dist/include/drm/drm_device.h diff -u src/sys/external/bsd/drm2/dist/include/drm/drm_device.h:1.2 src/sys/external/bsd/drm2/dist/include/drm/drm_device.h:1.3 --- src/sys/external/bsd/drm2/dist/include/drm/drm_device.h:1.2 Sat Dec 18 23:45:45 2021 +++ src/sys/external/bsd/drm2/dist/include/drm/drm_device.h Sun Dec 19 01:55:45 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: drm_device.h,v 1.2 2021/12/18 23:45:45 riastradh Exp $ */ +/* $NetBSD: drm_device.h,v 1.3 2021/12/19 01:55:45 riastradh Exp $ */ #ifndef _DRM_DEVICE_H_ #define _DRM_DEVICE_H_ @@ -194,6 +194,9 @@ struct drm_device { * @irq: Used by the drm_irq_install() and drm_irq_unistall() helpers. */ int irq; +#ifdef __NetBSD__ + struct drm_bus_irq_cookie *irq_cookie; +#endif /** * @vblank_disable_immediate: @@ -276,6 +279,20 @@ struct drm_device { /** @hose: PCI hose, only used on ALPHA platforms. */ struct pci_controller *hose; #endif + +#ifdef __NetBSD__ + bus_space_tag_t bst; + struct drm_bus_map *bus_maps; + unsigned bus_nmaps; + bus_dma_tag_t bus_dmat; /* bus's full DMA tag, for internal use */ + bus_dma_tag_t bus_dmat32; /* bus's 32-bit DMA tag */ + bus_dma_tag_t dmat; /* DMA tag for driver, may be subregion */ + bool dmat_subregion_p; + bus_addr_t dmat_subregion_min; + bus_addr_t dmat_subregion_max; + vmem_t *cma_pool; +#endif + /** @num_crtcs: Number of CRTCs on this device */ unsigned int num_crtcs;