Commit Graph

90 Commits (a95dfc1e1ce6d50129252d70078813a31ff7cc56)

Author SHA1 Message Date
Alan Cox a95dfc1e1c gma500: move configuration bits into the psb_ops structure
We can stuff things like the number of pipes and the SGX offset away in
here as well and clean up more conditional code.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 08:20:41 -07:00
Alan Cox 89e5d55717 gma500: remove an un-needed check
This is a Medfield only path

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 08:20:41 -07:00
Alan Cox 80f51c32c4 gma500: add more ops
Split the 2d properties, name, and various function vectors out so that we
can get rid of more conditional gloop in favour of a per device structure.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 08:20:41 -07:00
Alan Cox 71138b7f07 gma500: enable Medfield CRTC support
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 08:20:41 -07:00
Alan Cox 060351f174 gma500: Read the GCT panel type information for Medfield
Missed in the original merge work

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 08:20:41 -07:00
Alan Cox cc976ced8e gma500: Fix early Medfield crash
We need to initialise the DBI interface and the code for it got missed in
the original merge as it's in a daft place. This will need moving but lets
get it added first.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 08:20:41 -07:00
Alan Cox 6a7afe3acc gma500: continue abstracting platform specific code
Next obvious target - backlight support

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 08:20:40 -07:00
Alan Cox 92367fe1bc gma500: being abstracting out devices a bit more
We really want to move towards a completely abstracted interface rather
than having tons of per chip junk in the same files.

Begin with the power code which is probably the worst offender. Add a set
of methods, initialise a dev_priv->ops pointer and rip the chip specifics
out of the power code. While we are it pick up the display init bits.

So we know it's now chip specifics clean remove the psb_ naming from it.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 08:20:40 -07:00
Alan Cox bcc70a64a4 gma500: Only fiddle with clock gating on PSB
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 08:20:40 -07:00
Alan Cox 5338afdfb5 gma500: Update the GEM todo
We also pull out the undo side of the mmap offset processing so we can later
push it into GEM where it belongs

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 08:20:40 -07:00
Alan Cox 078d6f7167 gma500: psb_fb tidy/cleanup pass
Eliminate unused stuff and clean up the code ordering.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 08:20:40 -07:00
Alan Cox 2f8a78fbff gma500: Extract BIOSisy stuff from psb_drv
This is too big already so lets rip out more of the device specific crud. It
also means we pull the ugly stuff that needs work out of our main line of
cleanup.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 08:20:39 -07:00
Alan Cox eee9b52e5e gma500: Move our other GEM helper into the bits want to push into GEM
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 08:20:39 -07:00
Alan Cox a897854c30 gma500: Medfield support
This large patch adds all the basics for Medfield support. Lots of clean up
needed in this area still.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 08:20:39 -07:00
Alan Cox 6669b1d686 gma500: 2D polish
Tidy up the 2D bits. For the fill case the CPU seems to be able to
outperform the graphics engine for the cases we get, so don't bother
fixing it but throw it out.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 08:20:39 -07:00
Alan Cox e2e88603c8 gma500: CodingStyle pass
Start the style cleanup

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 08:20:39 -07:00
Alan Cox 2cf10d23df gma500: Use the GEM tweaks to provide a GEM frame buffer
We can now make our system frame buffer a GEM object.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 08:20:39 -07:00
Alan Cox 635816e1b8 gma500: GEM glue
Add this temporarily so we can keep making progress and also bundle all the
GEM bits we need together in our staging driver while we get them into GEM
itself.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 08:20:38 -07:00
Alan Cox f0017b1049 gma500: Kill spare kref
We are using the underlying kref in the GEM object so we don't need our own

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 08:20:38 -07:00
Alan Cox 99d8f0349b gma500: nuke the PSB debug stuff
Lose all the PSB debug gunge. We can replace it with dev_dbg() like normal
drivers if and when we need debug on stuff.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 08:20:38 -07:00
Alan Cox 0496cf5aee gma500: nuke the last bits of TTM code
We don't seem to need this for our task.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 08:20:38 -07:00
Alan Cox 4e1d2fae79 gma500: 2D acceleration tidying
We have a FIXME to do the power management for which the framework now
exists, and we also need to deal with an erratum. Some operations exactly 8
pixels wide or high fail. The work around is to do two smaller ones (see
the Intel released X driver bits) but for console quite frankly if it's
8bits wide and/or high its not worth it so fall back.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 08:20:38 -07:00
Alan Cox de64ac92c4 gma500: polish for completion of this phase
Give the driver its own proper DRM name, clean up copyright headers and so
forth

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 08:20:37 -07:00
Alan Cox 5b7aa16007 gma500: trim some of the debug
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 08:20:37 -07:00
Alan Cox 3cc76c1c69 gma500: Do sane FB cleanup
If we get a user frame buffer destroyed which is being displayed then clean
up the mess nicely. We can now run a slightly modified modetest including setting
modes, and handling crashes.

Modetest still blows up but this is because libdrm 2.4.25 is busted.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 08:20:37 -07:00
Alan Cox daab23f1f5 gma500: revamp frame buffer creation and handling
Restructure this to work the same way as the i915 frame buffer does. That
cleans up various chunks of code.

We can now set a mode in modetest but mode restore is a bit iffy

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 08:20:37 -07:00
Alan Cox 9460e84a91 gma500: Ensure the frame buffer has a linear virtual mapping
We need this for the framebuffer in order to ensure that the kernel
framebuffer layer can handle it when using KMS. Except for the base
framebuffer this isn't a concern.

Add an npage field to the gtt as too many copies of the page calculation
are getting spread around the code.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 08:20:37 -07:00
Andre Bartke 3a5deac623 gma500: Fix uninitialized variable and style issues
The return variable of psb_gtt_pin() may be used
uninitialized. Also fixed some coding style issues.

Signed-off-by: Andre Bartke <andre.bartke@gmail.com>
[Reapplied by hand due to other changes]
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28 14:19:42 -07:00
Alan Cox ef41e3f4a5 gma500: Set the correct bits according to the pipe
Squash a hardcoded assumption we shouldn't really make

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28 14:17:12 -07:00
Alan Cox fb7ff7f66e gma500: Make GTT pages uncached
Clean up the GTT code a bit, make the pages uncached and go via the proper
interfaces. This avoids any aliasing problems.

On the CPU side we need to access the pages via their true addresses not via
the GTT. This is fine for GEM created fb objects for X. For the kernel fb
when not in stolen RAM we are going to need to use vm_map_ram() and hope we
have enough virtual address space to steal.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28 14:17:04 -07:00
Alan Cox 7b847f6ded gma500: fix warnings
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28 14:16:29 -07:00
Michael Chang aaa5c67791 staging: gma500: get control from firmware framebuffer if conflicts
Many Linux distributions would enable vesafb in order to display
early stage boot splash. In this case, we will get garbled X
Window screen if running X fbdev on psbfb.

This is because fb0 is occupied by vesafb while psbfb is on fb1.
They tried to drive the same pieces of hardware at the same
time. With unmodified X start-up, it would try to use default
fb0 framebuffer device and unfortunately it is now broken
becaues fb1 supersedes it.

We should let psbfb takeover framebuffer control from vesafb
to get around this problem.

See also commit : 4410f39109

Signed-off-by: Michael Chang <mchang@novell.com>
Cc: Alan Cox <alan@linux.intel.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 12:28:42 -07:00
Patrik Jakobsson 3ab8be5315 staging: gma500: Skip bogus LVDS VBT mode and check for LVDS before adding backlight
On the Fit-PC2 the VBT reports an invalid fixed panel mode for LVDS, this gets
in the way for SDVO. This patch makes VBT parsing skip the invalid mode. When
there is no LVDS output the backlight support crashes so the patch also checks
for this before enabling it.

Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-07 12:28:41 -07:00
Alan Cox 7ed2911c8f gma500: finish off the fault handler
GEM wants to mmap the object through the GTT (which avoids aliasing) so we
need to put the object into the GTT before we provide the fault mapping for
it.

While we are at it update the pin interface so that it digs dev out of the
GEM object itself. This provides a rather cleaner API and call environment.
Fix th refcount/on-off confusion in the pin API.

At this point we get a bit further with modetest but if we write to the
new GEM mapping we hang solid and as yet I don't know why.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-17 11:37:57 -07:00
Alan Cox 4f0c8f43ee gma500: Don't try and take a GEM handle of a non GEM fb
The initial GMA500 framebuffer is not GEM but stolen memory. We can't
therefore take a GEM handle of it. Stop anyone trying to do this and causing
a crash.

Ideally we need a way to have GEM handles to non GEM objects but it's not
clear how and if GEM and the modesetting/fb interfaces it provides are
supposed to or indeed if they can handle it.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-17 11:37:56 -07:00
Alan Cox 0c4ac072b3 gma500: enable GEM mmap
Support mapping of GEM objects. This ought to be a small plumbing change but
instead we have to cut and paste a pile of stuff into the driver. This
really wants to be handled *IN* GEM

You can now allocate, mmap and munmap GEM objects in the driver. You can't
yet map them into the GART or display them however.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-11 14:01:45 -07:00
Alan Cox f92e88343e gma500: Fix dumb create crash
The error path from gtt_alloc returns NULL not a ptr error. The underlying
fail is caused by a bug in the size calculation. With these two fixed it
passes kmstest, although it's not really doing anything useful yet.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-10 11:16:46 -07:00
Alan Cox ea1ce3762b gma500: sort out the file operations
Route everything via the proper DRM layer calls. This fixes the crash in
plymouth and is also necessary to begin supporting libkms.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-10 11:16:45 -07:00
Alan Cox b644c7ce18 gma500: The MID devices have the register offset different
This is another small step towards getting Moorestown/Oaktrail support to
work but for Moorestown at least we still need to sort out GEM backed base
framebuffer, which means figuring out why GEM explodes early on at the
moment.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-05-06 09:27:35 -07:00
Alan Cox 9886eb59f8 gma500: allow non stolen page backed framebuffer
For Moorestown at least we may not have stolen RAM with which to back the
initial framebuffer. Allow a GEM backing.

At this point we should have all the bits in place needed to make it work once
it has been debugged.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-25 17:13:49 -07:00
Alan Cox 541c81ab4b gma500: prune some unused variables
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-25 17:13:49 -07:00
Alan Cox e1684a048b gma500: GEM - now we have the basics we shall stick pins in it
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-25 17:13:49 -07:00
Alan Cox ed7ea13efb gma500: GEMify the frame buffer base bits
This then kills off the old bo_ interfaces

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-25 17:13:49 -07:00
Alan Cox 0dfac1ceb4 gma500: Begin the GEMification of the cursor code
Do a first pass over the cursor code and rework it to use GEM objects for
the cursor buffer as we need.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-25 17:13:48 -07:00
Alan Cox 6a62730c7a gma500: Add support for inserting and removing pages from the GART
There are two chunks of code we need to do this. The first one is the code
to insert and remove the pages from the GART, the second is the code to build
page table lists from the GEM object. Surprisingly this latter one doesn't seem
to have a nice GEM helper.

While we are at it we can begin dismantling the semi redundant struct pg,
and finish pruning out the old now unused gtt code as well as the last bits
of helper glue from the old driver base.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-25 17:13:48 -07:00
Alan Cox f20ee24445 gma500: begin adding GEM
This puts in place the infrastructure for GEM allocators. Our implementation
is fairly simplistic at this point and we don't deal with things like
evicting objects from the GART to make space, nor compaction.

We extent our gtt_range struct to include a GEM object and that allows GEM
to do all the handle management and most of the memory mapping work for us.

This patch also doesn't load GEM pages into the GART so the GEM side isn't
very useful. Before we can do that a fair bit of work is needed reworking the
internal GTT code.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-25 17:13:48 -07:00
Alan Cox f11dd9b14f gma500: add the ability to request backed space or not
We will will need this for doing a GEM allocator. It should also avoid any
crashes with the current code if the stolen area is too small.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-25 17:13:47 -07:00
Alan Cox cb0ff05aa1 gma500: Tidy up the allocations
Now we can do allocations we need to shuffle the fb resource into the fb so
we can one day have multiple frame buffer objects.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-25 17:12:58 -07:00
Alan Cox 8d9c134c6e gma500: Add a gtt allocator
At the moment we don't do any page backing for the GTT so only the stolen
area pages will actually work. That is fine for our initial framebuffer and
a bit of testing but will need resolution (including alternate mmap methods
and the like for s/g areas) eventually.

Rather than use some of the overcomplex stuff in the DRM we use the existing
Linux resource allocators to hand out framebuffers and the like. This also has
the nice result that /proc/iomem shows the allocations.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-25 17:12:58 -07:00
Alan Cox 36207d1167 gma500: backlight warning
The current bl code checks for backlight types and warns if they are not
properly set. Set ours to avoid the warning spew

(This one alone is probably 2.6.39 candidate)

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-25 17:12:57 -07:00