Commit Graph

263931 Commits

Author SHA1 Message Date
Jakob Bornecrantz c337ada7e7 vmwgfx: Be more strict with fb depths when using screen objects
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-05 10:17:33 +01:00
Thomas Hellstrom 5bb39e8181 vmwgfx: Handle device surface memory limit
Make surfaces swappable. Make sure we honor the maximum amount of surface
memory the device accepts. This is done by potentially reading back surface
contents not used by the current command submission and storing it
locally in buffer objects.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-05 10:17:31 +01:00
Thomas Hellstrom 90ff18bc3a vmwgfx: Make sure we always have a user-space handle to use for objects that are backing kms framebuffers.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-05 10:17:26 +01:00
Thomas Hellstrom f18c8840be vmwgfx: Optimize the command submission resource list
Use a list for resources referenced during command submission, instead of
an array.
As long as we don't implement parallell command submission this works fine
and simplifies things a bit.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-05 10:17:23 +01:00
Thomas Hellstrom e2fa3a7683 vmwgfx: Fix up query processing
Previously, query results could be placed in any buffer object, but since
we didn't allow pinned buffer objects, query results could be written when
that buffer was evicted, corrupting data in other buffers.

Now, require that buffers holding query results are no more than two pages
large, and allow one single pinned such buffer. When the command submission
code encounters query result structures in other buffers, the queries in the
pinned buffer will be finished using a query barrier for the last hardware
context using the buffer. Also if the command submission code detects
that a new hardware context is used for queries, all queries of the previous
hardware context is also flushed. Currently we use waiting for a no-op
occlusion query as a query barrier for a specific context.

The query buffer is also flushed and unpinned on context destructions,
master drops and before scanout bo placement.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-05 10:17:22 +01:00
Thomas Hellstrom e93daed8e2 vmwgfx: Allow reference and unreference of NULL fence objects.
The execbuf utils may call reference on NULL fence objects.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-05 10:17:21 +01:00
Thomas Hellstrom b37a6b9ad0 vmwgfx: minor dmabuf utilities cleanup
Add / fix some function comments.
Don't move out an fbdev framebuffer when unused. Just unpin.
Only have a single function that computes a SVGAGuestPtr from the buffer's
current placement, and make it more versatile by accepting a
struct ttm_buffer_object

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-05 10:17:20 +01:00
Jakob Bornecrantz 0cff60c625 vmwgfx: Disallow user space to send present and readback commands
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-05 10:17:18 +01:00
Jakob Bornecrantz 2fcd5a73bf vmwgfx: Add present and readback ioctls
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-05 10:17:17 +01:00
Jakob Bornecrantz 44031d25cc vmwgfx: Place overlays in GMR area if we can
When we hae screen objects we are allowed to place the overlay source
in the GMR area, do this as this will save precious VRAM.

Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-05 10:17:16 +01:00
Jakob Bornecrantz 01e81419ce vmwgfx: Drop 3D Legacy Display Unit support
Since 3D requires HWv8 and screen objects is always available on those
hosts we only need the screen objects path for surfaces.

Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-05 10:17:15 +01:00
Thomas Hellstrom b7b70024d9 vmwgfx: Require HWV8 for 3d support
On lower versions, the way we mix 2D and 3D may be too slow.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-05 10:17:14 +01:00
Jakob Bornecrantz 56d1c78df5 vmwgfx: Add screen object support
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-05 10:17:14 +01:00
Jakob Bornecrantz d991ef0395 vmwgfx: Add dmabuf helper functions for pinning
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-05 10:17:13 +01:00
Jakob Bornecrantz 626ab771c2 vmwgfx: Refactor common display unit functions to shared file
More preparation for Screen Object support.

Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-05 10:17:12 +01:00
Jakob Bornecrantz 4084fb89e6 vmwgfx: Expand the command checker to cover screen object commands
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-05 10:17:12 +01:00
Jakob Bornecrantz 5deb65cf83 vmwgfx: Break out dirty submission code
In preperation for screen objects, still leaves the delayed workqueue
for surface updates in place.

Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-05 10:17:11 +01:00
Thomas Hellstrom 922ade0d16 vmwgfx: Break out execbuf command processing
This will make it easier to execute commands operating on user-space
resources but generated by the kernel.

JB: Added tracking if the sw_context was called from the kernel or userspace.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-05 10:17:11 +01:00
Jakob Bornecrantz 6070e9fa6d vmwgfx: Some comments and BUG_ON
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-05 10:17:10 +01:00
Jakob Bornecrantz 5f898d99de vmwgfx: Make sure the reserved area is at the start of vram
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-05 10:17:09 +01:00
Jakob Bornecrantz 497a3ff987 vmwgfx: Add comments for buffer pinning code
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-05 10:17:09 +01:00
Jakob Bornecrantz de12d44fca vmwgfx: Document vmw_fifo_reserve
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-05 10:17:08 +01:00
Jakob Bornecrantz 8d3713ea9e vmwgfx: Update register files to latest from vmware-sdk
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-05 10:17:08 +01:00
Thomas Hellstrom 4d79893788 ttm: export ttm_bo_create
Used by the vmwgfx driver.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-05 10:17:07 +01:00
Dave Airlie 88ef4e3f4f Merge branch 'drm-intel-next' of git://people.freedesktop.org/~keithp/linux into drm-next
* 'drm-intel-next' of git://people.freedesktop.org/~keithp/linux:
  Drivers: i915: Fix all space related issues.
2011-09-20 09:36:22 +01:00
Dave Airlie b2d108ba33 Merge branch 'drm-nouveau-next' of git://git.freedesktop.org/git/nouveau/linux-2.6 into drm-next
* 'drm-nouveau-next' of git://git.freedesktop.org/git/nouveau/linux-2.6: (353 commits)
  drm/nouveau: remove allocations from gart populate() hook
  drm/nvc0/fb: slightly improve PMFB intr handling, move out of nvc0_graph.c
  drm/nvc0/fifo: avoid touching missing subfifos
  drm/nvd9/disp: bail out of mode_set_base if no fb bound to crtc
  drm/nvd9/disp: stub some more api hooks so we don't oops on resume
  drm/nouveau: fix printk typo in ioremap failure path
  drm/nvc0/pm: minor clock readback fixes
  drm/nv40/pm: execute memory reset script from vbios
  drm/nv50/gr: refactor initialisation
  drm/nouveau: if requested, try harder at disabling sysmem pushbufs
  drm/nv50/gr: enable ctxprog xfer only when we need it to save power
  drm/nouveau/dp: add support for displayport table 0x30
  drm/nouveau/dp: return master dp table pointer too when looking up encoder
  drm/nouveau/bios: simplify U/d table hash matching func to just match
  drm/nouveau/dp: preserve non-pattern bits in DP_TRAINING_PATTERN_SET
  drm/nvc0/gr: remove MODULE_FIRMWARE() lines
  drm/nouveau/dp: use alternate lane mask for nvaf
  drm/nouveau/dp: link rate scripts are selected with a comparison table
  drm/nv40/pm: write nv40-specific reclocking routines
  drm/nv40/pm: parse geometric delta clock from vbios
  ...
2011-09-20 09:35:22 +01:00
Ben Skeggs a0d9a8feb9 drm/nouveau: remove allocations from gart populate() hook
Since some somewhat questionable changes a while back, TTM provides a
completely empty array of struct dma_address that stays around for the
entire lifetime of the TTM object.

Lets use this array, *always*, rather than wasting yet more memory on
another array who's purpose is identical, as well as yet another bool array
of the same size saying *which* of the previous two arrays to use...

This change will also solve the high order allocation failures seen by
some people while using nouveau.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:12:27 +10:00
Ben Skeggs a14845121c drm/nvc0/fb: slightly improve PMFB intr handling, move out of nvc0_graph.c
I'm still not certain how to determine the number of SUBPs are present on
a given board.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:12:21 +10:00
Ben Skeggs 3dcbb02b3a drm/nvc0/fifo: avoid touching missing subfifos
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:12:18 +10:00
Ben Skeggs 84e2ad8b7b drm/nvd9/disp: bail out of mode_set_base if no fb bound to crtc
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:12:11 +10:00
Ben Skeggs c20ab3e1cb drm/nvd9/disp: stub some more api hooks so we don't oops on resume
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:12:08 +10:00
Marcin Slusarz ff920bfbe6 drm/nouveau: fix printk typo in ioremap failure path
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:12:05 +10:00
Ben Skeggs 8ce51fcfee drm/nvc0/pm: minor clock readback fixes
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:11:55 +10:00
Ben Skeggs 59ef9742f6 drm/nv40/pm: execute memory reset script from vbios
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:11:51 +10:00
Ben Skeggs 6d6538a0c3 drm/nv50/gr: refactor initialisation
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:11:45 +10:00
Ben Skeggs 8c06e60ed4 drm/nouveau: if requested, try harder at disabling sysmem pushbufs
On >=nv50, userspace would still end up allocating pushbufs in GART.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:11:41 +10:00
Martin Peres fbba036a56 drm/nv50/gr: enable ctxprog xfer only when we need it to save power
This patch adds instructions to ctxprog and by doing, impacts context
switching performance.  My testcase showed a 1% performance cost using
glxgears that is a context-switch bound application.

Please test and report bugs/performance/power/other.

Many thanks to Maxim Levitsky for his dedicated work on lowering power
consumption with nouveau.

More patches are coming thanks to his work:

https://bugs.freedesktop.org/show_bug.cgi?id=37922

Signed-off-by: Martin Peres <martin.peres@ensi-bourges.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:11:28 +10:00
Ben Skeggs c16a3a358b drm/nouveau/dp: add support for displayport table 0x30
Written from observations of my NVD9's vbios, completely untested due to
my NVD9 lacking actual DisplayPort connectors..

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:11:21 +10:00
Ben Skeggs 5f1800bd8a drm/nouveau/dp: return master dp table pointer too when looking up encoder
Will need to be able to distinguish 2.0/2.1 from 3.0 soon.  Also, move
the vbios parsing to nouveau_dp where it belongs.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:11:18 +10:00
Ben Skeggs 721b0821ad drm/nouveau/bios: simplify U/d table hash matching func to just match
The caller is now responsible for parsing its own lists (or whatever) of
possible encoders.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:11:14 +10:00
Ben Skeggs 5b3eb95fd8 drm/nouveau/dp: preserve non-pattern bits in DP_TRAINING_PATTERN_SET
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:11:09 +10:00
Ben Skeggs 2834f86864 drm/nvc0/gr: remove MODULE_FIRMWARE() lines
We don't use these by default anymore, and there's been complaints from a
number of places thinking that the firmware blobs are required still.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:11:05 +10:00
Ben Skeggs 1b45dbe0bc drm/nouveau/dp: use alternate lane mask for nvaf
Naturally...  Because Macs can't just be the same as everything else
now can they?

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:11:00 +10:00
Ben Skeggs 856ed88875 drm/nouveau/dp: link rate scripts are selected with a comparison table
Not hardcoded as originally thought.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:10:56 +10:00
Ben Skeggs 1262a206da drm/nv40/pm: write nv40-specific reclocking routines
Not 100% perfect yet, but a good start towards what it'll look like in the
end.

Actually seems stable on a NV44 I have here, as much as running around OA
for a fair amount of time constantly switching between performance levels
can prove..

My NV49 isn't quite so happy, and semaphores mess up somehow (sometimes) as
a result of the memory reclocking.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:10:45 +10:00
Ben Skeggs 9f403603f2 drm/nv40/pm: parse geometric delta clock from vbios
This changes the meaning of what we reported as "core" clock previously.

The shader/rop units are allegedly supposed to be run at the base clock
listed in the perf table, while the geometric clock can be bumped from
this value on some boards.

So that we can report both, we'll report the base clock as "shader" (since
the shaders *do* run at it), and the geometric clock as "core".

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:10:40 +10:00
Ben Skeggs 52e0d0ecc8 drm/nouveau/dp: enable down-spread if vbios and sink support it
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:10:35 +10:00
Ben Skeggs 28e2d12405 drm/nouveau/dp: execute some more vbios tables relating to link rate
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:10:27 +10:00
Ben Skeggs 75a1fccf92 drm/nouveau/dp: store unencoded link_bw everywhere
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:10:24 +10:00
Ben Skeggs 27a4598737 drm/nouveau/dp: restructure link training code
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:10:21 +10:00