Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Alan Cox and committed by
Dave Airlie
a746092b 700e59f6

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