From 304eda32920b5e23f6b9bc12eb40c7dc52a464ba Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Thu, 9 Jun 2011 00:24:59 +0000 Subject: drm/gem: add hooks to notify driver when object handle is created/destroyed Nouveau is going to use these hooks to map/unmap objects from a client's private GPU address space. Signed-off-by: Ben Skeggs Signed-off-by: Dave Airlie --- include/drm/drmP.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 738b3a5..4912cb7 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -886,6 +886,8 @@ struct drm_driver { */ 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 *); /* vga arb irq handler */ void (*vgaarb_irq)(struct drm_device *dev, bool state); -- cgit v1.1 From 0d74f86f37306da8619eb049d88ab7ee523eec9c Mon Sep 17 00:00:00 2001 From: Konrad Rzeszutek Wilk Date: Wed, 8 Jun 2011 17:06:15 +0000 Subject: ttm: Fix spelling mistakes and remove unused #ifdef . and some comments to make it easier to understand. Ackedby: Randy Dunlap [v2: Added some more updates from Randy Dunlap] Signed-off-by: Konrad Rzeszutek Wilk Signed-off-by: Dave Airlie --- include/drm/ttm/ttm_bo_api.h | 3 --- include/drm/ttm/ttm_bo_driver.h | 6 +++--- include/drm/ttm/ttm_memory.h | 2 +- include/drm/ttm/ttm_object.h | 4 ++-- include/drm/ttm/ttm_page_alloc.h | 2 +- 5 files changed, 7 insertions(+), 10 deletions(-) (limited to 'include') diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h index 62a0e4c..42e3469 100644 --- a/include/drm/ttm/ttm_bo_api.h +++ b/include/drm/ttm/ttm_bo_api.h @@ -662,9 +662,6 @@ extern int ttm_bo_kmap(struct ttm_buffer_object *bo, unsigned long start_page, extern void ttm_bo_kunmap(struct ttm_bo_kmap_obj *map); -#if 0 -#endif - /** * ttm_fbdev_mmap - mmap fbdev memory backed by a ttm buffer object. * diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h index 09af2d7..94eb143 100644 --- a/include/drm/ttm/ttm_bo_driver.h +++ b/include/drm/ttm/ttm_bo_driver.h @@ -78,7 +78,7 @@ struct ttm_backend_func { * * Bind the backend pages into the aperture in the location * indicated by @bo_mem. This function should be able to handle - * differences between aperture- and system page sizes. + * differences between aperture and system page sizes. */ int (*bind) (struct ttm_backend *backend, struct ttm_mem_reg *bo_mem); @@ -88,7 +88,7 @@ struct ttm_backend_func { * @backend: Pointer to a struct ttm_backend. * * Unbind previously bound backend pages. This function should be - * able to handle differences between aperture- and system page sizes. + * able to handle differences between aperture and system page sizes. */ int (*unbind) (struct ttm_backend *backend); @@ -786,7 +786,7 @@ extern int ttm_bo_device_release(struct ttm_bo_device *bdev); * ttm_bo_device_init * * @bdev: A pointer to a struct ttm_bo_device to initialize. - * @mem_global: A pointer to an initialized struct ttm_mem_global. + * @glob: A pointer to an initialized struct ttm_bo_global. * @driver: A pointer to a struct ttm_bo_driver set up by the caller. * @file_page_offset: Offset into the device address space that is available * for buffer data. This ensures compatibility with other users of the diff --git a/include/drm/ttm/ttm_memory.h b/include/drm/ttm/ttm_memory.h index b199170..26c1f78 100644 --- a/include/drm/ttm/ttm_memory.h +++ b/include/drm/ttm/ttm_memory.h @@ -41,7 +41,7 @@ * @do_shrink: The callback function. * * Arguments to the do_shrink functions are intended to be passed using - * inheritance. That is, the argument class derives from struct ttm_mem_srink, + * inheritance. That is, the argument class derives from struct ttm_mem_shrink, * and can be accessed using container_of(). */ diff --git a/include/drm/ttm/ttm_object.h b/include/drm/ttm/ttm_object.h index 0d9db09..e46054e 100644 --- a/include/drm/ttm/ttm_object.h +++ b/include/drm/ttm/ttm_object.h @@ -111,7 +111,7 @@ struct ttm_object_device; * * @ref_obj_release: A function to be called when a reference object * with another ttm_ref_type than TTM_REF_USAGE is deleted. - * this function may, for example, release a lock held by a user-space + * This function may, for example, release a lock held by a user-space * process. * * This struct is intended to be used as a base struct for objects that @@ -172,7 +172,7 @@ extern struct ttm_base_object *ttm_base_object_lookup(struct ttm_object_file /** * ttm_base_object_unref * - * @p_base: Pointer to a pointer referncing a struct ttm_base_object. + * @p_base: Pointer to a pointer referencing a struct ttm_base_object. * * Decrements the base object refcount and clears the pointer pointed to by * p_base. diff --git a/include/drm/ttm/ttm_page_alloc.h b/include/drm/ttm/ttm_page_alloc.h index 8062890..129de12 100644 --- a/include/drm/ttm/ttm_page_alloc.h +++ b/include/drm/ttm/ttm_page_alloc.h @@ -32,7 +32,7 @@ /** * Get count number of pages from pool to pages list. * - * @pages: heado of empty linked list where pages are filled. + * @pages: head of empty linked list where pages are filled. * @flags: ttm flags for page allocation. * @cstate: ttm caching state for the page. * @count: number of pages to allocate. -- cgit v1.1 From 3d73710880afa3d61cf57b5d4eb192e812eb7e4f Mon Sep 17 00:00:00 2001 From: Jesse Barnes Date: Tue, 28 Jun 2011 10:59:12 -0700 Subject: cpufreq: expose a cpufreq_quick_get_max routine This allows drivers and other code to get the max reported CPU frequency. Initial use is for scaling ring frequency with GPU frequency in the i915 driver. Signed-off-by: Jesse Barnes Signed-off-by: Keith Packard --- include/linux/cpufreq.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 11be48e..6216115 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h @@ -324,11 +324,16 @@ static inline unsigned int cpufreq_get(unsigned int cpu) /* query the last known CPU freq (in kHz). If zero, cpufreq couldn't detect it */ #ifdef CONFIG_CPU_FREQ unsigned int cpufreq_quick_get(unsigned int cpu); +unsigned int cpufreq_quick_get_max(unsigned int cpu); #else static inline unsigned int cpufreq_quick_get(unsigned int cpu) { return 0; } +static inline unsigned int cpufreq_quick_get_max(unsigned int cpu) +{ + return 0; +} #endif -- cgit v1.1 From 58b6542b50ded4243c26c251c0507e5f658642f6 Mon Sep 17 00:00:00 2001 From: Jon Mason Date: Mon, 27 Jun 2011 16:07:50 +0000 Subject: DRM: remove drm_pci_device_is_pcie drm_pci_device_is_pcie duplicates the funcationality of pci_is_pcie. Convert callers of the former to the latter. This has the side benefit of removing an unnecessary search in the PCI configuration space due to using a saved PCIe capability offset. [airlied: update for new callsite] Signed-off-by: Jon Mason Signed-off-by: Dave Airlie --- include/drm/drmP.h | 7 ------- 1 file changed, 7 deletions(-) (limited to 'include') diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 4912cb7..d9c8c6c 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -1674,13 +1674,6 @@ static __inline__ int drm_pci_device_is_agp(struct drm_device *dev) return pci_find_capability(dev->pdev, PCI_CAP_ID_AGP); } - -static __inline__ int drm_pci_device_is_pcie(struct drm_device *dev) -{ - return pci_find_capability(dev->pdev, PCI_CAP_ID_EXP); -} - - extern int drm_pci_init(struct drm_driver *driver, struct pci_driver *pdriver); extern void drm_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver); extern int drm_get_pci_dev(struct pci_dev *pdev, -- cgit v1.1 From f5a3d0c4086d1854cbda545092c462b84cba20ce Mon Sep 17 00:00:00 2001 From: Matthew Garrett Date: Tue, 12 Jul 2011 18:30:52 -0400 Subject: i915: Fix opregion notifications opregion-based platforms will send ACPI video event 0x80 for a range of notification types for legacy compatibility. This is interpreted as a display switch event, which may not be appropriate in the circumstances. When we receive such an event we should make sure that the platform is genuinely requesting a display switch before passing that event through to userspace. Signed-off-by: Matthew Garrett Tested-by: Adam Jackson Signed-off-by: Keith Packard --- include/acpi/video.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/acpi/video.h b/include/acpi/video.h index 0e98e67..61109f2 100644 --- a/include/acpi/video.h +++ b/include/acpi/video.h @@ -5,6 +5,8 @@ struct acpi_device; +#define ACPI_VIDEO_CLASS "video" + #define ACPI_VIDEO_DISPLAY_CRT 1 #define ACPI_VIDEO_DISPLAY_TV 2 #define ACPI_VIDEO_DISPLAY_DVI 3 -- cgit v1.1 From e55b9422e186d208f162f056ee28b6eb6b9b81a9 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Fri, 15 Jul 2011 19:53:52 +0000 Subject: drm/radeon/kms: add info query for backend map The 3D driver need to get the pipe to backend map to certain things. Add a query to get the info. Signed-off-by: Alex Deucher Signed-off-by: Dave Airlie --- include/drm/radeon_drm.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/drm/radeon_drm.h b/include/drm/radeon_drm.h index 787f7b6..b65be60 100644 --- a/include/drm/radeon_drm.h +++ b/include/drm/radeon_drm.h @@ -911,6 +911,7 @@ struct drm_radeon_cs { #define RADEON_INFO_NUM_BACKENDS 0x0a /* DB/backends for r600+ - need for OQ */ #define RADEON_INFO_NUM_TILE_PIPES 0x0b /* tile pipes for r600+ */ #define RADEON_INFO_FUSION_GART_WORKING 0x0c /* fusion writes to GTT were broken before this */ +#define RADEON_INFO_BACKEND_MAP 0x0d /* pipe to backend map, needed by mesa */ struct drm_radeon_info { uint32_t request; -- cgit v1.1 From 62cb70118c4efabb3c0a6f962168ddcad4344eef Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Tue, 7 Jun 2011 14:17:51 +0100 Subject: drm/gem: add support for private objects These small changes should allow GEM to be used with non shmem objects as well as shmem objects. In the GMA500 case it allows the base framebuffer to appear as a GEM object and thus acquire a handle and work with KMS. For i915 it ought to be trivial to get back the wasted memory but putting the system fb back into stolen RAM and in general I can imagine it allowing the use of GEM and thus KMS with all the older cards that have their framebuffer firmly placed in video RAM. Signed-off-by: Alan Cox Tested-by: Rob Clark Signed-off-by: Dave Airlie --- include/drm/drmP.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/drm/drmP.h b/include/drm/drmP.h index d9c8c6c..9b7c2bb 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -1541,6 +1541,8 @@ 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); +int drm_gem_private_object_init(struct drm_device *dev, + struct drm_gem_object *obj, size_t size); void drm_gem_object_handle_free(struct drm_gem_object *obj); void drm_gem_vm_open(struct vm_area_struct *vma); void drm_gem_vm_close(struct vm_area_struct *vma); -- cgit v1.1