aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/gma500/framebuffer.c2
-rw-r--r--drivers/gpu/drm/gma500/gem.c9
-rw-r--r--drivers/gpu/drm/gma500/gem.h21
-rw-r--r--drivers/gpu/drm/gma500/gtt.c4
-rw-r--r--drivers/gpu/drm/gma500/gtt.h3
-rw-r--r--drivers/gpu/drm/gma500/psb_intel_display.c3
6 files changed, 33 insertions, 9 deletions
diff --git a/drivers/gpu/drm/gma500/framebuffer.c b/drivers/gpu/drm/gma500/framebuffer.c
index 94b3fec22c28..e7fcc148f333 100644
--- a/drivers/gpu/drm/gma500/framebuffer.c
+++ b/drivers/gpu/drm/gma500/framebuffer.c
@@ -319,7 +319,7 @@ static struct gtt_range *psbfb_alloc(struct drm_device *dev, int aligned_size)
319{ 319{
320 struct gtt_range *backing; 320 struct gtt_range *backing;
321 /* Begin by trying to use stolen memory backing */ 321 /* Begin by trying to use stolen memory backing */
322 backing = psb_gtt_alloc_range(dev, aligned_size, "fb", 1); 322 backing = psb_gtt_alloc_range(dev, aligned_size, "fb", 1, PAGE_SIZE);
323 if (backing) { 323 if (backing) {
324 drm_gem_private_object_init(dev, &backing->gem, aligned_size); 324 drm_gem_private_object_init(dev, &backing->gem, aligned_size);
325 return backing; 325 return backing;
diff --git a/drivers/gpu/drm/gma500/gem.c b/drivers/gpu/drm/gma500/gem.c
index 1e33a71e4167..d0243c088272 100644
--- a/drivers/gpu/drm/gma500/gem.c
+++ b/drivers/gpu/drm/gma500/gem.c
@@ -98,8 +98,8 @@ unlock:
98 * it so that userspace can speak about it. This does the core work 98 * it so that userspace can speak about it. This does the core work
99 * for the various methods that do/will create GEM objects for things 99 * for the various methods that do/will create GEM objects for things
100 */ 100 */
101static int psb_gem_create(struct drm_file *file, 101int psb_gem_create(struct drm_file *file, struct drm_device *dev, u64 size,
102 struct drm_device *dev, uint64_t size, uint32_t *handlep) 102 u32 *handlep, int stolen, u32 align)
103{ 103{
104 struct gtt_range *r; 104 struct gtt_range *r;
105 int ret; 105 int ret;
@@ -109,7 +109,7 @@ static int psb_gem_create(struct drm_file *file,
109 109
110 /* Allocate our object - for now a direct gtt range which is not 110 /* Allocate our object - for now a direct gtt range which is not
111 stolen memory backed */ 111 stolen memory backed */
112 r = psb_gtt_alloc_range(dev, size, "gem", 0); 112 r = psb_gtt_alloc_range(dev, size, "gem", 0, PAGE_SIZE);
113 if (r == NULL) { 113 if (r == NULL) {
114 dev_err(dev->dev, "no memory for %lld byte GEM object\n", size); 114 dev_err(dev->dev, "no memory for %lld byte GEM object\n", size);
115 return -ENOSPC; 115 return -ENOSPC;
@@ -153,7 +153,8 @@ int psb_gem_dumb_create(struct drm_file *file, struct drm_device *dev,
153{ 153{
154 args->pitch = ALIGN(args->width * ((args->bpp + 7) / 8), 64); 154 args->pitch = ALIGN(args->width * ((args->bpp + 7) / 8), 64);
155 args->size = args->pitch * args->height; 155 args->size = args->pitch * args->height;
156 return psb_gem_create(file, dev, args->size, &args->handle); 156 return psb_gem_create(file, dev, args->size, &args->handle, 0,
157 PAGE_SIZE);
157} 158}
158 159
159/** 160/**
diff --git a/drivers/gpu/drm/gma500/gem.h b/drivers/gpu/drm/gma500/gem.h
new file mode 100644
index 000000000000..1381c5190f46
--- /dev/null
+++ b/drivers/gpu/drm/gma500/gem.h
@@ -0,0 +1,21 @@
1/**************************************************************************
2 * Copyright (c) 2014 Patrik Jakobsson
3 * All Rights Reserved.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 **************************************************************************/
15
16#ifndef _GEM_H
17#define _GEM_H
18
19extern int psb_gem_create(struct drm_file *file, struct drm_device *dev,
20 u64 size, u32 *handlep, int stolen, u32 align);
21#endif
diff --git a/drivers/gpu/drm/gma500/gtt.c b/drivers/gpu/drm/gma500/gtt.c
index a30f6ee1f407..592d205a0089 100644
--- a/drivers/gpu/drm/gma500/gtt.c
+++ b/drivers/gpu/drm/gma500/gtt.c
@@ -330,7 +330,7 @@ out:
330 * as in use. 330 * as in use.
331 */ 331 */
332struct gtt_range *psb_gtt_alloc_range(struct drm_device *dev, int len, 332struct gtt_range *psb_gtt_alloc_range(struct drm_device *dev, int len,
333 const char *name, int backed) 333 const char *name, int backed, u32 align)
334{ 334{
335 struct drm_psb_private *dev_priv = dev->dev_private; 335 struct drm_psb_private *dev_priv = dev->dev_private;
336 struct gtt_range *gt; 336 struct gtt_range *gt;
@@ -358,7 +358,7 @@ struct gtt_range *psb_gtt_alloc_range(struct drm_device *dev, int len,
358 /* Ensure this is set for non GEM objects */ 358 /* Ensure this is set for non GEM objects */
359 gt->gem.dev = dev; 359 gt->gem.dev = dev;
360 ret = allocate_resource(dev_priv->gtt_mem, &gt->resource, 360 ret = allocate_resource(dev_priv->gtt_mem, &gt->resource,
361 len, start, end, PAGE_SIZE, NULL, NULL); 361 len, start, end, align, NULL, NULL);
362 if (ret == 0) { 362 if (ret == 0) {
363 gt->offset = gt->resource.start - r->start; 363 gt->offset = gt->resource.start - r->start;
364 return gt; 364 return gt;
diff --git a/drivers/gpu/drm/gma500/gtt.h b/drivers/gpu/drm/gma500/gtt.h
index 6191d10acf33..f5860a739bd8 100644
--- a/drivers/gpu/drm/gma500/gtt.h
+++ b/drivers/gpu/drm/gma500/gtt.h
@@ -53,7 +53,8 @@ struct gtt_range {
53}; 53};
54 54
55extern struct gtt_range *psb_gtt_alloc_range(struct drm_device *dev, int len, 55extern struct gtt_range *psb_gtt_alloc_range(struct drm_device *dev, int len,
56 const char *name, int backed); 56 const char *name, int backed,
57 u32 align);
57extern void psb_gtt_kref_put(struct gtt_range *gt); 58extern void psb_gtt_kref_put(struct gtt_range *gt);
58extern void psb_gtt_free_range(struct drm_device *dev, struct gtt_range *gt); 59extern void psb_gtt_free_range(struct drm_device *dev, struct gtt_range *gt);
59extern int psb_gtt_pin(struct gtt_range *gt); 60extern int psb_gtt_pin(struct gtt_range *gt);
diff --git a/drivers/gpu/drm/gma500/psb_intel_display.c b/drivers/gpu/drm/gma500/psb_intel_display.c
index f65bcc4f7bff..21aed85eb96e 100644
--- a/drivers/gpu/drm/gma500/psb_intel_display.c
+++ b/drivers/gpu/drm/gma500/psb_intel_display.c
@@ -469,7 +469,8 @@ static void psb_intel_cursor_init(struct drm_device *dev,
469 /* Allocate 4 pages of stolen mem for a hardware cursor. That 469 /* Allocate 4 pages of stolen mem for a hardware cursor. That
470 * is enough for the 64 x 64 ARGB cursors we support. 470 * is enough for the 64 x 64 ARGB cursors we support.
471 */ 471 */
472 cursor_gt = psb_gtt_alloc_range(dev, 4 * PAGE_SIZE, "cursor", 1); 472 cursor_gt = psb_gtt_alloc_range(dev, 4 * PAGE_SIZE, "cursor", 1,
473 PAGE_SIZE);
473 if (!cursor_gt) { 474 if (!cursor_gt) {
474 gma_crtc->cursor_gt = NULL; 475 gma_crtc->cursor_gt = NULL;
475 goto out; 476 goto out;