From 280d415957c0af099c44aaecb69a06c68c86aebb Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 11 Aug 2008 10:47:00 +1000 Subject: drm: add OS_HAS_GEM option. To build i915 driver pass OS_HAS_GEM=1 to make for now --- linux-core/Makefile | 6 ++++++ linux-core/drm_compat.h | 8 ++++++++ linux-core/drm_drv.c | 2 ++ linux-core/drm_gem.c | 26 +++++++++++++++++++++++++- 4 files changed, 41 insertions(+), 1 deletion(-) (limited to 'linux-core') diff --git a/linux-core/Makefile b/linux-core/Makefile index 55dfb77c..4edec312 100644 --- a/linux-core/Makefile +++ b/linux-core/Makefile @@ -270,6 +270,10 @@ ifneq ($(PAGE_AGP),0) EXTRA_CFLAGS += -DHAVE_PAGE_AGP endif +ifeq ($(OS_HAS_GEM), 1) +EXTRA_CFLAGS += -DOS_HAS_GEM=1 +endif + # Start with all modules turned off. CONFIG_DRM_GAMMA := n CONFIG_DRM_TDFX := n @@ -332,8 +336,10 @@ ifneq (,$(findstring i810,$(DRM_MODULES))) CONFIG_DRM_I810 := m endif ifneq (,$(findstring i915,$(DRM_MODULES))) +ifeq ($(OS_HAS_GEM), 1) CONFIG_DRM_I915 := m endif +endif GIT_REVISION := $(shell cd "$(DRMSRCDIR)" && git-describe --abbrev=17) ifneq ($(GIT_REVISION),) diff --git a/linux-core/drm_compat.h b/linux-core/drm_compat.h index 7ddc2c97..c7f72e33 100644 --- a/linux-core/drm_compat.h +++ b/linux-core/drm_compat.h @@ -369,4 +369,12 @@ extern struct page *drm_vm_sg_nopage(struct vm_area_struct *vma, #define drm_core_ioremap_wc drm_core_ioremap #endif +#ifndef OS_HAS_GEM +#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,27)) +#define OS_HAS_GEM 1 +#else +#define OS_HAS_GEM 0 +#endif +#endif + #endif diff --git a/linux-core/drm_drv.c b/linux-core/drm_drv.c index efd6416f..31a98fe8 100644 --- a/linux-core/drm_drv.c +++ b/linux-core/drm_drv.c @@ -151,9 +151,11 @@ static struct drm_ioctl_desc drm_ioctls[] = { DRM_IOCTL_DEF(DRM_IOCTL_MM_INFO, drm_mm_info_ioctl, 0), +#if OS_HAS_GEM DRM_IOCTL_DEF(DRM_IOCTL_GEM_CLOSE, drm_gem_close_ioctl, 0), DRM_IOCTL_DEF(DRM_IOCTL_GEM_FLINK, drm_gem_flink_ioctl, DRM_AUTH), DRM_IOCTL_DEF(DRM_IOCTL_GEM_OPEN, drm_gem_open_ioctl, DRM_AUTH), +#endif }; #define DRM_CORE_IOCTL_COUNT ARRAY_SIZE( drm_ioctls ) diff --git a/linux-core/drm_gem.c b/linux-core/drm_gem.c index 434155b3..ce930265 100644 --- a/linux-core/drm_gem.c +++ b/linux-core/drm_gem.c @@ -25,6 +25,12 @@ * */ +#include + +#include "drmP.h" + +#if OS_HAS_GEM + #include #include #include @@ -34,7 +40,6 @@ #include #include #include -#include "drmP.h" /** @file drm_gem.c * @@ -418,3 +423,22 @@ drm_gem_object_handle_free(struct kref *kref) } EXPORT_SYMBOL(drm_gem_object_handle_free); +#else + +int drm_gem_init(struct drm_device *dev) +{ + return 0; +} + +void drm_gem_open(struct drm_device *dev, struct drm_file *file_private) +{ + +} + +void +drm_gem_release(struct drm_device *dev, struct drm_file *file_private) +{ + +} + +#endif -- cgit v1.2.3