diff options
-rw-r--r-- | drivers/staging/gma500/psb_2d.c | 1 | ||||
-rw-r--r-- | drivers/staging/gma500/psb_gtt.c | 8 |
2 files changed, 5 insertions, 4 deletions
diff --git a/drivers/staging/gma500/psb_2d.c b/drivers/staging/gma500/psb_2d.c index 3aee8fc3734..0bd834c982d 100644 --- a/drivers/staging/gma500/psb_2d.c +++ b/drivers/staging/gma500/psb_2d.c | |||
@@ -38,6 +38,7 @@ | |||
38 | 38 | ||
39 | #include "psb_drv.h" | 39 | #include "psb_drv.h" |
40 | #include "psb_reg.h" | 40 | #include "psb_reg.h" |
41 | #include "psb_drv.h" | ||
41 | #include "psb_fb.h" | 42 | #include "psb_fb.h" |
42 | 43 | ||
43 | void psb_spank(struct drm_psb_private *dev_priv) | 44 | void psb_spank(struct drm_psb_private *dev_priv) |
diff --git a/drivers/staging/gma500/psb_gtt.c b/drivers/staging/gma500/psb_gtt.c index 280f9d44546..74c5a6569d0 100644 --- a/drivers/staging/gma500/psb_gtt.c +++ b/drivers/staging/gma500/psb_gtt.c | |||
@@ -80,7 +80,7 @@ static int psb_gtt_insert(struct drm_device *dev, struct gtt_range *r) | |||
80 | { | 80 | { |
81 | struct drm_psb_private *dev_priv = dev->dev_private; | 81 | struct drm_psb_private *dev_priv = dev->dev_private; |
82 | u32 *gtt_slot, pte; | 82 | u32 *gtt_slot, pte; |
83 | int numpages = resource_size(&r->resource) >> PAGE_SHIFT; | 83 | int numpages = (r->resource.end + 1 - r->resource.start) >> PAGE_SHIFT; |
84 | struct page **pages; | 84 | struct page **pages; |
85 | int i; | 85 | int i; |
86 | 86 | ||
@@ -121,7 +121,7 @@ static void psb_gtt_remove(struct drm_device *dev, struct gtt_range *r) | |||
121 | { | 121 | { |
122 | struct drm_psb_private *dev_priv = dev->dev_private; | 122 | struct drm_psb_private *dev_priv = dev->dev_private; |
123 | u32 *gtt_slot, pte; | 123 | u32 *gtt_slot, pte; |
124 | int numpages = resource_size(&r->resource) >> PAGE_SHIFT; | 124 | int numpages = (r->resource.end + 1 - r->resource.start) >> PAGE_SHIFT; |
125 | int i; | 125 | int i; |
126 | 126 | ||
127 | WARN_ON(r->stolen); | 127 | WARN_ON(r->stolen); |
@@ -149,7 +149,7 @@ static int psb_gtt_attach_pages(struct gtt_range *gt) | |||
149 | struct address_space *mapping; | 149 | struct address_space *mapping; |
150 | int i; | 150 | int i; |
151 | struct page *p; | 151 | struct page *p; |
152 | int pages = resource_size(>->resource) >> PAGE_SHIFT; | 152 | int pages = (gt->resource.end + 1 - gt->resource.start) >> PAGE_SHIFT; |
153 | 153 | ||
154 | WARN_ON(gt->pages); | 154 | WARN_ON(gt->pages); |
155 | 155 | ||
@@ -191,7 +191,7 @@ err: | |||
191 | static void psb_gtt_detach_pages(struct gtt_range *gt) | 191 | static void psb_gtt_detach_pages(struct gtt_range *gt) |
192 | { | 192 | { |
193 | int i; | 193 | int i; |
194 | int pages = resource_size(>->resource) >> PAGE_SHIFT; | 194 | int pages = (gt->resource.end + 1 - gt->resource.start) >> PAGE_SHIFT; |
195 | 195 | ||
196 | for (i = 0; i < pages; i++) { | 196 | for (i = 0; i < pages; i++) { |
197 | /* FIXME: do we need to force dirty */ | 197 | /* FIXME: do we need to force dirty */ |