aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2011-11-29 17:21:03 -0500
committerDave Airlie <airlied@redhat.com>2011-12-06 04:55:33 -0500
commita746092b679e6045dae91ceacb9abc6c83e38e0e (patch)
treef1cc7a4da7f183dd5b2dab52ba4fabe7cb420fd9 /drivers
parent700e59f6924719c70ac63e004ccafc6f15074fb0 (diff)
gma500: do a pass over the FIXME tags
Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/gma500/cdv_device.c1
-rw-r--r--drivers/gpu/drm/gma500/gem.c5
-rw-r--r--drivers/gpu/drm/gma500/gtt.c30
-rw-r--r--drivers/gpu/drm/gma500/intel_opregion.c1
-rw-r--r--drivers/gpu/drm/gma500/oaktrail_crtc.c16
-rw-r--r--drivers/gpu/drm/gma500/psb_drv.c1
-rw-r--r--drivers/gpu/drm/gma500/psb_intel_lvds.c1
-rw-r--r--drivers/gpu/drm/gma500/psb_lid.c2
8 files changed, 26 insertions, 31 deletions
diff --git a/drivers/gpu/drm/gma500/cdv_device.c b/drivers/gpu/drm/gma500/cdv_device.c
index c0583dfc6d72..7e8028abcc99 100644
--- a/drivers/gpu/drm/gma500/cdv_device.c
+++ b/drivers/gpu/drm/gma500/cdv_device.c
@@ -30,7 +30,6 @@
30#define VGA_SR_INDEX 0x3c4 30#define VGA_SR_INDEX 0x3c4
31#define VGA_SR_DATA 0x3c5 31#define VGA_SR_DATA 0x3c5
32 32
33/* FIXME: should check if we are the active VGA device ?? */
34static void cdv_disable_vga(struct drm_device *dev) 33static void cdv_disable_vga(struct drm_device *dev)
35{ 34{
36 u8 sr1; 35 u8 sr1;
diff --git a/drivers/gpu/drm/gma500/gem.c b/drivers/gpu/drm/gma500/gem.c
index fdc8b5dee720..9fbb86868e2e 100644
--- a/drivers/gpu/drm/gma500/gem.c
+++ b/drivers/gpu/drm/gma500/gem.c
@@ -120,8 +120,7 @@ static int psb_gem_create(struct drm_file *file,
120 /* Initialize the extra goodies GEM needs to do all the hard work */ 120 /* Initialize the extra goodies GEM needs to do all the hard work */
121 if (drm_gem_object_init(dev, &r->gem, size) != 0) { 121 if (drm_gem_object_init(dev, &r->gem, size) != 0) {
122 psb_gtt_free_range(dev, r); 122 psb_gtt_free_range(dev, r);
123 /* GEM doesn't give an error code and we don't have an 123 /* GEM doesn't give an error code so use -ENOMEM */
124 EGEMSUCKS so make something up for now - FIXME */
125 dev_err(dev->dev, "GEM init failed for %lld\n", size); 124 dev_err(dev->dev, "GEM init failed for %lld\n", size);
126 return -ENOMEM; 125 return -ENOMEM;
127 } 126 }
@@ -191,8 +190,6 @@ int psb_gem_dumb_destroy(struct drm_file *file, struct drm_device *dev,
191 * The VMA was set up by GEM. In doing so it also ensured that the 190 * The VMA was set up by GEM. In doing so it also ensured that the
192 * vma->vm_private_data points to the GEM object that is backing this 191 * vma->vm_private_data points to the GEM object that is backing this
193 * mapping. 192 * mapping.
194 *
195 * FIXME
196 */ 193 */
197int psb_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf) 194int psb_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
198{ 195{
diff --git a/drivers/gpu/drm/gma500/gtt.c b/drivers/gpu/drm/gma500/gtt.c
index 461ead251bbd..a24623997e50 100644
--- a/drivers/gpu/drm/gma500/gtt.c
+++ b/drivers/gpu/drm/gma500/gtt.c
@@ -72,9 +72,8 @@ u32 *psb_gtt_entry(struct drm_device *dev, struct gtt_range *r)
72 * @r: our GTT range 72 * @r: our GTT range
73 * 73 *
74 * Take our preallocated GTT range and insert the GEM object into 74 * Take our preallocated GTT range and insert the GEM object into
75 * the GTT. 75 * the GTT. This is protected via the gtt mutex which the caller
76 * 76 * must hold.
77 * FIXME: gtt lock ?
78 */ 77 */
79static int psb_gtt_insert(struct drm_device *dev, struct gtt_range *r) 78static int psb_gtt_insert(struct drm_device *dev, struct gtt_range *r)
80{ 79{
@@ -111,7 +110,8 @@ static int psb_gtt_insert(struct drm_device *dev, struct gtt_range *r)
111 * @r: our GTT range 110 * @r: our GTT range
112 * 111 *
113 * Remove a preallocated GTT range from the GTT. Overwrite all the 112 * Remove a preallocated GTT range from the GTT. Overwrite all the
114 * page table entries with the dummy page 113 * page table entries with the dummy page. This is protected via the gtt
114 * mutex which the caller must hold.
115 */ 115 */
116 116
117static void psb_gtt_remove(struct drm_device *dev, struct gtt_range *r) 117static void psb_gtt_remove(struct drm_device *dev, struct gtt_range *r)
@@ -136,7 +136,8 @@ static void psb_gtt_remove(struct drm_device *dev, struct gtt_range *r)
136 * @gt: the gtt range 136 * @gt: the gtt range
137 * 137 *
138 * Pin and build an in kernel list of the pages that back our GEM object. 138 * Pin and build an in kernel list of the pages that back our GEM object.
139 * While we hold this the pages cannot be swapped out 139 * While we hold this the pages cannot be swapped out. This is protected
140 * via the gtt mutex which the caller must hold.
140 */ 141 */
141static int psb_gtt_attach_pages(struct gtt_range *gt) 142static int psb_gtt_attach_pages(struct gtt_range *gt)
142{ 143{
@@ -158,7 +159,7 @@ static int psb_gtt_attach_pages(struct gtt_range *gt)
158 gt->npage = pages; 159 gt->npage = pages;
159 160
160 for (i = 0; i < pages; i++) { 161 for (i = 0; i < pages; i++) {
161 /* FIXME: review flags later */ 162 /* FIXME: needs updating as per mail from Hugh Dickins */
162 p = read_cache_page_gfp(mapping, i, 163 p = read_cache_page_gfp(mapping, i,
163 __GFP_COLD | GFP_KERNEL); 164 __GFP_COLD | GFP_KERNEL);
164 if (IS_ERR(p)) 165 if (IS_ERR(p))
@@ -181,7 +182,8 @@ err:
181 * 182 *
182 * Undo the effect of psb_gtt_attach_pages. At this point the pages 183 * Undo the effect of psb_gtt_attach_pages. At this point the pages
183 * must have been removed from the GTT as they could now be paged out 184 * must have been removed from the GTT as they could now be paged out
184 * and move bus address. 185 * and move bus address. This is protected via the gtt mutex which the
186 * caller must hold.
185 */ 187 */
186static void psb_gtt_detach_pages(struct gtt_range *gt) 188static void psb_gtt_detach_pages(struct gtt_range *gt)
187{ 189{
@@ -390,15 +392,18 @@ int psb_gtt_init(struct drm_device *dev, int resume)
390 pg->gtt_phys_start = dev_priv->pge_ctl & PAGE_MASK; 392 pg->gtt_phys_start = dev_priv->pge_ctl & PAGE_MASK;
391 393
392 /* 394 /*
393 * FIXME: video mmu has hw bug to access 0x0D0000000, 395 * The video mmu has a hw bug when accessing 0x0D0000000.
394 * then make gatt start at 0x0e000,0000 396 * Make gatt start at 0x0e000,0000. This doesn't actually
397 * matter for us but may do if the video acceleration ever
398 * gets opened up.
395 */ 399 */
396 pg->mmu_gatt_start = 0xE0000000; 400 pg->mmu_gatt_start = 0xE0000000;
397 401
398 pg->gtt_start = pci_resource_start(dev->pdev, PSB_GTT_RESOURCE); 402 pg->gtt_start = pci_resource_start(dev->pdev, PSB_GTT_RESOURCE);
399 gtt_pages = pci_resource_len(dev->pdev, PSB_GTT_RESOURCE) 403 gtt_pages = pci_resource_len(dev->pdev, PSB_GTT_RESOURCE)
400 >> PAGE_SHIFT; 404 >> PAGE_SHIFT;
401 /* CDV workaround */ 405 /* Some CDV firmware doesn't report this currently. In which case the
406 system has 64 gtt pages */
402 if (pg->gtt_start == 0 || gtt_pages == 0) { 407 if (pg->gtt_start == 0 || gtt_pages == 0) {
403 dev_err(dev->dev, "GTT PCI BAR not initialized.\n"); 408 dev_err(dev->dev, "GTT PCI BAR not initialized.\n");
404 gtt_pages = 64; 409 gtt_pages = 64;
@@ -412,13 +417,16 @@ int psb_gtt_init(struct drm_device *dev, int resume)
412 417
413 if (pg->gatt_pages == 0 || pg->gatt_start == 0) { 418 if (pg->gatt_pages == 0 || pg->gatt_start == 0) {
414 static struct resource fudge; /* Preferably peppermint */ 419 static struct resource fudge; /* Preferably peppermint */
415
416 /* This can occur on CDV SDV systems. Fudge it in this case. 420 /* This can occur on CDV SDV systems. Fudge it in this case.
417 We really don't care what imaginary space is being allocated 421 We really don't care what imaginary space is being allocated
418 at this point */ 422 at this point */
419 dev_err(dev->dev, "GATT PCI BAR not initialized.\n"); 423 dev_err(dev->dev, "GATT PCI BAR not initialized.\n");
420 pg->gatt_start = 0x40000000; 424 pg->gatt_start = 0x40000000;
421 pg->gatt_pages = (128 * 1024 * 1024) >> PAGE_SHIFT; 425 pg->gatt_pages = (128 * 1024 * 1024) >> PAGE_SHIFT;
426 /* This is a little confusing but in fact the GTT is providing
427 a view from the GPU into memory and not vice versa. As such
428 this is really allocating space that is not the same as the
429 CPU address space on CDV */
422 fudge.start = 0x40000000; 430 fudge.start = 0x40000000;
423 fudge.end = 0x40000000 + 128 * 1024 * 1024 - 1; 431 fudge.end = 0x40000000 + 128 * 1024 * 1024 - 1;
424 fudge.name = "fudge"; 432 fudge.name = "fudge";
diff --git a/drivers/gpu/drm/gma500/intel_opregion.c b/drivers/gpu/drm/gma500/intel_opregion.c
index d2e60376982f..d946bc1b17bf 100644
--- a/drivers/gpu/drm/gma500/intel_opregion.c
+++ b/drivers/gpu/drm/gma500/intel_opregion.c
@@ -20,6 +20,7 @@
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE. 21 * DEALINGS IN THE SOFTWARE.
22 * 22 *
23 * FIXME: resolve with the i915 version
23 */ 24 */
24 25
25#include "psb_drv.h" 26#include "psb_drv.h"
diff --git a/drivers/gpu/drm/gma500/oaktrail_crtc.c b/drivers/gpu/drm/gma500/oaktrail_crtc.c
index 7f9c791fbe78..8e15b5af1213 100644
--- a/drivers/gpu/drm/gma500/oaktrail_crtc.c
+++ b/drivers/gpu/drm/gma500/oaktrail_crtc.c
@@ -521,12 +521,11 @@ int oaktrail_pipe_set_base(struct drm_crtc *crtc,
521 int x, int y, struct drm_framebuffer *old_fb) 521 int x, int y, struct drm_framebuffer *old_fb)
522{ 522{
523 struct drm_device *dev = crtc->dev; 523 struct drm_device *dev = crtc->dev;
524 /* struct drm_i915_master_private *master_priv; */
525 struct psb_intel_crtc *psb_intel_crtc = to_psb_intel_crtc(crtc); 524 struct psb_intel_crtc *psb_intel_crtc = to_psb_intel_crtc(crtc);
526 struct psb_framebuffer *psbfb = to_psb_fb(crtc->fb); 525 struct psb_framebuffer *psbfb = to_psb_fb(crtc->fb);
527 int pipe = psb_intel_crtc->pipe; 526 int pipe = psb_intel_crtc->pipe;
528 unsigned long start, offset; 527 unsigned long start, offset;
529 /* FIXME: check if we need this surely MRST is pipe 0 only */ 528
530 int dspbase = (pipe == 0 ? DSPALINOFF : DSPBBASE); 529 int dspbase = (pipe == 0 ? DSPALINOFF : DSPBBASE);
531 int dspsurf = (pipe == 0 ? DSPASURF : DSPBSURF); 530 int dspsurf = (pipe == 0 ? DSPASURF : DSPBSURF);
532 int dspstride = (pipe == 0) ? DSPASTRIDE : DSPBSTRIDE; 531 int dspstride = (pipe == 0) ? DSPASTRIDE : DSPBSTRIDE;
@@ -572,15 +571,10 @@ int oaktrail_pipe_set_base(struct drm_crtc *crtc,
572 } 571 }
573 REG_WRITE(dspcntr_reg, dspcntr); 572 REG_WRITE(dspcntr_reg, dspcntr);
574 573
575 if (0 /* FIXMEAC - check what PSB needs */) { 574 REG_WRITE(dspbase, offset);
576 REG_WRITE(dspbase, offset); 575 REG_READ(dspbase);
577 REG_READ(dspbase); 576 REG_WRITE(dspsurf, start);
578 REG_WRITE(dspsurf, start); 577 REG_READ(dspsurf);
579 REG_READ(dspsurf);
580 } else {
581 REG_WRITE(dspbase, start + offset);
582 REG_READ(dspbase);
583 }
584 578
585pipe_set_base_exit: 579pipe_set_base_exit:
586 gma_power_end(dev); 580 gma_power_end(dev);
diff --git a/drivers/gpu/drm/gma500/psb_drv.c b/drivers/gpu/drm/gma500/psb_drv.c
index f6d5f3ce755d..862bb8182b76 100644
--- a/drivers/gpu/drm/gma500/psb_drv.c
+++ b/drivers/gpu/drm/gma500/psb_drv.c
@@ -141,7 +141,6 @@ static void psb_lastclose(struct drm_device *dev)
141 141
142static void psb_do_takedown(struct drm_device *dev) 142static void psb_do_takedown(struct drm_device *dev)
143{ 143{
144 /* FIXME: do we need to clean up the gtt here ? */
145} 144}
146 145
147static int psb_do_init(struct drm_device *dev) 146static int psb_do_init(struct drm_device *dev)
diff --git a/drivers/gpu/drm/gma500/psb_intel_lvds.c b/drivers/gpu/drm/gma500/psb_intel_lvds.c
index c6436da60732..8b951e3afd49 100644
--- a/drivers/gpu/drm/gma500/psb_intel_lvds.c
+++ b/drivers/gpu/drm/gma500/psb_intel_lvds.c
@@ -382,7 +382,6 @@ bool psb_intel_lvds_mode_fixup(struct drm_encoder *encoder,
382 if (psb_intel_output->type == INTEL_OUTPUT_MIPI2) 382 if (psb_intel_output->type == INTEL_OUTPUT_MIPI2)
383 panel_fixed_mode = mode_dev->panel_fixed_mode2; 383 panel_fixed_mode = mode_dev->panel_fixed_mode2;
384 384
385 /* FIXME: review for Medfield */
386 /* PSB requires the LVDS is on pipe B, MRST has only one pipe anyway */ 385 /* PSB requires the LVDS is on pipe B, MRST has only one pipe anyway */
387 if (!IS_MRST(dev) && psb_intel_crtc->pipe == 0) { 386 if (!IS_MRST(dev) && psb_intel_crtc->pipe == 0) {
388 printk(KERN_ERR "Can't support LVDS on pipe A\n"); 387 printk(KERN_ERR "Can't support LVDS on pipe A\n");
diff --git a/drivers/gpu/drm/gma500/psb_lid.c b/drivers/gpu/drm/gma500/psb_lid.c
index af328516561e..b867aabe6bf3 100644
--- a/drivers/gpu/drm/gma500/psb_lid.c
+++ b/drivers/gpu/drm/gma500/psb_lid.c
@@ -52,8 +52,6 @@ static void psb_lid_timer_func(unsigned long data)
52 pp_status = REG_READ(PP_STATUS); 52 pp_status = REG_READ(PP_STATUS);
53 } while ((pp_status & PP_ON) == 0); 53 } while ((pp_status & PP_ON) == 0);
54 } 54 }
55 /* printk(KERN_INFO"%s: lid: closed\n", __FUNCTION__); */
56
57 dev_priv->lid_last_state = readl(lid_state); 55 dev_priv->lid_last_state = readl(lid_state);
58 56
59lid_timer_schedule: 57lid_timer_schedule: