summaryrefslogtreecommitdiffstats
path: root/staging/emgd-pvr-get-it-building-with-v3.4-kernel.patch
blob: 07b799472fa6f10f2fc801f476f796a890f7d43d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
From 86643bdd8cbad616a161ab91f51108cf0da827bc Mon Sep 17 00:00:00 2001
From: Nitin A Kamble <nitin.a.kamble@intel.com>
Date: Mon, 16 Jul 2012 07:14:50 -0700
Subject: [PATCH 2/2] emgd/pvr: get it building with v3.4 kernel

Add emgd config option (DRM_EGD) and modify Makefiles for in-tree
builds.

rebased to v3.4 code

Fix build errors caused by changes to kernel interfaces introduced by
linux 3.2 such as:

error: 'THIS_MODULE' undeclared here (not in a function)

due to a missing THIS_MODULE definition which can be found in linux/export.h.

It also fixes a ream of errors like:

error: expected ')' before string constant

due to missing MODULE_PARM_DESC definition which can be found in
linux/moduleparam.h, included by linux/module.h, needed also for
MODULE_AUTHOR, etc.

variable name "pitch" from drm_framebuffer structure has changed
to "pitches" array in v3.4 kernel soruces.

avoid errors like these:
emgd_fbcon.c:128:28: error: 'struct drm_framebuffer' has no member named 'pitch'

Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
---
 drivers/gpu/drm/Kconfig                            |    9 ++++
 drivers/gpu/drm/Makefile                           |    1 +
 drivers/gpu/drm/emgd/Makefile                      |   40 ++------------------
 drivers/gpu/drm/emgd/emgd/drm/emgd_crtc.c          |    6 +-
 drivers/gpu/drm/emgd/emgd/drm/emgd_drv.c           |   31 ++++++++-------
 drivers/gpu/drm/emgd/emgd/drm/emgd_fb.c            |   12 +++---
 drivers/gpu/drm/emgd/emgd/drm/emgd_fbcon.c         |   17 +++++---
 drivers/gpu/drm/emgd/emgd/pal/lvds/lvds.c          |    1 +
 drivers/gpu/drm/emgd/emgd/video/msvdx/msvdx_init.c |    7 ++-
 .../drm/emgd/pvr/services4/srvkm/env/linux/event.c |    2 +
 .../emgd/pvr/services4/srvkm/env/linux/osfunc.c    |    2 +
 .../drm/emgd/pvr/services4/srvkm/env/linux/proc.h  |    3 +
 .../emgd/pvr/services4/srvkm/env/linux/pvr_drm.c   |   21 +++++-----
 drivers/gpu/drm/gma500/psb_intel_drv.h             |    2 +-
 14 files changed, 75 insertions(+), 79 deletions(-)

diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index e354bc0..8453304 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 c20da5b..b15becd 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 c4bd102..a254d3c 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 76e0235..12633d9 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 92f70a7..4bf32d8 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 6e00b27..d75fe81 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 5132d33..9a075e3 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 b67a992..a9dc56f 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 6591224..6f83bd9 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 85493c1..b3e01a3 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 60b8a69..dca185c 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 7aa5424..07db3d7 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 f31f989..be619af 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 f40535e..303806d 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,
-- 
1.7.5.4