aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/Kconfig9
-rw-r--r--drivers/gpu/drm/Makefile1
-rwxr-xr-xdrivers/gpu/drm/emgd/Makefile40
-rw-r--r--drivers/gpu/drm/emgd/emgd/drm/emgd_crtc.c6
-rw-r--r--drivers/gpu/drm/emgd/emgd/drm/emgd_drv.c31
-rw-r--r--drivers/gpu/drm/emgd/emgd/drm/emgd_fb.c12
-rw-r--r--drivers/gpu/drm/emgd/emgd/drm/emgd_fbcon.c17
-rw-r--r--drivers/gpu/drm/emgd/emgd/pal/lvds/lvds.c1
-rw-r--r--drivers/gpu/drm/emgd/emgd/video/msvdx/msvdx_init.c7
-rw-r--r--drivers/gpu/drm/emgd/pvr/services4/srvkm/env/linux/event.c2
-rw-r--r--drivers/gpu/drm/emgd/pvr/services4/srvkm/env/linux/osfunc.c2
-rw-r--r--drivers/gpu/drm/emgd/pvr/services4/srvkm/env/linux/proc.h3
-rw-r--r--drivers/gpu/drm/emgd/pvr/services4/srvkm/env/linux/pvr_drm.c21
-rw-r--r--drivers/gpu/drm/gma500/psb_intel_drv.h2
14 files changed, 75 insertions, 79 deletions
diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index e354bc0b052a..8453304c6973 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -179,6 +179,15 @@ config DRM_SAVAGE
Choose this option if you have a Savage3D/4/SuperSavage/Pro/Twister
chipset. If M is selected the module will be called savage.
+config DRM_EGD
+ tristate "Intel EMGD"
+ depends on DRM
+ select DRM_KMS_HELPER
+ help
+ Choose this option if you have an EMGD-supported chipset
+ (Intel E6xx or System Controller Hub US15W/US15WP/WPT).
+ If M is selected the module will be called emgd.
+
source "drivers/gpu/drm/exynos/Kconfig"
source "drivers/gpu/drm/vmwgfx/Kconfig"
diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile
index c20da5bda355..b15becd4ab2e 100644
--- a/drivers/gpu/drm/Makefile
+++ b/drivers/gpu/drm/Makefile
@@ -42,4 +42,5 @@ obj-$(CONFIG_DRM_NOUVEAU) +=nouveau/
obj-$(CONFIG_DRM_EXYNOS) +=exynos/
obj-$(CONFIG_DRM_GMA500) += gma500/
obj-$(CONFIG_DRM_UDL) += udl/
+obj-$(CONFIG_DRM_EGD) +=emgd/
obj-y += i2c/
diff --git a/drivers/gpu/drm/emgd/Makefile b/drivers/gpu/drm/emgd/Makefile
index c4bd102b427b..a254d3c0752a 100755
--- a/drivers/gpu/drm/emgd/Makefile
+++ b/drivers/gpu/drm/emgd/Makefile
@@ -24,10 +24,6 @@
#----------------------------------------------------------------------------
export EGD_TOPLEVEL = DRM Driver
-KERNELVER ?= $(shell uname -r)
-KERNELDIR ?= /lib/modules/$(KERNELVER)/build
-INSTALLDIR ?= /lib/modules/$(KERNELVER)/kernel/drivers/gpu/drm/emgd
-
BLUE = \033[34m
OFF = \033[0m
BUILD ?= release
@@ -35,7 +31,7 @@ CONFIG_PVR_RELEASE ?= $(BUILD)
CONFIG_DRM_EGD ?= m
# Get the include paths pointed to the right place.
-export EMGD_MOD_DIR ?= $(CURDIR)
+export EMGD_MOD_DIR ?= $(obj)
BUILDDATE ?= $(shell date +%Y%m%d)
@@ -51,6 +47,7 @@ PROJECT_INCLUDES = \
-I$(EMGD_MOD_DIR)/emgd/pal/ch7036 \
-I$(EMGD_MOD_DIR)/emgd/drm \
-I$(KERNELDIR)/include/drm \
+ -Iinclude/drm \
-I/usr/src/linux-headers-2.6.32-5-common/include/drm \
-I$(EMGD_MOD_DIR)/pvr/include4 \
-I$(EMGD_MOD_DIR)/pvr/services4/include \
@@ -121,6 +118,8 @@ ifeq ($(PDUMP),1)
EXTRA_CFLAGS += -DPDUMP=1
endif
+ccflags-y += $(EXTRA_CFLAGS)
+
EMGD_OBJS := \
emgd/drm/emgd_fb.o \
emgd/drm/emgd_fbcon.o \
@@ -299,34 +298,3 @@ ifeq ($(PDUMP),1)
endif
obj-$(CONFIG_DRM_EGD) += emgd.o
-
-all:: clean modules
-
-modules::
- @echo $(CURDIR) -- $(CONFIG_PVR_RELEASE)
- @echo "$(MAKE) -C $(KERNELDIR) M=$(CURDIR) modules"
- @$(MAKE) -C $(KERNELDIR) M=$(CURDIR) modules
-
-clean::
- @rm -f $(emgd-y)
- @rm -f emgd.o emgd.mod.* emgd.ko Module.* modules.order
- @find . -name "*.cmd" -exec rm '{}' \;
-
-install::
- install -o root -g root -m 755 -d $(INSTALLDIR)
- install -o root -g root -m 744 emgd.ko $(INSTALLDIR)
- /sbin/depmod -a
-
-uninstall::
- rmmod $(INSTALLDIR)/emgd.ko
- rm -rf $(INSTALLDIR)/emgd.ko
- /sbin/depmod -a
-
-debug::
- export CONFIG_PVR_RELEASE=debug; $(MAKE) modules
-
-package:: clean
- @echo -e "$(BLUE)Packaging $(EGD_TOPLEVEL)$(OFF)";
- mkdir -p $(EGD_PKG)
- tar -C $(EMGD_MOD_DIR) --exclude "CVS" -czf $(EGD_PKG)/emgd_drm.tgz *
-
diff --git a/drivers/gpu/drm/emgd/emgd/drm/emgd_crtc.c b/drivers/gpu/drm/emgd/emgd/drm/emgd_crtc.c
index 76e02356c1f8..12633d9c8b66 100644
--- a/drivers/gpu/drm/emgd/emgd/drm/emgd_crtc.c
+++ b/drivers/gpu/drm/emgd/emgd/drm/emgd_crtc.c
@@ -343,11 +343,11 @@ static int emgd_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y,
plane_fb_info->width = fb->width;
plane_fb_info->height = fb->height;
- plane_fb_info->screen_pitch = fb->pitch;
+ plane_fb_info->screen_pitch = fb->pitches[0];
plane_fb_info->flags = 0;
plane_fb_info->allocated = 1;
plane_fb_info->fb_base_offset = emgd_fb->gtt_offset;
- plane_fb_info->visible_offset = (y * fb->pitch) +
+ plane_fb_info->visible_offset = (y * fb->pitches[0]) +
(x * (fb->bits_per_pixel / 8));
@@ -828,7 +828,7 @@ void emgd_flip_worker(struct work_struct *w)
/* Rendering complete; program the plane registers */
igd_surface.flags = IGD_SURFACE_DISPLAY;
igd_surface.offset = crtc->newfb->gtt_offset;
- igd_surface.pitch = crtc->newfb->base.pitch;
+ igd_surface.pitch = crtc->newfb->base.pitches[0];
igd_surface.width = crtc->newfb->base.width;
igd_surface.height = crtc->newfb->base.height;
igd_surface.pixel_format = IGD_PF_ARGB32;
diff --git a/drivers/gpu/drm/emgd/emgd/drm/emgd_drv.c b/drivers/gpu/drm/emgd/emgd/drm/emgd_drv.c
index 92f70a7cf315..4bf32d86c43b 100644
--- a/drivers/gpu/drm/emgd/emgd/drm/emgd_drv.c
+++ b/drivers/gpu/drm/emgd/emgd/drm/emgd_drv.c
@@ -38,6 +38,8 @@
#include <drm/drm_crtc_helper.h>
#include <linux/version.h>
#include <linux/device.h>
+#include <linux/export.h>
+#include <linux/module.h>
#include <drm/drm_pciids.h>
#include <intelpci.h>
#include "drm_emgd_private.h"
@@ -163,6 +165,20 @@ MODULE_PARM_DESC(debug_bc_ts, "Debug: Texture Stream");
module_param_named(debug_bc_ts, emgd_debug_flag.hal.buf_class, short, 0600);
#endif
+static const struct file_operations emgd_driver_fops = {
+ .owner = THIS_MODULE,
+ .open = drm_open,
+ .release = drm_release,
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)
+ .unlocked_ioctl = drm_ioctl,
+#else
+ .ioctl = drm_ioctl,
+#endif
+ .mmap = emgd_mmap,
+ .poll = drm_poll,
+ .fasync = drm_fasync,
+ .read = drm_read,
+};
static struct drm_driver driver; /* TODO: what? */
@@ -2377,20 +2393,7 @@ static struct drm_driver driver = {
.get_reg_ofs = drm_core_get_reg_ofs,
#endif
.ioctls = emgd_ioctl,
- .fops = {
- .owner = THIS_MODULE,
- .open = drm_open,
- .release = drm_release,
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,32)
- .unlocked_ioctl = drm_ioctl,
-#else
- .ioctl = drm_ioctl,
-#endif
- .mmap = emgd_mmap,
- .poll = drm_poll,
- .fasync = drm_fasync,
- .read = drm_read,
- },
+ .fops = &emgd_driver_fops,
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,38)
.pci_driver = EMGD_PCI_DRIVER,
#endif
diff --git a/drivers/gpu/drm/emgd/emgd/drm/emgd_fb.c b/drivers/gpu/drm/emgd/emgd/drm/emgd_fb.c
index 6e00b2705739..d75fe814b43b 100644
--- a/drivers/gpu/drm/emgd/emgd/drm/emgd_fb.c
+++ b/drivers/gpu/drm/emgd/emgd/drm/emgd_fb.c
@@ -110,12 +110,12 @@ static void emgd_fbdev_destroy(drm_emgd_priv_t *priv);
*/
int emgd_framebuffer_init(struct drm_device *dev,
emgd_framebuffer_t *emgd_fb,
- struct drm_mode_fb_cmd *mode_cmd,
+ struct drm_mode_fb_cmd2 *mode_cmd,
unsigned long offset);
static struct drm_framebuffer *emgd_user_framebuffer_create(
struct drm_device *dev,
struct drm_file *filp,
- struct drm_mode_fb_cmd *r);
+ struct drm_mode_fb_cmd2 *r);
RETURN_PROBE_TYPE emgd_fb_probe(struct drm_device *dev);
static int emgd_fb_panic(struct notifier_block *n,
unsigned long res,
@@ -815,7 +815,7 @@ EXPORT_SYMBOL(emgd_fb_probe);
static struct drm_framebuffer *emgd_user_framebuffer_create(
struct drm_device *dev,
struct drm_file *filp,
- struct drm_mode_fb_cmd *mode_cmd)
+ struct drm_mode_fb_cmd2 *mode_cmd)
{
emgd_framebuffer_t *emgd_fb;
int ret;
@@ -830,7 +830,7 @@ static struct drm_framebuffer *emgd_user_framebuffer_create(
/* Create a framebuffer instance */
ret = emgd_framebuffer_init(dev, emgd_fb, mode_cmd,
- (unsigned long)mode_cmd->handle);
+ (unsigned long)mode_cmd->handles[0]);
if (ret) {
EMGD_ERROR("Failed to create framebuffer instance.");
/* TODO: Free the allocation at mode_cmd->handle */
@@ -869,7 +869,7 @@ static struct drm_framebuffer *emgd_user_framebuffer_create(
*/
int emgd_framebuffer_init(struct drm_device *dev,
emgd_framebuffer_t *emgd_fb,
- struct drm_mode_fb_cmd *mode_cmd,
+ struct drm_mode_fb_cmd2 *mode_cmd,
unsigned long handle)
{
drm_emgd_priv_t *dev_priv = NULL;
@@ -1165,7 +1165,7 @@ static int emgd_fb_create(emgd_fbdev_t *emgd_fbdev,
drm_emgd_priv_t *priv = emgd_fbdev->priv;
struct drm_device *dev = priv->ddev;
struct fb_info *info = NULL;
- struct drm_mode_fb_cmd mode_cmd;
+ struct drm_mode_fb_cmd2 mode_cmd;
struct drm_framebuffer *fb = NULL;
igd_context_t *context = NULL;
int ret;
diff --git a/drivers/gpu/drm/emgd/emgd/drm/emgd_fbcon.c b/drivers/gpu/drm/emgd/emgd/drm/emgd_fbcon.c
index 5132d334215e..9a075e3fa120 100644
--- a/drivers/gpu/drm/emgd/emgd/drm/emgd_fbcon.c
+++ b/drivers/gpu/drm/emgd/emgd/drm/emgd_fbcon.c
@@ -36,6 +36,7 @@
#include <drmP.h>
#include <drm_crtc_helper.h>
#include <linux/vga_switcheroo.h>
+#include <linux/export.h>
#include "user_config.h"
@@ -57,7 +58,7 @@ extern emgd_drm_config_t config_drm;
*/
extern int emgd_framebuffer_init(struct drm_device *dev,
emgd_framebuffer_t *emgd_fb,
- struct drm_mode_fb_cmd *mode_cmd,
+ struct drm_mode_fb_cmd2 *mode_cmd,
unsigned long handle);
@@ -124,7 +125,7 @@ static void fill_fix(emgd_fbdev_t *emgd_fbdev, struct fb_info *info)
info->fix.ywrapstep = 0;
info->fix.accel = FB_ACCEL_NONE;
info->fix.type_aux = 0;
- info->fix.line_length = fb->pitch;
+ info->fix.line_length = fb->pitches[0];
}
@@ -246,7 +247,7 @@ static int alloc_initial_fb(emgd_fbdev_t *emgd_fbdev)
igd_context_t *context;
int ret;
unsigned long size;
- struct drm_mode_fb_cmd mode_cmd;
+ struct drm_mode_fb_cmd2 mode_cmd;
EMGD_TRACE_ENTER;
@@ -291,12 +292,14 @@ static int alloc_initial_fb(emgd_fbdev_t *emgd_fbdev)
/* Initialize emgd_framebuffer_t */
- mode_cmd.handle = EMGD_INITIAL_FRAMEBUFFER;
- mode_cmd.pitch = priv->initfb_info.screen_pitch;
+ mode_cmd.handles[0] = EMGD_INITIAL_FRAMEBUFFER;
+ mode_cmd.pitches[0] = priv->initfb_info.screen_pitch;
mode_cmd.width = priv->initfb_info.width;
mode_cmd.height = priv->initfb_info.height;
- mode_cmd.bpp = IGD_PF_BPP(priv->initfb_info.pixel_format);
- mode_cmd.depth = mode_cmd.bpp; /* Ok for 32bpp, may not work for 16bpp */
+ mode_cmd.pixel_format = drm_mode_legacy_fb_format(
+ IGD_PF_BPP(priv->initfb_info.pixel_format),
+ IGD_PF_BPP(priv->initfb_info.pixel_format) /* Ok for 32bpp, may not work for 16bpp */
+ );
ret = emgd_framebuffer_init(dev, emgd_fbdev->emgd_fb, &mode_cmd,
EMGD_INITIAL_FRAMEBUFFER);
diff --git a/drivers/gpu/drm/emgd/emgd/pal/lvds/lvds.c b/drivers/gpu/drm/emgd/emgd/pal/lvds/lvds.c
index b67a992f6716..a9dc56f79a56 100644
--- a/drivers/gpu/drm/emgd/emgd/pal/lvds/lvds.c
+++ b/drivers/gpu/drm/emgd/emgd/pal/lvds/lvds.c
@@ -31,6 +31,7 @@
*-----------------------------------------------------------------------------
*/
#include <linux/kernel.h>
+#include <linux/bug.h>
#include <config.h>
#include <igd_pd.h>
diff --git a/drivers/gpu/drm/emgd/emgd/video/msvdx/msvdx_init.c b/drivers/gpu/drm/emgd/emgd/video/msvdx/msvdx_init.c
index 659122404a72..6f83bd94daba 100644
--- a/drivers/gpu/drm/emgd/emgd/video/msvdx/msvdx_init.c
+++ b/drivers/gpu/drm/emgd/emgd/video/msvdx/msvdx_init.c
@@ -58,6 +58,9 @@
#include <general.h>
#include <utils.h>
#include <msvdx.h>
+#include <linux/export.h>
+#include <linux/module.h>
+
#include <plb/regs.h>
#include <plb/context.h>
@@ -916,7 +919,7 @@ int msvdx_init_plb(unsigned long base0, unsigned long base1,
REGIO_WRITE_FIELD(reg_val, MSVDX_CORE_CR_FE_MSVDX_WDT_CONTROL, FE_WDT_ACTION0, 1);
REGIO_WRITE_FIELD(reg_val, MSVDX_CORE_CR_FE_MSVDX_WDT_CONTROL, FE_WDT_CLEAR_SELECT, 1);
REGIO_WRITE_FIELD(reg_val, MSVDX_CORE_CR_FE_MSVDX_WDT_CONTROL, FE_WDT_CLKDIV_SELECT, 7);
- printk(KERN_INFO "CTL_MSG: WDT Control value = 0x%x", reg_val);
+ printk(KERN_INFO "CTL_MSG: WDT Control value = 0x%lx", reg_val);
EMGD_WRITE32(0, mmio + MSVDX_CORE_CR_FE_MSVDX_WDT_COMPAREMATCH_OFFSET);
EMGD_WRITE32(reg_val, mmio + MSVDX_CORE_CR_FE_MSVDX_WDT_CONTROL_OFFSET);
@@ -926,7 +929,7 @@ int msvdx_init_plb(unsigned long base0, unsigned long base1,
REGIO_WRITE_FIELD(reg_val, MSVDX_CORE_CR_BE_MSVDX_WDT_CONTROL, BE_WDT_ACTION0, 1);
REGIO_WRITE_FIELD(reg_val, MSVDX_CORE_CR_BE_MSVDX_WDT_CONTROL, BE_WDT_CLEAR_SELECT, 0xd);
REGIO_WRITE_FIELD(reg_val, MSVDX_CORE_CR_BE_MSVDX_WDT_CONTROL, BE_WDT_CLKDIV_SELECT, 7);
- printk(KERN_INFO "CTL_MSG: WDT Control value = 0x%x", reg_val);
+ printk(KERN_INFO "CTL_MSG: WDT Control value = 0x%lx", reg_val);
EMGD_WRITE32(0, mmio + MSVDX_CORE_CR_BE_MSVDX_WDT_COMPAREMATCH_OFFSET);
EMGD_WRITE32(reg_val, mmio + MSVDX_CORE_CR_BE_MSVDX_WDT_CONTROL_OFFSET);
diff --git a/drivers/gpu/drm/emgd/pvr/services4/srvkm/env/linux/event.c b/drivers/gpu/drm/emgd/pvr/services4/srvkm/env/linux/event.c
index 85493c14693c..b3e01a3c581f 100644
--- a/drivers/gpu/drm/emgd/pvr/services4/srvkm/env/linux/event.c
+++ b/drivers/gpu/drm/emgd/pvr/services4/srvkm/env/linux/event.c
@@ -24,8 +24,10 @@
#include <asm/io.h>
#include <asm/page.h>
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22))
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0)
#include <asm/system.h>
#endif
+#endif
#include <linux/mm.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
diff --git a/drivers/gpu/drm/emgd/pvr/services4/srvkm/env/linux/osfunc.c b/drivers/gpu/drm/emgd/pvr/services4/srvkm/env/linux/osfunc.c
index 60b8a69133ab..dca185c8fc12 100644
--- a/drivers/gpu/drm/emgd/pvr/services4/srvkm/env/linux/osfunc.c
+++ b/drivers/gpu/drm/emgd/pvr/services4/srvkm/env/linux/osfunc.c
@@ -24,8 +24,10 @@
#include <asm/io.h>
#include <asm/page.h>
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,22))
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,4,0))
#include <asm/system.h>
#endif
+#endif
#if defined(SUPPORT_CPU_CACHED_BUFFERS)
#include <asm/cacheflush.h>
#endif
diff --git a/drivers/gpu/drm/emgd/pvr/services4/srvkm/env/linux/proc.h b/drivers/gpu/drm/emgd/pvr/services4/srvkm/env/linux/proc.h
index 7aa5424a5735..07db3d701123 100644
--- a/drivers/gpu/drm/emgd/pvr/services4/srvkm/env/linux/proc.h
+++ b/drivers/gpu/drm/emgd/pvr/services4/srvkm/env/linux/proc.h
@@ -23,7 +23,10 @@
#ifndef __SERVICES_PROC_H__
#define __SERVICES_PROC_H__
+#include <linux/version.h>
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0)
#include <asm/system.h>
+#endif
#include <linux/proc_fs.h>
#include <linux/seq_file.h>
diff --git a/drivers/gpu/drm/emgd/pvr/services4/srvkm/env/linux/pvr_drm.c b/drivers/gpu/drm/emgd/pvr/services4/srvkm/env/linux/pvr_drm.c
index f31f989c6665..be619afe1354 100644
--- a/drivers/gpu/drm/emgd/pvr/services4/srvkm/env/linux/pvr_drm.c
+++ b/drivers/gpu/drm/emgd/pvr/services4/srvkm/env/linux/pvr_drm.c
@@ -238,6 +238,16 @@ struct drm_ioctl_desc sPVRDrmIoctls[] = {
static IMG_INT pvr_max_ioctl = DRM_ARRAY_SIZE(sPVRDrmIoctls);
+static const struct file_operations pvr_driver_fops = {
+ .owner = THIS_MODULE,
+ .open = drm_open,
+ .release = drm_release,
+ .ioctl = drm_ioctl,
+ .mmap = PVRMMap,
+ .poll = drm_poll,
+ .fasync = drm_fasync,
+};
+
static struct drm_driver sPVRDrmDriver =
{
.driver_features = 0,
@@ -251,16 +261,7 @@ static struct drm_driver sPVRDrmDriver =
.get_map_ofs = drm_core_get_map_ofs,
.get_reg_ofs = drm_core_get_reg_ofs,
.ioctls = sPVRDrmIoctls,
- .fops =
- {
- .owner = THIS_MODULE,
- .open = drm_open,
- .release = drm_release,
- .ioctl = drm_ioctl,
- .mmap = PVRMMap,
- .poll = drm_poll,
- .fasync = drm_fasync,
- },
+ .fops = &pvr_driver_fops,
.pci_driver =
{
.name = PVR_DRM_NAME,
diff --git a/drivers/gpu/drm/gma500/psb_intel_drv.h b/drivers/gpu/drm/gma500/psb_intel_drv.h
index f40535e56689..303806db156f 100644
--- a/drivers/gpu/drm/gma500/psb_intel_drv.h
+++ b/drivers/gpu/drm/gma500/psb_intel_drv.h
@@ -265,7 +265,7 @@ extern int intelfb_remove(struct drm_device *dev,
struct drm_framebuffer *fb);
extern struct drm_framebuffer *psb_intel_framebuffer_create(struct drm_device
*dev, struct
- drm_mode_fb_cmd
+ drm_mode_fb_cmd2
*mode_cmd,
void *mm_private);
extern bool psb_intel_lvds_mode_fixup(struct drm_encoder *encoder,