Commit Graph

74 Commits (2cf10d23dff547d6018673a30e86490a768b3280)

Author SHA1 Message Date
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
Alan Cox 4df25c69c9 gma500: prepare to do some actual memory management
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
Alan Cox a563a8c251 gma500: ioctl first pass
Go through the remaining ioctls and check they make sense

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-25 17:12:56 -07:00
Greg Kroah-Hartman 32235b07b5 Staging: merge 2.6.39-rc3 into staging-next
This was done to handle a number of conflicts, the majority of which
were caused by the big "fix spelling issues" patch.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-13 12:14:05 -07:00
Alan Cox 8a789f8c30 staging: gma500: Add oaktrail
Oaktrail needs a couple of slight plumbing tweaks

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-05 11:41:13 -07:00
Alan Cox cb048d5586 staging: gma500: enable the 2D op stuff
Well one of them anyway - not yet sure why the other fails

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-05 11:41:12 -07:00
Alan Cox 636fa5c78c staging: gma500: psb_reset actually holds lid functions
So rename the file something sensible

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-05 11:36:35 -07:00
Alan Cox 9c6ac29cb0 staging: gma500: Set the TWOD base
2D accel still doesn't work but now it doesn't crash either

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-05 11:36:34 -07:00
Alan Cox 3350dead09 staging: gma500: cleanup the SDVO messages
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-05 11:36:32 -07:00
Alan Cox c3460fd3ec staging: gma500: begin tidying up the power management
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-05 11:36:30 -07:00
Alan Cox a3461ee16c staging: gma500: prune more unused fields
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-05 11:36:27 -07:00
Alan Cox 9917294623 staging: gma500: Add a test ioctl for issuing 2D accel ops via user space
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-05 11:36:25 -07:00
Alan Cox ad9f792e67 staging: gma500: Fix some set up bugs found by comparing driver versions
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-05 11:36:23 -07:00
Alan Cox 0c6b262753 staging: gma500: kill some more #if 0 bits
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-05 11:36:22 -07:00
Alan Cox b0e2326ca7 staging: gma500: Another file we don't need
Zap... bang

And take out a few more variables that are now dead

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-05 11:36:20 -07:00
Alan Cox c34433b19d staging: gma500: turn on psb SDVO
Keep this as its own commit for bisection purposes

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-05 11:27:50 -07:00
Justin P. Mattock 8fc5945f8f staging: gma500: Remove extra semi-colon.
The patch below removes an extra semi-colon from various parts
of the kernel. Please have a look when you have time, and let
me know if its legit or not.

Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-05 11:27:49 -07:00