From e835820e2359952bd42a66137c6b7ab243a5a541 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 3 Apr 2007 19:04:48 +1000 Subject: add initial PCIE GART framework for TTM --- linux-core/drmP.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'linux-core/drmP.h') diff --git a/linux-core/drmP.h b/linux-core/drmP.h index 648e29bc..b6da6926 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -840,6 +840,9 @@ typedef struct drm_agp_ttm_priv { } drm_agp_ttm_priv; #endif +typedef struct ati_pcigart_ttm_priv { + int populated; +} ati_pcigart_ttm_priv; static __inline__ int drm_core_check_feature(struct drm_device *dev, int feature) -- cgit v1.2.3 From 29ac7b1fe364a4be1db7e22d2b400bef04fc240d Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 3 Apr 2007 21:20:00 +1000 Subject: radeon: add setup for PCIE GART ttm --- linux-core/drmP.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'linux-core/drmP.h') diff --git a/linux-core/drmP.h b/linux-core/drmP.h index b6da6926..3ddd405f 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -840,8 +840,16 @@ typedef struct drm_agp_ttm_priv { } drm_agp_ttm_priv; #endif +#define ATI_PCIGART_FLAG_VMALLOC 1 +struct ati_pcigart_memory { + size_t page_count; + unsigned long *memory; + int flags; +}; + typedef struct ati_pcigart_ttm_priv { int populated; + struct ati_pcigart_memory *mem; } ati_pcigart_ttm_priv; static __inline__ int drm_core_check_feature(struct drm_device *dev, -- cgit v1.2.3 From 52f9028c84baea81230dc673b756552e8e90aecd Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 5 Apr 2007 11:21:06 +1000 Subject: Initial import of modesetting for intel driver in DRM --- linux-core/drmP.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'linux-core/drmP.h') diff --git a/linux-core/drmP.h b/linux-core/drmP.h index 648e29bc..db62ab83 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -164,6 +164,8 @@ #include "drm_compat.h" +#include "drm_crtc.h" + /***********************************************************************/ /** \name Macros to make printk easier */ /*@{*/ @@ -827,6 +829,9 @@ typedef struct drm_device { unsigned int drw_info_length; drm_drawable_info_t **drw_info; /*@} */ + + /* DRM mode setting */ + struct drm_crtc_config crtc_config; } drm_device_t; #if __OS_HAS_AGP -- cgit v1.2.3 From a35ba455b27b72f1ee3e1136ca6659f672ada4fa Mon Sep 17 00:00:00 2001 From: Jesse Barnes Date: Sat, 7 Apr 2007 19:22:39 -0700 Subject: make drmP.h include drm_crtc.h for CRTC related stuff. fixup drm_crtc.c so it matches VGA and other outputs properly. make drm_crtc.c less verbose. add function declarations in drm_crtc.h for other files. --- linux-core/drmP.h | 1 + 1 file changed, 1 insertion(+) (limited to 'linux-core/drmP.h') diff --git a/linux-core/drmP.h b/linux-core/drmP.h index db62ab83..74f52854 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -75,6 +75,7 @@ #include #include #include "drm.h" +#include "drm_crtc.h" #include #define __OS_HAS_AGP (defined(CONFIG_AGP) || (defined(CONFIG_AGP_MODULE) && defined(MODULE))) -- cgit v1.2.3 From ed0ebd9d3da2e5c4e8053b6e7a7d2898b184f857 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 10 Apr 2007 18:56:02 +1000 Subject: make crtc_config be named mode_config X.org calls this crtc_config but this is a bad name and will confuse ppl later (and me now :-) --- linux-core/drmP.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'linux-core/drmP.h') diff --git a/linux-core/drmP.h b/linux-core/drmP.h index 74f52854..25fc8733 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -832,7 +832,7 @@ typedef struct drm_device { /*@} */ /* DRM mode setting */ - struct drm_crtc_config crtc_config; + struct drm_mode_config mode_config; } drm_device_t; #if __OS_HAS_AGP -- cgit v1.2.3 From a85440c8a6cac3de4b0e50805fa30cdce40e311b Mon Sep 17 00:00:00 2001 From: Alan Hourihane Date: Thu, 12 Apr 2007 15:11:38 +0100 Subject: Remove extraneous drm_crtc.h include --- linux-core/drmP.h | 1 - 1 file changed, 1 deletion(-) (limited to 'linux-core/drmP.h') diff --git a/linux-core/drmP.h b/linux-core/drmP.h index ac0bd767..0d0ec992 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -75,7 +75,6 @@ #include #include #include "drm.h" -#include "drm_crtc.h" #include #define __OS_HAS_AGP (defined(CONFIG_AGP) || (defined(CONFIG_AGP_MODULE) && defined(MODULE))) -- cgit v1.2.3 From 79aa1d54746f33c33ffbf98fb96ccbf88c3cb390 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 17 Apr 2007 18:16:38 +1000 Subject: another large overhaul of interactions with userspace... We need to keep a list of user created fbs to nuke on master exit. We also need to use the bo properly. --- linux-core/drmP.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'linux-core/drmP.h') diff --git a/linux-core/drmP.h b/linux-core/drmP.h index 0d0ec992..326565cb 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -431,6 +431,8 @@ typedef struct drm_file { drm_open_hash_t refd_object_hash[_DRM_NO_REF_TYPES]; void *driver_priv; + + struct list_head fbs; } drm_file_t; /** Wait queue */ -- cgit v1.2.3 From a18b4befb9b76c4b2662ff6caa0e4f0975eb8e9c Mon Sep 17 00:00:00 2001 From: Jesse Barnes Date: Thu, 17 May 2007 09:00:06 -0700 Subject: Fix FB pitch value (we had it wrong and were working around it in a few places). Add new FB hooks to the drm driver structure and make i915 use them for an Intel specific FB driver. This will allow acceleration and better handling of the command stream. --- linux-core/drmP.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'linux-core/drmP.h') diff --git a/linux-core/drmP.h b/linux-core/drmP.h index 377f447a..2417181d 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -661,6 +661,10 @@ struct drm_driver { unsigned long (*get_reg_ofs) (struct drm_device * dev); void (*set_version) (struct drm_device * dev, drm_set_version_t * sv); + /* FB routines, if present */ + int (*fb_probe)(struct drm_device *dev, struct drm_framebuffer *fb); + int (*fb_remove)(struct drm_device *dev, struct drm_framebuffer *fb); + struct drm_fence_driver *fence_driver; struct drm_bo_driver *bo_driver; -- cgit v1.2.3 From 77b9d9d16b1d1f1715722182d5893aa202f73074 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 5 Jun 2007 10:35:41 +1000 Subject: cleanup pcigart ttm for new backend layout --- linux-core/drmP.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'linux-core/drmP.h') diff --git a/linux-core/drmP.h b/linux-core/drmP.h index ec432b2a..ef9e133a 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -850,10 +850,12 @@ struct ati_pcigart_memory { int flags; }; -typedef struct ati_pcigart_ttm_priv { +typedef struct ati_pcigart_ttm_backend { + drm_ttm_backend_t backend; int populated; + struct ati_pcigart_info *gart_info; struct ati_pcigart_memory *mem; -} ati_pcigart_ttm_priv; +} ati_pcigart_ttm_backend_t; static __inline__ int drm_core_check_feature(struct drm_device *dev, int feature) -- cgit v1.2.3 From 234a9062009e48bf7b6c7239564ab95b3bcb06aa Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 5 Jun 2007 10:47:42 +1000 Subject: WIP cleanup --- linux-core/drmP.h | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'linux-core/drmP.h') diff --git a/linux-core/drmP.h b/linux-core/drmP.h index ef9e133a..16e3f5b0 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -843,18 +843,13 @@ typedef struct drm_agp_ttm_backend { } drm_agp_ttm_backend_t; #endif -#define ATI_PCIGART_FLAG_VMALLOC 1 -struct ati_pcigart_memory { - size_t page_count; - unsigned long *memory; - int flags; -}; - typedef struct ati_pcigart_ttm_backend { drm_ttm_backend_t backend; int populated; struct ati_pcigart_info *gart_info; - struct ati_pcigart_memory *mem; + struct page **pages; + int num_pages; + int bound; } ati_pcigart_ttm_backend_t; static __inline__ int drm_core_check_feature(struct drm_device *dev, -- cgit v1.2.3 From 4294dcc050c5d2685f633e8a52deb925d806be85 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 5 Jun 2007 12:26:06 +1000 Subject: complete PCIE backend for ttm ttm test runs with it at least, needs to do more testing on it --- linux-core/drmP.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'linux-core/drmP.h') diff --git a/linux-core/drmP.h b/linux-core/drmP.h index 16e3f5b0..5eb7c037 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -846,10 +846,13 @@ typedef struct drm_agp_ttm_backend { typedef struct ati_pcigart_ttm_backend { drm_ttm_backend_t backend; int populated; + void (*gart_flush_fn)(struct drm_device *dev); struct ati_pcigart_info *gart_info; + unsigned long offset; struct page **pages; int num_pages; int bound; + drm_device_t *dev; } ati_pcigart_ttm_backend_t; static __inline__ int drm_core_check_feature(struct drm_device *dev, -- cgit v1.2.3 From 5c6a23704afa9445a58585ea2b8686b054f4074a Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 12 Jul 2007 14:25:29 +1000 Subject: Merge branch 'radeon-ttm' of git://people.freedesktop.org/~airlied/drm into radeon-ttm Conflicts: linux-core/ati_pcigart.c linux-core/drmP.h linux-core/radeon_buffer.c --- linux-core/drmP.h | 1 + 1 file changed, 1 insertion(+) (limited to 'linux-core/drmP.h') diff --git a/linux-core/drmP.h b/linux-core/drmP.h index 5eb7c037..4b54c244 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -1161,6 +1161,7 @@ extern int drm_sg_free(struct inode *inode, struct file *filp, /* ATI PCIGART support (ati_pcigart.h) */ extern int drm_ati_pcigart_init(drm_device_t * dev, drm_ati_pcigart_info *gart_info); extern int drm_ati_pcigart_cleanup(drm_device_t * dev, drm_ati_pcigart_info *gart_info); +extern drm_ttm_backend_t *ati_pcigart_init_ttm(struct drm_device *dev, struct ati_pcigart_info *info, void (*gart_flush_fn)(struct drm_device *dev)); extern drm_dma_handle_t *drm_pci_alloc(drm_device_t * dev, size_t size, size_t align, dma_addr_t maxaddr); -- cgit v1.2.3 From e239882b1e90cba0297118ec7dc432bea06b0bd0 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Tue, 4 Dec 2007 15:36:36 +0100 Subject: Modesetting Hotplug --- linux-core/drmP.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'linux-core/drmP.h') diff --git a/linux-core/drmP.h b/linux-core/drmP.h index 4a0cabc3..5e674b2a 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -669,6 +669,7 @@ struct drm_driver { /* FB routines, if present */ int (*fb_probe)(struct drm_device *dev, struct drm_crtc *crtc); int (*fb_remove)(struct drm_device *dev, struct drm_crtc *crtc); + int (*fb_resize)(struct drm_device *dev, struct drm_crtc *crtc); struct drm_fence_driver *fence_driver; struct drm_bo_driver *bo_driver; @@ -1210,6 +1211,7 @@ extern int drm_mm_clean(struct drm_mm *mm); extern unsigned long drm_mm_tail_space(struct drm_mm *mm); extern int drm_mm_remove_space_from_tail(struct drm_mm *mm, unsigned long size); extern int drm_mm_add_space_to_tail(struct drm_mm *mm, unsigned long size); +extern void drm_mm_print(struct drm_mm *mm, const char *name); static inline struct drm_mm *drm_get_mm(struct drm_mm_node *block) { -- cgit v1.2.3 From 10937cf20b6814e4cf68114fab4619fad94eafcb Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Fri, 4 Jan 2008 16:12:24 +1100 Subject: drm: move drm_head to drm_minor and fix up users --- linux-core/drmP.h | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) (limited to 'linux-core/drmP.h') diff --git a/linux-core/drmP.h b/linux-core/drmP.h index 5e674b2a..962ad4eb 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -412,13 +412,12 @@ enum drm_ref_type { struct drm_file { int authenticated; int master; - int minor; pid_t pid; uid_t uid; drm_magic_t magic; unsigned long ioctl_count; struct list_head lhead; - struct drm_head *head; + struct drm_minor *minor; int remove_auth_on_close; unsigned long lock_count; @@ -690,16 +689,19 @@ struct drm_driver { struct pci_driver pci_driver; }; +#define DRM_MINOR_UNASSIGNED 0 +#define DRM_MINOR_CONTROL 1 +#define DRM_MINOR_RENDER 2 /** - * DRM head structure. This structure represent a video head on a card - * that may contain multiple heads. Embed one per head of these in the - * private drm_device structure. + * DRM minor structure. This structure represents a drm minor number. */ -struct drm_head { +struct drm_minor { int minor; /**< Minor device number */ + int type; /**< Control or render */ + dev_t device; /**< Device number for mknod */ struct drm_device *dev; + /* for render nodes */ struct proc_dir_entry *dev_root; /**< proc directory entry */ - dev_t device; /**< Device number for mknod */ struct class_device *dev_class; }; @@ -830,7 +832,10 @@ struct drm_device { struct drm_driver *driver; drm_local_map_t *agp_buffer_map; unsigned int agp_buffer_token; - struct drm_head primary; /**< primary screen head */ + + /* minor number for control node */ + struct drm_minor control; + struct drm_minor primary; /**< primary screen head */ struct drm_fence_manager fm; struct drm_buffer_manager bm; @@ -1153,10 +1158,10 @@ extern void drm_agp_chipset_flush(struct drm_device *dev); extern int drm_get_dev(struct pci_dev *pdev, const struct pci_device_id *ent, struct drm_driver *driver); extern int drm_put_dev(struct drm_device *dev); -extern int drm_put_head(struct drm_head * head); +extern int drm_put_head(struct drm_minor *minor); extern unsigned int drm_debug; /* 1 to enable debug output */ -extern unsigned int drm_cards_limit; -extern struct drm_head **drm_heads; +extern unsigned int drm_minors_limit; +extern struct drm_minor **drm_minors; extern struct class *drm_class; extern struct proc_dir_entry *drm_proc_root; @@ -1193,7 +1198,7 @@ extern void drm_pci_free(struct drm_device *dev, drm_dma_handle_t *dmah); struct drm_sysfs_class; extern struct class *drm_sysfs_create(struct module *owner, char *name); extern void drm_sysfs_destroy(void); -extern int drm_sysfs_device_add(struct drm_device *dev, struct drm_head *head); +extern int drm_sysfs_device_add(struct drm_device *dev, struct drm_minor *minor); extern void drm_sysfs_device_remove(struct drm_device *dev); /* -- cgit v1.2.3 From d3da253adbf471c9af9c68b2ff67cbf516856352 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Fri, 4 Jan 2008 17:49:40 +1100 Subject: drm: add initial support for a drm control device node --- linux-core/drmP.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'linux-core/drmP.h') diff --git a/linux-core/drmP.h b/linux-core/drmP.h index 962ad4eb..5bc4887a 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -699,6 +699,7 @@ struct drm_minor { int minor; /**< Minor device number */ int type; /**< Control or render */ dev_t device; /**< Device number for mknod */ + struct device kdev; /**< Linux device */ struct drm_device *dev; /* for render nodes */ struct proc_dir_entry *dev_root; /**< proc directory entry */ @@ -711,7 +712,6 @@ struct drm_minor { * may contain multiple heads. */ struct drm_device { - struct device dev; /**< Linux device */ char *unique; /**< Unique identifier: e.g., busid */ int unique_len; /**< Length of unique field */ char *devname; /**< For /proc/interrupts */ @@ -1158,7 +1158,7 @@ extern void drm_agp_chipset_flush(struct drm_device *dev); extern int drm_get_dev(struct pci_dev *pdev, const struct pci_device_id *ent, struct drm_driver *driver); extern int drm_put_dev(struct drm_device *dev); -extern int drm_put_head(struct drm_minor *minor); +extern int drm_put_minor(struct drm_minor *minor); extern unsigned int drm_debug; /* 1 to enable debug output */ extern unsigned int drm_minors_limit; extern struct drm_minor **drm_minors; @@ -1198,8 +1198,8 @@ extern void drm_pci_free(struct drm_device *dev, drm_dma_handle_t *dmah); struct drm_sysfs_class; extern struct class *drm_sysfs_create(struct module *owner, char *name); extern void drm_sysfs_destroy(void); -extern int drm_sysfs_device_add(struct drm_device *dev, struct drm_minor *minor); -extern void drm_sysfs_device_remove(struct drm_device *dev); +extern int drm_sysfs_device_add(struct drm_minor *minor); +extern void drm_sysfs_device_remove(struct drm_minor *minor); /* * Basic memory manager support (drm_mm.c) -- cgit v1.2.3 From ebbc2e0a2e19f5e0fdc06af0951d7fc2cc9ddcbe Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 9 Jan 2008 16:31:37 +1100 Subject: add control ioctls --- linux-core/drmP.h | 1 + 1 file changed, 1 insertion(+) (limited to 'linux-core/drmP.h') diff --git a/linux-core/drmP.h b/linux-core/drmP.h index 5bc4887a..2f0791c0 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -302,6 +302,7 @@ typedef int drm_ioctl_compat_t(struct file *filp, unsigned int cmd, #define DRM_AUTH 0x1 #define DRM_MASTER 0x2 #define DRM_ROOT_ONLY 0x4 +#define DRM_CONTROL_ALLOW 0x8 // allow ioctl to operate on control node struct drm_ioctl_desc { unsigned int cmd; -- cgit v1.2.3 From f276c845bde4c712aa383540a2dd2055ecc00031 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 13 Feb 2008 12:12:52 +1000 Subject: drm: re-write minor number allocation to use an idr. Fixup the minor number allocation scheme to use an idr and move the control nodes up higher. --- linux-core/drmP.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'linux-core/drmP.h') diff --git a/linux-core/drmP.h b/linux-core/drmP.h index 1c815c5f..afc16f5f 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -733,11 +733,12 @@ struct drm_driver { #define DRM_MINOR_UNASSIGNED 0 #define DRM_MINOR_CONTROL 1 #define DRM_MINOR_RENDER 2 +#define DRM_MINOR_GPGPU 3 /* this node is restricted to operations that don't require a master */ /** * DRM minor structure. This structure represents a drm minor number. */ struct drm_minor { - int minor; /**< Minor device number */ + int index; /**< Minor device number */ int type; /**< Control or render */ dev_t device; /**< Device number for mknod */ struct device kdev; /**< Linux device */ @@ -882,8 +883,8 @@ struct drm_device { unsigned int agp_buffer_token; /* minor number for control node */ - struct drm_minor control; - struct drm_minor primary; /**< primary screen head */ + struct drm_minor *control; + struct drm_minor *primary; /**< primary screen head */ struct drm_fence_manager fm; struct drm_buffer_manager bm; @@ -1214,13 +1215,15 @@ extern void drm_agp_chipset_flush(struct drm_device *dev); extern int drm_get_dev(struct pci_dev *pdev, const struct pci_device_id *ent, struct drm_driver *driver); extern int drm_put_dev(struct drm_device *dev); -extern int drm_put_minor(struct drm_minor *minor); +extern int drm_put_minor(struct drm_minor **minor); extern unsigned int drm_debug; /* 1 to enable debug output */ extern unsigned int drm_minors_limit; -extern struct drm_minor **drm_minors; + extern struct class *drm_class; extern struct proc_dir_entry *drm_proc_root; +extern struct idr drm_minors_idr; + extern drm_local_map_t *drm_getsarea(struct drm_device *dev); /* Proc support (drm_proc.h) */ -- cgit v1.2.3 From 0fbee62ec14d08714dbc558dd20cc00b9a79c042 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 13 Feb 2008 15:19:42 +1000 Subject: major port of multi-master ideas into modesetting --- linux-core/drmP.h | 59 +++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 42 insertions(+), 17 deletions(-) (limited to 'linux-core/drmP.h') diff --git a/linux-core/drmP.h b/linux-core/drmP.h index afc16f5f..d01bf09d 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -262,11 +262,11 @@ struct drm_file; */ #define LOCK_TEST_WITH_RETURN( dev, file_priv ) \ do { \ - if ( !_DRM_LOCK_IS_HELD( dev->lock.hw_lock->lock ) || \ - dev->lock.file_priv != file_priv ) { \ + if ( !_DRM_LOCK_IS_HELD( dev->primary->master->lock.hw_lock->lock ) || \ + dev->primary->master->lock.file_priv != file_priv ) { \ DRM_ERROR( "%s called without lock held, held %d owner %p %p\n",\ - __FUNCTION__, _DRM_LOCK_IS_HELD( dev->lock.hw_lock->lock ),\ - dev->lock.file_priv, file_priv ); \ + __FUNCTION__, _DRM_LOCK_IS_HELD( dev->primary->master->lock.hw_lock->lock ),\ + dev->primary->master->lock.file_priv, file_priv ); \ return -EINVAL; \ } \ } while (0) @@ -410,7 +410,6 @@ enum drm_ref_type { /** File private data */ struct drm_file { int authenticated; - int master; pid_t pid; uid_t uid; drm_magic_t magic; @@ -431,6 +430,7 @@ struct drm_file { struct drm_open_hash refd_object_hash[_DRM_NO_REF_TYPES]; struct file *filp; + struct drm_master *master; /* this private has a master associated with it */ void *driver_priv; struct list_head fbs; @@ -568,6 +568,8 @@ struct drm_map_list { struct drm_map *map; /**< mapping */ uint64_t user_token; struct drm_mm_node *file_offset_node; + struct drm_master *master; /** if this map is associated with a specific + master */ }; typedef struct drm_map drm_local_map_t; @@ -607,6 +609,27 @@ struct drm_ati_pcigart_info { #include "drm_objects.h" +/* per-master structure */ +struct drm_master { + + struct drm_device *dev; + + char *unique; /**< Unique identifier: e.g., busid */ + int unique_len; /**< Length of unique field */ + + int blocked; /**< Blocked due to VC switch? */ + + /** \name Authentication */ + /*@{ */ + struct drm_open_hash magiclist; + struct list_head magicfree; + /*@} */ + + struct drm_lock_data lock; /**< Information on hardware lock */ + + void *driver_priv; /**< Private structure for driver to use */ +}; + /** * DRM driver structure. This structure represent the common code for * a family of cards. There will one drm_device for each card present @@ -711,6 +734,10 @@ struct drm_driver { int (*fb_remove)(struct drm_device *dev, struct drm_crtc *crtc); int (*fb_resize)(struct drm_device *dev, struct drm_crtc *crtc); + /* Master routines */ + int (*master_create)(struct drm_device *dev, struct drm_master *master); + void (*master_destroy)(struct drm_device *dev, struct drm_master *master); + struct drm_fence_driver *fence_driver; struct drm_bo_driver *bo_driver; @@ -746,6 +773,9 @@ struct drm_minor { /* for render nodes */ struct proc_dir_entry *dev_root; /**< proc directory entry */ struct class_device *dev_class; + + /* for control nodes - a pointer to the current master for this control node */ + struct drm_master *master; }; @@ -754,13 +784,9 @@ struct drm_minor { * may contain multiple heads. */ struct drm_device { - char *unique; /**< Unique identifier: e.g., busid */ - int unique_len; /**< Length of unique field */ char *devname; /**< For /proc/interrupts */ int if_version; /**< Highest interface version set */ - int blocked; /**< Blocked due to VC switch? */ - /** \name Locks */ /*@{ */ spinlock_t count_lock; /**< For inuse, drm_device::open_count, drm_device::buf_use */ @@ -783,12 +809,6 @@ struct drm_device { atomic_t counts[15]; /*@} */ - /** \name Authentication */ - /*@{ */ - struct list_head filelist; - struct drm_open_hash magiclist; - struct list_head magicfree; - /*@} */ /** \name Memory management */ /*@{ */ @@ -809,7 +829,9 @@ struct drm_device { struct idr ctx_idr; struct list_head vmalist; /**< List of vmas (for debugging) */ - struct drm_lock_data lock; /**< Information on hardware lock */ + + struct list_head filelist; +// struct drm_master *master; /*@} */ /** \name DMA queues (contexts) */ @@ -821,6 +843,7 @@ struct drm_device { struct drm_device_dma *dma; /**< Optional pointer for DMA support */ /*@} */ + /** \name Context support */ /*@{ */ int irq; /**< Interrupt used by board */ @@ -884,7 +907,7 @@ struct drm_device { /* minor number for control node */ struct drm_minor *control; - struct drm_minor *primary; /**< primary screen head */ + struct drm_minor *primary; /**< render type primary screen head */ struct drm_fence_manager fm; struct drm_buffer_manager bm; @@ -1212,6 +1235,8 @@ extern int drm_agp_unbind_memory(DRM_AGP_MEM * handle); extern struct drm_ttm_backend *drm_agp_init_ttm(struct drm_device *dev); extern void drm_agp_chipset_flush(struct drm_device *dev); /* Stub support (drm_stub.h) */ +extern struct drm_master *drm_get_master(struct drm_device *dev); +extern void drm_put_master(struct drm_master *master); extern int drm_get_dev(struct pci_dev *pdev, const struct pci_device_id *ent, struct drm_driver *driver); extern int drm_put_dev(struct drm_device *dev); -- cgit v1.2.3 From a4fc1d7ac6be8d2648acda463723d56c68e4122e Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 13 Feb 2008 16:30:15 +1000 Subject: start moving over to proper hierarchy wrt master accesses --- linux-core/drmP.h | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) (limited to 'linux-core/drmP.h') diff --git a/linux-core/drmP.h b/linux-core/drmP.h index d01bf09d..81417f1d 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -262,11 +262,11 @@ struct drm_file; */ #define LOCK_TEST_WITH_RETURN( dev, file_priv ) \ do { \ - if ( !_DRM_LOCK_IS_HELD( dev->primary->master->lock.hw_lock->lock ) || \ - dev->primary->master->lock.file_priv != file_priv ) { \ + if ( !_DRM_LOCK_IS_HELD( file_priv->master->lock.hw_lock->lock ) || \ + file_priv->master->lock.file_priv != file_priv ) { \ DRM_ERROR( "%s called without lock held, held %d owner %p %p\n",\ - __FUNCTION__, _DRM_LOCK_IS_HELD( dev->primary->master->lock.hw_lock->lock ),\ - dev->primary->master->lock.file_priv, file_priv ); \ + __FUNCTION__, _DRM_LOCK_IS_HELD( file_priv->master->lock.hw_lock->lock ),\ + file_priv->master->lock.file_priv, file_priv ); \ return -EINVAL; \ } \ } while (0) @@ -430,9 +430,11 @@ struct drm_file { struct drm_open_hash refd_object_hash[_DRM_NO_REF_TYPES]; struct file *filp; - struct drm_master *master; /* this private has a master associated with it */ 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 */ struct list_head fbs; }; @@ -612,7 +614,8 @@ struct drm_ati_pcigart_info { /* per-master structure */ struct drm_master { - struct drm_device *dev; + struct list_head head; /**< each minor contains a list of masters */ + struct drm_minor *minor; /**< link back to minor we are a master for */ char *unique; /**< Unique identifier: e.g., busid */ int unique_len; /**< Length of unique field */ @@ -775,7 +778,10 @@ struct drm_minor { struct class_device *dev_class; /* for control nodes - a pointer to the current master for this control node */ - struct drm_master *master; + struct drm_master *master; /* currently active master for this node */ + struct list_head master_list; + + /* possibly needs a list of configured modesetting pieces */ }; @@ -831,7 +837,7 @@ struct drm_device { struct list_head vmalist; /**< List of vmas (for debugging) */ struct list_head filelist; -// struct drm_master *master; + /*@} */ /** \name DMA queues (contexts) */ @@ -1235,7 +1241,7 @@ extern int drm_agp_unbind_memory(DRM_AGP_MEM * handle); extern struct drm_ttm_backend *drm_agp_init_ttm(struct drm_device *dev); extern void drm_agp_chipset_flush(struct drm_device *dev); /* Stub support (drm_stub.h) */ -extern struct drm_master *drm_get_master(struct drm_device *dev); +extern struct drm_master *drm_get_master(struct drm_minor *minor); extern void drm_put_master(struct drm_master *master); extern int drm_get_dev(struct pci_dev *pdev, const struct pci_device_id *ent, struct drm_driver *driver); @@ -1252,13 +1258,9 @@ extern struct idr drm_minors_idr; extern drm_local_map_t *drm_getsarea(struct drm_device *dev); /* Proc support (drm_proc.h) */ -extern int drm_proc_init(struct drm_device *dev, - int minor, - struct proc_dir_entry *root, - struct proc_dir_entry **dev_root); -extern int drm_proc_cleanup(int minor, - struct proc_dir_entry *root, - struct proc_dir_entry *dev_root); +int drm_proc_init(struct drm_minor *minor, int minor_id, + struct proc_dir_entry *root); +int drm_proc_cleanup(struct drm_minor *minor, struct proc_dir_entry *root); /* Scatter Gather Support (drm_scatter.h) */ extern void drm_sg_cleanup(struct drm_sg_mem * entry); -- cgit v1.2.3 From f2f8ace3e1342d83096bf392922130d39cd86ec2 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Fri, 15 Feb 2008 09:57:30 +1000 Subject: remove drm_minors_limit --- linux-core/drmP.h | 1 - 1 file changed, 1 deletion(-) (limited to 'linux-core/drmP.h') diff --git a/linux-core/drmP.h b/linux-core/drmP.h index 81417f1d..697dc9a1 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -1248,7 +1248,6 @@ extern int drm_get_dev(struct pci_dev *pdev, const struct pci_device_id *ent, extern int drm_put_dev(struct drm_device *dev); extern int drm_put_minor(struct drm_minor **minor); extern unsigned int drm_debug; /* 1 to enable debug output */ -extern unsigned int drm_minors_limit; extern struct class *drm_class; extern struct proc_dir_entry *drm_proc_root; -- cgit v1.2.3 From 75b01cf996f2efdd72c5280238460443d5d1fbc7 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Fri, 15 Feb 2008 10:04:28 +1000 Subject: switch naming to new proposed scheme --- linux-core/drmP.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'linux-core/drmP.h') diff --git a/linux-core/drmP.h b/linux-core/drmP.h index 697dc9a1..ab17ba0e 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -762,8 +762,8 @@ struct drm_driver { #define DRM_MINOR_UNASSIGNED 0 #define DRM_MINOR_CONTROL 1 -#define DRM_MINOR_RENDER 2 -#define DRM_MINOR_GPGPU 3 /* this node is restricted to operations that don't require a master */ +#define DRM_MINOR_LEGACY 2 +#define DRM_MINOR_RENDER 3 /** * DRM minor structure. This structure represents a drm minor number. */ -- cgit v1.2.3 From 2476cb209ebbb11edace4bbce0cfaff4e1599dca Mon Sep 17 00:00:00 2001 From: Alan Hourihane Date: Fri, 22 Feb 2008 11:46:22 +0000 Subject: Implement short circuit for base change only Allow mode to be set with fb_id set to -1, meaning set the mode with the current fb (if we have one bound). Allow intelfb to hook back up it's fb if modesetting clears it (maybe temporary). Move any crtc->fb related register changes to set_base in intel_fb. General intelfb cleanups. --- linux-core/drmP.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'linux-core/drmP.h') diff --git a/linux-core/drmP.h b/linux-core/drmP.h index 0f42d5b6..181b3a97 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -173,8 +173,6 @@ struct drm_file; #include "drm_compat.h" -#include "drm_crtc.h" - /***********************************************************************/ /** \name Macros to make printk easier */ /*@{*/ @@ -610,6 +608,7 @@ struct drm_ati_pcigart_info { }; #include "drm_objects.h" +#include "drm_crtc.h" /* per-master structure */ struct drm_master { -- cgit v1.2.3 From 75c9e0d3462f04766d490fac5cc93569957a8365 Mon Sep 17 00:00:00 2001 From: Jerome Glisse Date: Tue, 26 Feb 2008 23:30:45 +0100 Subject: radeon: remove TTM from an earlier merge --- linux-core/drmP.h | 1 - 1 file changed, 1 deletion(-) (limited to 'linux-core/drmP.h') diff --git a/linux-core/drmP.h b/linux-core/drmP.h index 181b3a97..51b02dc8 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -1273,7 +1273,6 @@ extern int drm_sg_free(struct drm_device *dev, void *data, /* ATI PCIGART support (ati_pcigart.h) */ extern int drm_ati_pcigart_init(struct drm_device *dev, struct drm_ati_pcigart_info *gart_info); extern int drm_ati_pcigart_cleanup(struct drm_device *dev, struct drm_ati_pcigart_info *gart_info); -extern struct drm_ttm_backend *ati_pcigart_init_ttm(struct drm_device *dev, struct drm_ati_pcigart_info *info, void (*gart_flush_fn)(struct drm_device *dev)); extern drm_dma_handle_t *drm_pci_alloc(struct drm_device *dev, size_t size, size_t align, dma_addr_t maxaddr); -- cgit v1.2.3 From 01dcc47d895997f77c9457558e974d41c23ed4e1 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 28 Feb 2008 16:24:17 +1000 Subject: drm: add modesetting as a driver feature. This change adds a driver feature that for i915 is controlled by a module parameter. You now need to do insmod i915.ko modeset=1 to enable it the modesetting paths. It also fixes up lots of X paths. I can run my new DDX driver on this code with and without modesetting enabled --- linux-core/drmP.h | 1 + 1 file changed, 1 insertion(+) (limited to 'linux-core/drmP.h') diff --git a/linux-core/drmP.h b/linux-core/drmP.h index 51b02dc8..1a0a5659 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -106,6 +106,7 @@ struct drm_file; #define DRIVER_IRQ_SHARED 0x80 #define DRIVER_DMA_QUEUE 0x100 #define DRIVER_FB_DMA 0x200 +#define DRIVER_MODESET 0x400 /*@}*/ -- cgit v1.2.3 From 903d9231d6f998657cc80ee6f20ded4df68e691b Mon Sep 17 00:00:00 2001 From: Alan Hourihane Date: Tue, 11 Mar 2008 20:29:37 +0000 Subject: Add support for monitor hotplug signals/waits Also adjust i915 irq handling as it follows the 16bit'ism's of the i8xx series. --- linux-core/drmP.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'linux-core/drmP.h') diff --git a/linux-core/drmP.h b/linux-core/drmP.h index 47974856..7b21f8a1 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -591,6 +591,13 @@ struct drm_vbl_sig { struct task_struct *task; }; +struct drm_hotplug_sig { + struct list_head head; + unsigned int counter; + struct siginfo info; + struct task_struct *task; +}; + /* location of GART table */ #define DRM_ATI_GART_MAIN 1 #define DRM_ATI_GART_FB 2 @@ -867,6 +874,15 @@ struct drm_device { struct work_struct work; + /** \name HOTPLUG IRQ support */ + /*@{ */ + wait_queue_head_t hotplug_queue; /**< HOTPLUG wait queue */ + spinlock_t hotplug_lock; + struct list_head *hotplug_sigs; /**< signal list to send on HOTPLUG */ + atomic_t hotplug_signal_pending; /* number of signals pending on all crtcs*/ + + /*@} */ + /** \name VBLANK IRQ support */ /*@{ */ @@ -1193,13 +1209,17 @@ extern void drm_driver_irq_preinstall(struct drm_device *dev); extern void drm_driver_irq_postinstall(struct drm_device *dev); extern void drm_driver_irq_uninstall(struct drm_device *dev); +extern int drm_hotplug_init(struct drm_device *dev); +extern int drm_wait_hotplug(struct drm_device *dev, void *data, struct drm_file *filp); extern int drm_vblank_init(struct drm_device *dev, int num_crtcs); extern int drm_wait_vblank(struct drm_device *dev, void *data, struct drm_file *filp); +extern int drm_wait_hotplug(struct drm_device *dev, void *data, struct drm_file *filp); extern int drm_vblank_wait(struct drm_device * dev, unsigned int *vbl_seq); extern void drm_locked_tasklet(struct drm_device *dev, void(*func)(struct drm_device*)); extern u32 drm_vblank_count(struct drm_device *dev, int crtc); extern void drm_update_vblank_count(struct drm_device *dev, int crtc); extern void drm_handle_vblank(struct drm_device *dev, int crtc); +extern void drm_handle_hotplug(struct drm_device *dev); extern int drm_vblank_get(struct drm_device *dev, int crtc); extern void drm_vblank_put(struct drm_device *dev, int crtc); -- cgit v1.2.3 From 607964ed9e5f6d86a0960bef2341e7f5de9c71da Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 17 Mar 2008 16:37:46 +1000 Subject: drm: add master set/drop protocol this may not survive long - just need something for testing --- linux-core/drmP.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'linux-core/drmP.h') diff --git a/linux-core/drmP.h b/linux-core/drmP.h index 8273c879..c2c3cdde 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -1266,6 +1266,10 @@ extern int drm_agp_unbind_memory(DRM_AGP_MEM * handle); extern struct drm_ttm_backend *drm_agp_init_ttm(struct drm_device *dev); extern void drm_agp_chipset_flush(struct drm_device *dev); /* Stub support (drm_stub.h) */ +extern int drm_setmaster_ioctl(struct drm_device *dev, void *data, + struct drm_file *file_priv); +extern int drm_dropmaster_ioctl(struct drm_device *dev, void *data, + struct drm_file *file_priv); extern struct drm_master *drm_get_master(struct drm_minor *minor); extern void drm_put_master(struct drm_master *master); extern int drm_get_dev(struct pci_dev *pdev, const struct pci_device_id *ent, -- cgit v1.2.3 From acb6c9ef97df999f3fa87639b1bb4f2840970f71 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 27 Mar 2008 15:55:49 +1000 Subject: drm: remove authentication on master exit. using contexts for this is bad for multiple masters --- linux-core/drmP.h | 1 - 1 file changed, 1 deletion(-) (limited to 'linux-core/drmP.h') diff --git a/linux-core/drmP.h b/linux-core/drmP.h index c2c3cdde..f96e6bee 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -415,7 +415,6 @@ struct drm_file { unsigned long ioctl_count; struct list_head lhead; struct drm_minor *minor; - int remove_auth_on_close; unsigned long lock_count; /* -- cgit v1.2.3 From 5a3ce06f3a3dfa9412b9660c1e1f35d24c815dbb Mon Sep 17 00:00:00 2001 From: Jesse Barnes Date: Tue, 8 Apr 2008 12:42:23 -0700 Subject: Improved DRM sysfs support This patch ties outputs, output properties and hotplug events into the DRM core. Each output has a corresponding directory under the primary DRM device (usually card0) containing dpms, edid, modes, and connection status files. New hotplug change events occur when outputs are added or hotplug events are detected. --- linux-core/drmP.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'linux-core/drmP.h') diff --git a/linux-core/drmP.h b/linux-core/drmP.h index f96e6bee..24f8c3d8 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -1311,7 +1311,11 @@ struct drm_sysfs_class; extern struct class *drm_sysfs_create(struct module *owner, char *name); extern void drm_sysfs_destroy(void); extern int drm_sysfs_device_add(struct drm_minor *minor); +extern void drm_sysfs_hotplug_event(struct drm_device *dev); extern void drm_sysfs_device_remove(struct drm_minor *minor); +extern char *drm_get_output_status_name(enum drm_output_status status); +extern int drm_sysfs_output_add(struct drm_output *output); +extern void drm_sysfs_output_remove(struct drm_output *output); /* * Basic memory manager support (drm_mm.c) -- cgit v1.2.3 From 7bcbc443f4f5161ab1e1a11cb6694e6d6269377c Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Thu, 8 May 2008 20:10:18 +0200 Subject: i915: Changed intel_fb to use the new drm_crtc_set_config interface --- linux-core/drmP.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'linux-core/drmP.h') diff --git a/linux-core/drmP.h b/linux-core/drmP.h index f5e794e5..52d2782a 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -743,7 +743,7 @@ struct drm_driver { struct drm_set_version *sv); /* FB routines, if present */ - int (*fb_probe)(struct drm_device *dev, struct drm_crtc *crtc); + int (*fb_probe)(struct drm_device *dev, struct drm_crtc *crtc, struct drm_output *output); int (*fb_remove)(struct drm_device *dev, struct drm_crtc *crtc); int (*fb_resize)(struct drm_device *dev, struct drm_crtc *crtc); -- cgit v1.2.3 From a51e38548cfdece2978e9b5f0d6f0467ba7a7272 Mon Sep 17 00:00:00 2001 From: Hong Liu Date: Fri, 9 May 2008 10:06:17 +0800 Subject: fix kernel oops when removing fb drm_crtc->fb may point to NULL, f.e X server will allocate a new fb and assign it to the CRTC at startup, when X server exits, it will destroy the allocated fb, making drm_crtc->fb points to NULL. --- linux-core/drmP.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'linux-core/drmP.h') diff --git a/linux-core/drmP.h b/linux-core/drmP.h index 52d2782a..60ae018e 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -744,7 +744,7 @@ struct drm_driver { /* FB routines, if present */ int (*fb_probe)(struct drm_device *dev, struct drm_crtc *crtc, struct drm_output *output); - int (*fb_remove)(struct drm_device *dev, struct drm_crtc *crtc); + int (*fb_remove)(struct drm_device *dev, struct drm_framebuffer *fb); int (*fb_resize)(struct drm_device *dev, struct drm_crtc *crtc); /* Master routines */ -- cgit v1.2.3 From 9d38448ed33aaff324cc4bbe1e0878593e97d07d Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Fri, 30 May 2008 15:03:12 +1000 Subject: modesetting: the great renaming. Okay we have crtc, encoder and connectors. No more outputs exposed beyond driver internals I've broken intel tv connector stuff. Really for TV we should have one TV connector, with a sub property for the type of signal been driven over it --- linux-core/drmP.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'linux-core/drmP.h') diff --git a/linux-core/drmP.h b/linux-core/drmP.h index 60ae018e..7c7e201a 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -743,7 +743,7 @@ struct drm_driver { struct drm_set_version *sv); /* FB routines, if present */ - int (*fb_probe)(struct drm_device *dev, struct drm_crtc *crtc, struct drm_output *output); + int (*fb_probe)(struct drm_device *dev, struct drm_crtc *crtc, struct drm_connector *connector); int (*fb_remove)(struct drm_device *dev, struct drm_framebuffer *fb); int (*fb_resize)(struct drm_device *dev, struct drm_crtc *crtc); @@ -1317,9 +1317,9 @@ extern void drm_sysfs_destroy(void); extern int drm_sysfs_device_add(struct drm_minor *minor); extern void drm_sysfs_hotplug_event(struct drm_device *dev); extern void drm_sysfs_device_remove(struct drm_minor *minor); -extern char *drm_get_output_status_name(enum drm_output_status status); -extern int drm_sysfs_output_add(struct drm_output *output); -extern void drm_sysfs_output_remove(struct drm_output *output); +extern char *drm_get_connector_status_name(enum drm_connector_status status); +extern int drm_sysfs_connector_add(struct drm_connector *connector); +extern void drm_sysfs_connector_remove(struct drm_connector *connector); /* * Basic memory manager support (drm_mm.c) -- cgit v1.2.3 From 149b17311ad5f117e8f53a7a8cc032e369b95ed2 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 2 Jun 2008 16:45:44 +1000 Subject: drm: initial mode object groups. This creates a default group attached to the legacy drm minor nodes. It covers all the objects in the set. make set resources only return objects for this set. Need to fix up other functions to only work on objects in their allowed set. --- linux-core/drmP.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'linux-core/drmP.h') diff --git a/linux-core/drmP.h b/linux-core/drmP.h index 7c7e201a..11c01386 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -792,7 +792,7 @@ struct drm_minor { struct drm_master *master; /* currently active master for this node */ struct list_head master_list; - /* possibly needs a list of configured modesetting pieces */ + struct drm_mode_group mode_group; }; -- cgit v1.2.3 From 76a44f14d6339e5bc0c936ef4a360f6c152511bd Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 4 Jun 2008 11:59:28 +1000 Subject: drm/modesetting: overhaul the fb create/delete. Move TTM code into the driver --- linux-core/drmP.h | 1 - 1 file changed, 1 deletion(-) (limited to 'linux-core/drmP.h') diff --git a/linux-core/drmP.h b/linux-core/drmP.h index 11c01386..6e627cd9 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -744,7 +744,6 @@ struct drm_driver { /* FB routines, if present */ int (*fb_probe)(struct drm_device *dev, struct drm_crtc *crtc, struct drm_connector *connector); - int (*fb_remove)(struct drm_device *dev, struct drm_framebuffer *fb); int (*fb_resize)(struct drm_device *dev, struct drm_crtc *crtc); /* Master routines */ -- cgit v1.2.3 From 967bd219116a4f20aec828b890a225d2f92afd0b Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 5 Jun 2008 11:11:22 +1000 Subject: modesetting: initial attempt at debonging fb --- linux-core/drmP.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'linux-core/drmP.h') diff --git a/linux-core/drmP.h b/linux-core/drmP.h index 6e627cd9..9845b5c8 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -743,7 +743,7 @@ struct drm_driver { struct drm_set_version *sv); /* FB routines, if present */ - int (*fb_probe)(struct drm_device *dev, struct drm_crtc *crtc, struct drm_connector *connector); + int (*fb_probe)(struct drm_device *dev); int (*fb_resize)(struct drm_device *dev, struct drm_crtc *crtc); /* Master routines */ -- cgit v1.2.3 From f73e54bbf0b97a8f5184ede64d4f263020d623ee Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 5 Jun 2008 13:40:08 +1000 Subject: drm: modesetting unify the hotplug init paths a lot. remove fb callbacks, just probe into the driver to sort it out --- linux-core/drmP.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'linux-core/drmP.h') diff --git a/linux-core/drmP.h b/linux-core/drmP.h index 9845b5c8..5b2d7829 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -742,10 +742,6 @@ struct drm_driver { void (*set_version) (struct drm_device *dev, struct drm_set_version *sv); - /* FB routines, if present */ - int (*fb_probe)(struct drm_device *dev); - int (*fb_resize)(struct drm_device *dev, struct drm_crtc *crtc); - /* Master routines */ int (*master_create)(struct drm_device *dev, struct drm_master *master); void (*master_destroy)(struct drm_device *dev, struct drm_master *master); -- cgit v1.2.3 From 7fd8a5de63781f6faa053509c80e02e8f1cdbb69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Mon, 7 Jul 2008 11:56:59 -0400 Subject: Use lowercase bool constants. --- linux-core/drmP.h | 1 + 1 file changed, 1 insertion(+) (limited to 'linux-core/drmP.h') diff --git a/linux-core/drmP.h b/linux-core/drmP.h index 4a9cc761..8c745502 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -54,6 +54,7 @@ #include /* For (un)lock_kernel */ #include #include +#include #include #include #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16) -- cgit v1.2.3 From df9871064e8b564d9ae2e56d561b64434fd004af Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Sat, 26 Jul 2008 08:56:23 +1000 Subject: radeon: add initial atombios modesetting and GEM -> TTM translation layer. This is an initial import of the atom bios parser with modesetting support for r500 hw using atombios. It also includes a simple memory manager layer that translates a radeon GEM style interface onto TTM internally. So far this memory manager has only been used for pinned object allocation for the DDX to test modesetting. --- linux-core/drmP.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'linux-core/drmP.h') diff --git a/linux-core/drmP.h b/linux-core/drmP.h index 708b4fa0..e3a08e79 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -1046,8 +1046,7 @@ struct drm_agp_ttm_backend { int populated; }; #endif - -typedef struct ati_pcigart_ttm_backend { +struct ati_pcigart_ttm_backend { struct drm_ttm_backend backend; int populated; void (*gart_flush_fn)(struct drm_device *dev); @@ -1057,7 +1056,8 @@ typedef struct ati_pcigart_ttm_backend { int num_pages; int bound; struct drm_device *dev; -} ati_pcigart_ttm_backend_t; +}; +extern struct drm_ttm_backend *ati_pcigart_init_ttm(struct drm_device *dev, struct drm_ati_pcigart_info *info, void (*gart_flush_fn)(struct drm_device *dev)); static __inline__ int drm_core_check_feature(struct drm_device *dev, int feature) @@ -1396,6 +1396,8 @@ extern int drm_sg_free(struct drm_device *dev, void *data, /* ATI PCIGART support (ati_pcigart.h) */ extern int drm_ati_pcigart_init(struct drm_device *dev, struct drm_ati_pcigart_info *gart_info); extern int drm_ati_pcigart_cleanup(struct drm_device *dev, struct drm_ati_pcigart_info *gart_info); +extern int drm_ati_alloc_pcigart_table(struct drm_device *dev, + struct drm_ati_pcigart_info *gart_info); extern drm_dma_handle_t *drm_pci_alloc(struct drm_device *dev, size_t size, size_t align, dma_addr_t maxaddr); -- cgit v1.2.3 From 9b8d71b5eb09857b07409731d3de182751f712a2 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 31 Jul 2008 12:54:48 +1000 Subject: TTM: remove API and userspace objects. This removes all the TTM userspace API and all userspace objects. It also removes the drm_bo_lock.c code --- linux-core/drmP.h | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'linux-core/drmP.h') diff --git a/linux-core/drmP.h b/linux-core/drmP.h index e3a08e79..4938881f 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -405,14 +405,6 @@ struct drm_buf_entry { struct drm_freelist freelist; }; - -enum drm_ref_type { - _DRM_REF_USE = 0, - _DRM_REF_TYPE1, - _DRM_NO_REF_TYPES -}; - - /** File private data */ struct drm_file { int authenticated; @@ -424,21 +416,11 @@ struct drm_file { struct drm_minor *minor; unsigned long lock_count; - /* - * The user object hash table is global and resides in the - * drm_device structure. We protect the lists and hash tables with the - * device struct_mutex. A bit coarse-grained but probably the best - * option. - */ - - struct list_head refd_objects; - /** Mapping of mm object handles to object pointers. */ struct idr object_idr; /** Lock for synchronization of access to object_idr. */ spinlock_t table_lock; - struct drm_open_hash refd_object_hash[_DRM_NO_REF_TYPES]; struct file *filp; void *driver_priv; -- cgit v1.2.3 From 296073dc5f0bf3f8b74a7d6db48b05c09a1b9242 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 31 Jul 2008 14:39:25 +1000 Subject: drm: remove object hash --- linux-core/drmP.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'linux-core/drmP.h') diff --git a/linux-core/drmP.h b/linux-core/drmP.h index 4938881f..59d44ac2 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -166,7 +166,6 @@ typedef unsigned long uintptr_t; #define DRM_MAX_CTXBITMAP (PAGE_SIZE * 8) #define DRM_MAP_HASH_OFFSET 0x10000000 #define DRM_MAP_HASH_ORDER 12 -#define DRM_OBJECT_HASH_ORDER 12 #define DRM_FILE_PAGE_OFFSET_START ((0xFFFFFFFFUL >> PAGE_SHIFT) + 1) #define DRM_FILE_PAGE_OFFSET_SIZE ((0xFFFFFFFFUL >> PAGE_SHIFT) * 16) /* @@ -888,7 +887,6 @@ struct drm_device { int map_count; /**< Number of mappable regions */ struct drm_open_hash map_hash; /**< User token hash table for maps */ struct drm_memrange offset_manager; /**< User token manager */ - struct drm_open_hash object_hash; /**< User token hash table for objects */ struct address_space *dev_mapping; /**< For unmap_mapping_range() */ struct page *ttm_dummy_page; -- cgit v1.2.3 From 717dd804d0d1d9984345a998b28ee47079c70639 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 4 Aug 2008 14:54:32 +1000 Subject: drm: fixup master code to use krefs --- linux-core/drmP.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'linux-core/drmP.h') diff --git a/linux-core/drmP.h b/linux-core/drmP.h index 59d44ac2..848fa885 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -670,7 +670,9 @@ struct drm_gem_object { /* per-master structure */ struct drm_master { - + + struct kref refcount; /* refcount for this master */ + struct list_head head; /**< each minor contains a list of masters */ struct drm_minor *minor; /**< link back to minor we are a master for */ @@ -1345,12 +1347,13 @@ extern int drm_setmaster_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv); extern int drm_dropmaster_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv); -extern struct drm_master *drm_get_master(struct drm_minor *minor); -extern void drm_put_master(struct drm_master *master); +struct drm_master *drm_master_create(struct drm_minor *minor); +extern struct drm_master *drm_master_get(struct drm_master *master); +extern void drm_master_put(struct drm_master **master); extern int drm_get_dev(struct pci_dev *pdev, const struct pci_device_id *ent, - struct drm_driver *driver); + struct drm_driver *driver); extern int drm_put_dev(struct drm_device *dev); -extern int drm_put_minor(struct drm_device *dev, struct drm_minor **p); +extern int drm_put_minor(struct drm_minor **minor_p); extern unsigned int drm_debug; /* 1 to enable debug output */ extern struct class *drm_class; -- cgit v1.2.3