1
0
Fork 0
Commit Graph

5481 Commits (125c4033f0187d7264f08d7cf1474252df4f4c17)

Author SHA1 Message Date
Jesse Barnes d6c892df7e drm/i915: set watermarks for third pipe on IVB
The watermark reg for the third pipe is in an unusual offset; add
support for it and set watermarks for 3 pipe configs.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Tested-By: Eugeni Dodonov <eugeni.dodonov@intel.com>
Reviewed-By: Eugeni Dodonov <eugeni.dodonov@intel.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-20 23:21:56 -07:00
Jesse Barnes d4270e57ef drm/i915: export a CPT mode set verification function
At the point where we check, we can't do much about the failure, but it
can aid debugging.  Note that the auto-train override bit will be reset
as part of normal mode setting with this patch if a pipe ever does get
stuck, but that's consistent with the workaround for CPT provided by the
hardware team.  This patch helped catch the fact that the pipe wasn't
running in the !composite sync FDI case on my IVB SDV, so has already
shown to be useful.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Tested-By: Eugeni Dodonov <eugeni.dodonov@intel.com>
Reviewed-By: Eugeni Dodonov <eugeni.dodonov@intel.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-20 23:21:56 -07:00
Jesse Barnes d64311ab4b drm/i915: fix transcoder PLL select masking
Transcoder A will always use PLL A and transcoder B will use PLL B.  But
transcoder C could use either, so always mask the select bits off before
or'ing in a new value.

Reported-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Tested-By: Eugeni Dodonov <eugeni.dodonov@intel.com>
Reviewed-By: Eugeni Dodonov <eugeni.dodonov@intel.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-20 23:21:55 -07:00
Jesse Barnes 65a21cd653 drm/i915: fix IVB cursor support
The cursor regs have moved around, add the offsets and new macros for
getting at them.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Tested-By: Eugeni Dodonov <eugeni.dodonov@intel.com>
Reviewed-By: Eugeni Dodonov <eugeni.dodonov@intel.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-20 23:21:54 -07:00
Jesse Barnes f7cb34d47d drm/i915: fix debug output for 3 pipe configs
We can have more than just A and B these days.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Tested-By: Eugeni Dodonov <eugeni.dodonov@intel.com>
Reviewed-By: Eugeni Dodonov <eugeni.dodonov@intel.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-20 23:21:54 -07:00
Jesse Barnes 4b645f1402 drm/i915: add PLL sharing support to handle 3 pipes
Add two new fields to the intel_crtc struct for 3 pipe support: no_pll
and use_pll_a.  The no_pll field is only set on the 3rd pipe to indicate
that it doesn't have a PLL of its own and so shouldn't try to write the
main PLL regs.  The use_pll_a field controls which PLL pipe 3 will
share, A or B.  The core code will try to share PLLs with whichever pipe
has the same timings, rejecting the mode set if none is found.  This
means that pipe 3 must always be set after one of the other pipes has
been configured with real PLL settings.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Tested-By: Eugeni Dodonov <eugeni.dodonov@intel.com>
Reviewed-By: Eugeni Dodonov <eugeni.dodonov@intel.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-20 23:13:23 -07:00
Jesse Barnes d3ccbe8670 drm/i915: fix PCH PLL assertion check for 3 pipes
Add a couple of checks now that we're using the 3rd transcoder:
  1) make sure the transcoder PLL enable bit is set for the transcoder
     in question
  2) when checking actual PLL enable, use the selected PLL number rather
     than the transcoder number (they could be different now)

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Tested-By: Eugeni Dodonov <eugeni.dodonov@intel.com>
Reviewed-By: Eugeni Dodonov <eugeni.dodonov@intel.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-20 15:26:43 -07:00
Jesse Barnes 75770564c9 drm/i915: use transcoder select bits on VGA and HDMI on CPT
Required for 3 pipe functionality.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Tested-By: Eugeni Dodonov <eugeni.dodonov@intel.com>
Reviewed-By: Eugeni Dodonov <eugeni.dodonov@intel.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-20 15:26:43 -07:00
Jesse Barnes d9d444cbc5 drm/i915: split refclk code out of ironlake_crtc_mode_set
Just a cleanup to make the mode_set function more manageable.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Tested-By: Eugeni Dodonov <eugeni.dodonov@intel.com>
Reviewed-By: Eugeni Dodonov <eugeni.dodonov@intel.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-20 15:26:43 -07:00
Jesse Barnes 27f8227b1e drm/i915: support 3 pipes on IVB+
Well almost anyway.  IVB has 3 planes, pipes, transcoders, and FDI
interfaces, but only 2 pipe PLLs.  So two of the pipes must use the same
pipe timings (e.g. 2 DP plus one other, or two HDMI with the same mode
and one other, etc.).

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Tested-By: Eugeni Dodonov <eugeni.dodonov@intel.com>
Reviewed-By: Eugeni Dodonov <eugeni.dodonov@intel.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-20 15:26:42 -07:00
Jesse Barnes 4c609cb890 drm/i915: PLL macro cleanup and pipe assertion check
Add a macro for accessing the two pipe PLLs and add a check to make sure
we don't access a non-existent one in the enable/disable functions.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Tested-By: Eugeni Dodonov <eugeni.dodonov@intel.com>
Reviewed-By: Eugeni Dodonov <eugeni.dodonov@intel.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-20 15:26:42 -07:00
Jesse Barnes c4f9c4c2b3 drm/i915: always set FDI composite sync bit
It's needed for 3 pipe support as well as just regular functionality
(e.g. DisplayPort).

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Tested-by: Adam Jackson <ajax@redhat.com>
Tested-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-20 15:26:41 -07:00
Jesse Barnes 8d31528703 drm/i915: Use PIPE_CONTROL for flushing on gen6+.
v2 by danvet: Use a new flag to flush the render target cache on gen6+
(hw reuses the old write flush bit), as suggested by Ben Widawsdy.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
[danvet: this seems to fix cairo-perf-trace hangs on my snb]
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-20 15:26:41 -07:00
Kenneth Graunke 9d971b3753 drm/i915: Rename PIPE_CONTROL bit defines to be less terse.
"STALL_AT_SCOREBOARD" is much clearer than "STALL_EN" now that there are
several different kinds of stalls.  Also, "INSTRUCTION_CACHE_INVALIDATE"
is a lot easier to understand at a glance than the terse "IS_FLUSH."

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
[danvet: use INVALIDATE for ro cache flags for more consistency]
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-20 15:26:40 -07:00
Kenneth Graunke fcbc34e4dc drm/i915: Remove implied length of 2 from GFX_OP_PIPE_CONTROL #define.
Not all PIPE_CONTROLs have a length of 2, so remove it from the #define
and make each invocation specify the desired length.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
[danvet: implement style suggestion from Ben Widawsdy]
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-20 15:26:40 -07:00
Ben Widawsky 5c0422878f drm/i915: ILK + VT-d workaround
Idle the GPU before doing any unmaps. We know if VT-d is in use through
an exported variable from iommu code.

This should avoid a known HW issue.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-20 15:26:39 -07:00
Ben Widawsky f372b85463 drm/i915: Remove early exit on i915_gpu_idle
[Description from: Daniel Vetter]
I've just discussed this quickly with Chris on irc and it's probably
best to just kill the list_empty early bailout. gpu_idle isn't a
fastpath, so who cares. One candidate where we emit commands to the ring
without adding anything onto these lists is e.g. pageflip. There are
probably more.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-20 15:26:38 -07:00
Daniel Vetter 130c2561de drm/i915: drop KM_USER0 argument to k(un)map_atomic
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-20 15:26:37 -07:00
Chris Wilson 8ffc024681 drm/i915: Defend against userspace creating a gem object with size==0
We currently only round up the userspace size to the next page. We
assume that userspace hasn't made a mistake and requested a zero-length
gem object and all through our internal code we then presume that every
object is backed by at least a single page. Fix that oversight and
report EINVAL back to userspace if they try to create a zero length
object.

[danvet: This fixes tests/gem_bad_length]

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-20 14:11:19 -07:00
Daniel Vetter 6dacfd2faa drm/i915: simplify swapin/out swizzle checking a bit
Use the helper function already employed by the pwrite/pread
functions.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-20 14:11:18 -07:00
Daniel Vetter acc83eb5a1 drm/i915: fix swizzling on gen6+
Fixes tests/gem_tiled_pread on my snb. I know, mesa doesn't use this
on gen6+, but I also hate failing testcases.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-20 14:11:18 -07:00
Daniel Vetter 6fdd4d98e5 drm/i915: properly cancel rps_work on module unload v2
The rps disabling code wasn't properly cancelling outstanding work
items. Also add a comment that explains why we're not racing with
the work item that could unmask interrupts - that piece of code
confused me quite a bit.

v2: Ben Widawsky pointed out that the first patch would deadlock
(and a few lesser problems). All corrected.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-20 14:11:17 -07:00
Daniel Vetter a9e2641dee drm/i915: close PM interrupt masking races in the rps work func
This patch closes the following race:

We get a PM interrupt A, mask it, set dev_priv->iir = PM_A and kick of the
work item. Scheduler isn't grumpy, so the work queue takes rps_lock,
grabs pm_iir = dev_priv->pm_iir and pm_imr = READ(PMIMR). Note that
pm_imr == pm_iir because we've just masked the interrupt we've got.

Now hw sends out PM interrupt B (not masked), we process it and mask
it.  Later on the irq handler also clears PMIIR.

Then the work item proceeds and at the end clears PMIMR. Because
(local) pm_imr == pm_iir we have
        pm_imr & ~pm_iir == 0
so all interrupts are enabled.

Hardware is still interrupt-happy, and sends out a new PM interrupt B.
PMIMR doesn't mask B (it does not mask anything), PMIIR is cleared, so
we get it and hit the WARN in the interrupt handler (because
dev_priv->pm_iir == PM_B).

That's why I've moved the
        WRITE(PMIMR, 0)
up under the protection of the rps_lock. And write an uncoditional 0
to PMIMR, because that's what we'll do anyway.

This races looks much more likely because we can arbitrarily extend
the window by grabing dev->struct mutex right after the irq handler
has processed the first PM_B interrupt.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-20 14:11:17 -07:00
Daniel Vetter 4fb066ab9e drm/i915: close PM interrupt masking races in the irq handler
Quoting Chris Wilson's more concise description:

"Ah I think I see the problem. As you point out we only mask the current
interrupt received, so that if we have a task pending (and so IMR != 0) we
actually unmask the pending interrupt and so could receive it again before the
tasklet is finally kicked off by the grumpy scheduler."

We need the hw to issue PM interrupts A, B, A while the scheduler is hating us
and refuses to run the rps work item. On receiving PM interrupt A we hit the
WARN because

dev_priv->pm_iir == PM_A | PM_B

Also add a posting read as suggested by Chris to ensure proper ordering of the
writes to PMIMR and PMIIR. Just in case somebody weakens write ordering.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-20 14:11:16 -07:00
Adam Jackson d5090b9625 drm/i915: Remove redundant bit shifting from intel_gmbus_set_speed
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-20 14:11:16 -07:00
Adam Jackson 8bf38485de drm/i915: Rename intel_sdvo_hdmi_sink_detect
This is general TMDS detect, not HDMI specifically.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-20 14:11:16 -07:00
Adam Jackson 2294488da3 drm/i915: Fix multifunction SDVO detection
I can't think of any sensible reason to limit this to a mask of 0x0f,
ie, SDVO_OUTPUT_{TMDS,RGB,CVBS,SVID}0.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-20 14:11:15 -07:00
Adam Jackson 46eb303682 drm/i915: Remove "i2c_speed" nonsense from child device table
I have no evidence for this byte being used this way, and lots of
counterexamples.  Restore the struct to its empirical definition and
patch up gmbus setup to match.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-20 14:11:15 -07:00
Keith Packard 9a1f57808a Merge branch 'fix-pch-refclk' into foo 2011-10-20 14:10:43 -07:00
Keith Packard 86a3073e48 Merge branch 'edp-training-fixes' into drm-intel-next
Conflicts:
	drivers/gpu/drm/i915/intel_dp.c

Just whitespace change conflicts
2011-10-20 14:10:07 -07:00
Rob Clark dd2351da7c drm: drm_ioctl() should zero-init extra data
If an older userspace passes in a smaller arg than the current kernel
ioctl arg struct, then extra fields should be initialized to zero
rather than passing random data to the DRM driver.

Signed-off-by: Rob Clark <rob@ti.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-19 14:46:45 +01:00
Alex Deucher 5a6e8482a1 drm/radeon/kms/atom: fix handling of FB scratch indices
FB scratch indices are dword indices, but we were treating
them as byte indices.  As such, we were getting the wrong
FB scratch data for non-0 indices.  Fix the indices and
guard the indexing against indices larger than the scratch
allocation.

Fixes memory corruption on some boards if data was written
past the end of the FB scratch array.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reported-by: Dave Airlie <airlied@redhat.com>
Tested-by: Dave Airlie <airlied@redhat.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-19 09:47:47 +01:00
Dave Airlie 017ed8012e Merge tag 'v3.1-rc10' into drm-core-next
There are a number of fixes in mainline required for code in -next,
also there was a few conflicts I'd rather resolve myself.

Signed-off-by: Dave Airlie <airlied@redhat.com>

Conflicts:
	drivers/gpu/drm/radeon/evergreen.c
	drivers/gpu/drm/radeon/r600.c
	drivers/gpu/drm/radeon/radeon_asic.h
2011-10-18 10:54:30 +01:00
Dan Carpenter 80d9b24a65 vmwgfx: information leak in vmw_execbuf_copy_fence_user()
If ret is non-zero then we don't initialize the struct which leaks
stack information to user space.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Vasiliy Kulikov <segoon@openwall.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-18 10:42:01 +01:00
Dan Carpenter 0c5d37033b vmwgfx: memory leaks caused by double allocation
These variables get allocated twice so the first allocation is a
memory leak.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-18 10:41:31 +01:00
Dan Carpenter d2c184fb10 vmwgfx: return -EFAULT instead of number of bytes remaining
The intent here was to return an error code, but instead the code
returns the number of bytes remaining (that weren't copied).

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-18 10:41:11 +01:00
Marcin Slusarz bd8315c4a8 drm: simplify error printing in drm_debugfs_create_files
There's no need to copy d_name.name.

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-18 10:20:34 +01:00
Marcin Slusarz a0f9219924 drm: fix error message about failed procfs file registration
It printed garbage.

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-18 10:20:23 +01:00
Alex Deucher a4863ca93c drm/radeon/kms/DCE4.1: fix Select_CrtcSource EncodeMode setting for DP bridges (v2)
Settings in this table reflect the physical panel/connector rather
than the internal dig encoding.

v2: fix typo for DRM_MODE_CONNECTOR_VGA case.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-18 10:16:55 +01:00
Alex Deucher 09cc6506f9 drm/radeon/kms/DCE4.1: ss is not supported on the internal pplls
It's handled via external clock.  It should already be protected
by the external ss flag, but add an explicit check just in case.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-18 10:16:33 +01:00
Alex Deucher 3a6dea3145 drm/radeon/kms/DCE4.1: fix dig encoder to transmitter mapping
llano has fully routeable dig encoders similar to DCE3.2 while
ontario has a hardcoded mapping similar to DCE4.0.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-18 10:16:10 +01:00
Alex Deucher 6ddddfe734 drm/radeon/kms: make r600-NI blit suspend code common
r600-NI shared the same blit suspend code.  Clean it up
and make it a shared function.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Ilija Hadzic <ihadzic@research.bell-labs.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-18 10:12:51 +01:00
Ilija Hadzic fb3d9e97e1 drm/radeon/kms: blit code commoning
factor out most of evergreen blit code and use the refactored code
from r600 that is now common for both r600 and evergreen

Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-18 10:10:52 +01:00
Ilija Hadzic b353096345 drm/radeon/kms: rename a variable for consistency
blit copy functions deal with GPU pages, not CPU pages,
so rename the variables and parameters accordingly

Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-18 10:06:34 +01:00
Ilija Hadzic 8eec9d6f74 drm/radeon/kms: cleanup r600 blit code
reorganize the code such that only the primitives (i.e., the functions
that load the CP ring) are hardware specific; dynamically link the
primitives in a (new) pointer structure inside r600_blit at
blit initialization time so that the functions that control the blit
operations can be made common for r600 and evergreen parts

Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-18 10:06:24 +01:00
Ilija Hadzic 638dd7db59 drm/radeon/kms: add more elaborate benchmarks
Lots of new (and hopefully useful) benchmark. Load the driver
with radeon_benchmark=<test_number> and enjoy. Among tests
added are VRAM to VRAM blits and blits with buffer size sweeps.
The latter can be from GTT to VRAM, VRAM to GTT, and VRAM to VRAM
and there are two types of sweeps: powers of two and (probably
more interesting) buffers sizes that correspond to common modes.

Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-18 10:06:23 +01:00
Ilija Hadzic cc34051515 drm/radeon/kms: cleanup benchmark code
factor out repeated code into functions
fix units in which the throughput is reported (megabytes per second
and megabits per second make sense, others are kind of confusing)
make report more amenable to awk and friends (e.g. whitespace is
always the separator, unit is separated from the number, etc)
add #defines for some hard coded constants

besides "beautification" this reorg is done in preparation
for writing more elaborate benchmarks

Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-18 10:06:23 +01:00
Ilija Hadzic 3a38612e32 drm/radeon/kms: demystify r600 blit code
some 3d register bits look like magic in r600 blit functions
use predefined constants to make it more intuitive what they are

Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-18 10:06:23 +01:00
Ilija Hadzic 6018faf58d drm/radeon/kms: demystify evergreen blit code
some bits in 3D registers used by blit functions look like
magic and this is hard to follow; change them to a little bit
more meaningful pre-defined constants

Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-18 10:06:23 +01:00
Alex Deucher 7dbf41db32 drm/radeon/kms: simplify r6xx blit code
Covert 4k pages to multiples of 64x64x4 tiles.
This is also more efficient than a scanline based
approach from the MC's perspective.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-18 10:06:22 +01:00
Ilija Hadzic eb32d0c34e drm/radeon/kms: simplify evergreen blit code
Covert 4k pages to multiples of 64x64x4 tiles.
This is also more efficient than a scanline based
approach from the MC's perspective.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-18 10:06:04 +01:00
Jean Delvare 43e5f61257 drm/radeon/kms: Simplify I2C post_xfer function
There is no point in re-doing in post_xfer all the initialization
that was already done by pre_xfer. Instead, only do the work which
differs from pre_xfer.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-18 10:03:15 +01:00
Inki Dae a88cab2bb1 drm/exynos: fixed build warnings and comments.
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-18 10:01:19 +01:00
Inki Dae ccf4d883f8 drm/exynos: fixed page flip bug.
in case of using two drivers such as fimd and hdmi controller that
they have their own hardware interrupt, drm framework doesn't provide
pipe number corresponding to it. so the pipe should be set to event's
from specific crtc.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-18 10:01:19 +01:00
Inki Dae f6b9825294 drm/exynos: added comments and code clean.
this patch adds the following comments and code clean.
- add comment of exynos_drm_crtc_apply() call at page flip time.
- add comment that when exynos_drm_fbdev_reinit() is called,
  why num_connector is 0 and also the framebuffers should be destroyed.
- remove buf_off member from struct exynos_drm_overlay because this member
  isn't used anymore.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-18 10:01:18 +01:00
Inki Dae 601b44e3db drm/exynos: fixed bug to exynos_drm_fb_dev_reinit().
this patch solves the problem that fb_helper is released
when exynos_drm_fbdev_reinit() was called. if this function call
is ok then just return.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-18 10:01:18 +01:00
Inki Dae 41c243464f drm/exynos: added device object as argument of subdrv_probe().
sub drivers should refer to its own device object to access
its own context.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-18 10:01:18 +01:00
Inki Dae 8e9cc6a13a drm/exynos: fixed overlay updating time at page flip.
buffer addess is set to shadow register and then applied to
real register at vsync front porch time.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-18 10:01:18 +01:00
Inki Dae 19c8b8343d drm/exynos: fixed overlay data updating.
this patch adds common members to overlay structure and
makes each driver such as fimd or hdmi driver set them to
its own structure.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-18 10:01:17 +01:00
Andi Kleen 6fcbef7a50 drm/radeon: Move r100_*_*reg out of line
This shrinks the sizes of a lot of functions in the radeon driver
dramatically.

With a non force inline + -Os kernel this is default anyways.

Cc: David Airlie <airlied@linux.ie>

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-18 09:55:05 +01:00
Andi Kleen ce580fab73 drm/radeon: Move more code out of line
With this patch I'm only about 50k larger with DRM debugging
enables (why is that enabled by default?!?), and slightly
smaller without.

[airlied: moved r100.c additions to radeon_ring.c]

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-18 09:53:05 +01:00
Andi Kleen cbdd45015a drm/radeon: Remove more bogus inlines in the radeon driver.
Remove bogus inlines in evergreen and r100.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-18 09:44:52 +01:00
Andi Kleen 6a2f371d71 drm/radeon: Remove now unused functions in radeon driver
With the dropped inlines gccs starts warning about genuinely unused
functions. Remove r600_bpe_from_format, evergreen_cs_track_validate_cb,
evergreen-cs_packet_next_is_pkt3_nop which are all unused.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-18 09:44:45 +01:00
Andi Kleen 74740c8324 drm/radeon: drop inlines in r600_blit.c
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-18 09:44:38 +01:00
Andi Kleen 488479ebcb drm/radeon: Drop inlines from evergreen_cs.c / r600_cs.c
Fixes

evergreen_cs_parse                          4080   23124  +19044

and others compared to a non force inline kernel.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-18 09:44:20 +01:00
Jakob Bornecrantz 1c482ab359 vmwgfx: Add vblank stubs
This fixes kernel panics when running the vbltest from the drm repo. We
can't just skip initializing the vblank system since it sets up certain
state for us, see: "vmwgfx: Enable use of the vblank system."

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-18 09:39:04 +01:00
Jakob Bornecrantz 74b5ea3076 vmwgfx: Whitespace & code style in display unit
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-18 09:39:03 +01:00
Jakob Bornecrantz 60a16a30d9 vmwgfx: Fix display system init & close functions
Make sure we null the display private, make sure we catch and
handle vblank failing to init and don't call vblank_cleanup if
we haven't initialized the display system.

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-18 09:39:01 +01:00
Thomas Hellstrom e22469ca88 ttm: Fix error-path using an uninitialized value
Pointed out by Michel Daenzer.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-18 09:37:49 +01:00
Keith Packard 32ce697c53 drm/i915: No need to wait for eDP power off delay if panel is on
If the panel is powered up, there's no need to delay for the 'off'
interval when turning the panel on.

Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-12 10:37:46 -06:00
Keith Packard 05ce1a4961 drm/i915: Restrict ILK-specific eDP power hack to ILK
This eliminates a fairly long delay when power sequencing newer
hardware

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-10-12 10:37:38 -06:00
Ilija Hadzic b07759bf41 drm/radeon: allow pcie gen2 speed on Cayman
Looks like the same pcie gen2 speed initialization for
Evergreen also works on Cayman and seems to come up fine,
so enable it if the module parameter says so

Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-12 14:44:00 +01:00
Ilija Hadzic cd54033ae9 drm/radeon: allow pcie gen2 speed on NI
Enabling pcie gen2 speed was skipped for Northern Islands
AISCs, although it looks like it works just fine with the same
initialization sequence used for evergreen.

According to Alex D. gen2 init was skipped to prevent a crash
that has been caused by some other bug that has been
fixed in the meantime; so now it should be safe to enable it.

Signed-off-by: Ilija Hadzic <ihadzic@research.bell-labs.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-12 14:39:03 +01:00
Thomas Hellstrom 5a7b74beca vmwgfx: Take the driver out of staging
Also improve a bit on the Kconfig help.

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-11 13:06:36 +01:00
Adam Jackson 836e53d758 drm: Add KMS debug printk's for encoder and crtc fixup failure
Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-11 09:26:19 +01:00
Dave Airlie 62addcb8c1 Merge branch 'drm-intel-next' of git://people.freedesktop.org/~keithp/linux into drm-core-next
* 'drm-intel-next' of git://people.freedesktop.org/~keithp/linux:
  drm/i915: Dumb down the semaphore logic
  drm/i915: pass ELD to HDMI/DP audio driver
  drm: support routines for HDMI/DP ELD
  drm/i915: Enable dither whenever display bpc < frame buffer bpc
  drm/i915: Enable dither whenever display bpc < frame buffer bpc
2011-10-10 20:05:21 +01:00
Thomas Hellstrom 5438ae88d0 vmwgfx: Wrap drm_read and drm_poll
Make sure the device is processing the fifo when these functions are
called in case they might sleep waiting for an event.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-10 15:47:19 +01:00
Thomas Hellstrom 57c5ee79ac vmwgfx: Add fence events
Add a way to send DRM events down the gpu fifo by attaching them to
fence objects. This may be useful for Xserver swapbuffer throttling and
page-flip done notifications.

Bump version to 2.2 to signal the availability of the FENCE_EVENT ioctl.

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-10 15:46:55 +01:00
Thomas Hellstrom 8bf445cee3 vmwgfx: Break out and comment vmw_execbuf_copy_fence_user
This function will be used also by the upcoming fence event code,
so break it out and add a comment about the functionality.

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-10 15:46:28 +01:00
Alex Deucher 005a83f141 drm/radeon/kms: set DMA mask properly on newer PCI asics
If a card wasn't PCIE, we always set the DMA mask to 32 bits.
This is only applies to the old rage128/r1xx gart block on
early radeon asics (~r1xx-r4xx).  Newer PCI and IGP cards
can handle 40 bits just fine.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: Chen Jie <chenj@lemote.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-10 09:11:31 +01:00
Michael Witten c245cb9e15 DRM: bug: RADEON_DEBUGFS_MAX_{NUM_FILES => COMPONENTS}
The value of RADEON_DEBUGFS_MAX_NUM_FILES has been used to
specify the size of an array, each element of which looks
like this:

  struct radeon_debugfs {
          struct drm_info_list    *files;
          unsigned                num_files;
  };

Consequently, the number of debugfs files may be much greater
than RADEON_DEBUGFS_MAX_NUM_FILES, something that the current
code ignores:

  if ((_radeon_debugfs_count + nfiles) > RADEON_DEBUGFS_MAX_NUM_FILES) {
          DRM_ERROR("Reached maximum number of debugfs files.\n");
          DRM_ERROR("Report so we increase RADEON_DEBUGFS_MAX_NUM_FILES.\n");
          return -EINVAL;
  }

This commit fixes this make, and accordingly renames:

  RADEON_DEBUGFS_MAX_NUM_FILES

to:

  RADEON_DEBUGFS_MAX_COMPONENTS

Signed-off-by: Michael Witten <mfwitten@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-10 09:04:57 +01:00
Alex Deucher d0d0a225e6 drm/radeon/kms: handle !force case in connector detect more gracefully
When force == false, we don't do load detection in the connector
detect functions.  Unforunately, we also return the previous
connector state so we never get disconnect events for DVI-I, DVI-A,
or VGA.  Save whether we detected the monitor via load detection
previously and use that to determine whether we return the previous
state or not.

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

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-10 09:04:26 +01:00
Alex Deucher 5f0a26128d drm/radeon/kms: bail early in dvi_detect for digital only connectors
DVI-D and HDMI-A are digital only, so there's no need to
attempt analog load detect.  Also, skip bail before the
!force check, or we fail to get a disconnect events.
The next patches in the series attempt to fix disconnect
events for connectors with analog support (DVI-I, HDMI-B,
DVI-A).

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

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-10 09:04:10 +01:00
Jean Delvare 286e0c94f9 drm/radeon/kms: Fix I2C mask definitions
Commit 9b9fe724 accidentally used RADEON_GPIO_EN_* where
RADEON_GPIO_MASK_* was intended. This caused improper initialization
of I2C buses, mostly visible when setting i2c_algo_bit.bit_test=1.
Using the right constants fixes the problem.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Cc: Jerome Glisse <j.glisse@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-10 09:03:10 +01:00
Jakob Bornecrantz c6ca839179 vmwgfx: Don't use virtual coords when using screen objects
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-10 09:01:51 +01:00
Thomas Hellstrom 414ee50b3a vmwgfx: Implement memory accounting for resources
Contexts, surfaces and streams allocate persistent kernel memory as the
direct result of user-space requests. Make sure this memory is
accounted as graphics memory, to avoid DOS vulnerabilities.

Also take the TTM read lock around resource creation to block
switched-out dri clients from allocating resources.

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-10 09:01:44 +01:00
Keith Packard bd94315971 drm/i915: Disable eDP VDD in a delayed work proc instead of synchronously
There's no good reason to turn off the eDP force VDD bit synchronously
while probing devices; that just sticks a huge delay into all mode
setting paths. Instead, queue a delayed work proc to disable the VDD
force bit and then remember when that fires to ensure that the
appropriate delay is respected before trying to turn it back on.

Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-06 08:57:02 -07:00
Keith Packard ebf33b1881 drm/i915: Create helper functions to determine eDP power state
We need to check eDP VDD force and panel on in several places, so
create some simple helper functions to avoid duplicating code.

Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-06 08:57:01 -07:00
Keith Packard 7d639f35b7 drm/i915: edp_panel_on does not need to return a bool
The return value was unused, so just stop doing that.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-10-06 08:57:01 -07:00
Keith Packard d15456de79 drm/i915: Move eDP panel fixed mode from dev_priv to intel_dp
This value doesn't come directly from the VBT, and so is rather
specific to the particular DP output.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-10-06 08:57:00 -07:00
Keith Packard f01eca2e52 drm/i915: Correct eDP panel power sequencing delay computations
Store the panel power sequencing delays in the dp private structure,
rather than the global device structure. Who knows, maybe we'll get
more than one eDP device in the future.

From the eDP spec, we need the following numbers:

 T1 + T3	Power on to Aux Channel operation (panel_power_up_delay)

		This marks how long it takes the panel to boot up and
		get ready to receive aux channel communications.

 T8		Video signal to backlight on (backlight_on_delay)

		Once a valid video signal is being sent to the device,
		it can take a while before the panel is actuall
		showing useful data. This delay allows the panel
		to get something reasonable up before the backlight
		is turned on.

 T9		Backlight off to video off (backlight_off_delay)

		Turning the backlight off can take a moment, so
		this delay makes sure there is still valid video
		data on the screen.

 T10		Video off to power off (panel_power_down_delay)

		Presumably this delay allows the panel to perform
		an orderly shutdown of the display.

 T11 + T12	Power off to power on (panel_power_cycle_delay)

		So, once you turn the panel off, you have to wait a
		while before you can turn it back on. This delay is
		usually the longest in the entire sequence.

Neither the VBIOS source code nor the hardware documentation has a
clear mapping between the delay values they provide and those required
by the eDP spec. The VBIOS code actually uses two different labels for
the delay values in the five words of the relevant VBT table.

**** MORE LATER ***

Look at both the current hardware register settings and the VBT
specified panel power sequencing timings. Use the maximum of the two
delays, to make sure things work reliably. If there is no VBT data,
then those values will be initialized to zero, so we'll just use the
values as programmed in the hardware. Note that the BIOS just fetches
delays from the VBT table to place in the hardware registers, so we
should get the same values from both places, except for rounding.

VBT doesn't provide any values for T1 or T2, so we'll always just use
the hardware value for that.

The panel power up delay is thus T1 + T2 + T3, which should be
sufficient in all cases.

The panel power down delay is T1 + T2 + T12, using T1+T2 as a proxy
for T11, which isn't available anywhere.

For the backlight delays, the eDP spec says T6 + T8 is the delay from the
end of link training to backlight on and T9 is the delay from
backlight off until video off. The hardware provides a 'backlight on'
delay, which I'm taking to be T6 + T8 while the VBT provides something
called 'T7', which I'm assuming is s

On the macbook air I'm testing with, this yields a power-up delay of
over 200ms and a power-down delay of over 600ms. It all works now, but
we're frobbing these power controls several times during mode setting,
making the whole process take an awfully long time.

Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-06 08:37:15 -07:00
Alex Deucher cb7cf41961 drm/radeon/kms: use hardcoded dig encoder to transmitter mapping for DCE4.1
The encoders are supposedly fully routeable, but changing the mapping
doesn't always seem to take.  Using a hardcoded mapping is much more
reliable.

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

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Tested-by: Simon Farnsworth <simon.farnsworth@onelan.co.uk>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-06 11:45:30 +01:00
Keith Packard f58ff8549e drm/i915: Ensure eDP powered up during DP_SET_POWER operation in dp_prepare
Any call to intel_dp_sink_dpms must ensure that the panel has power so
that the DP_SET_POWER operation will be correctly received. The only
one missing this was in intel_dp_prepare.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-10-05 19:56:52 -07:00
Keith Packard 0b5c541b93 drm/i915: Enable eDP panel power during I2C initialization sequence
The DP i2c initialization code does a couple of i2c transactions,
which means that an eDP panel must be powered up.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-10-05 19:56:51 -07:00
Keith Packard 8c241fef3e drm/i915: Wrap DP EDID fetch functions to enable eDP panel power
Talking to the eDP DDC channel requires that the panel be powered
up. Wrap both the EDID and modes fetch code with calls to turn the vdd
power on and back off.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-10-05 19:56:51 -07:00
Keith Packard 552fb0b7a6 drm/i915: Delay DP i2c initialization until panel power timings are computed
On eDP, DDC requires panel power, but turning that on uses the panel
power sequencing timing values fetch from the DPCD data.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-10-05 19:56:50 -07:00
Keith Packard 245e270877 drm/i915: Ensure panel is on during DPMS off
If the panel is already off, we'll need to turn VDD on to execute the
(useless) DPMS off code. Yes, it would be better to just not do any of
this, but correctness, and *then* performance.

Signed-off-by: Keith Packard <keithp@keithp.com>
2011-10-05 19:54:29 -07:00
Alex Deucher 6777a4f689 drm/radeon/kms: fix dp_detect handling for DP bridge chips
The HPD pin is not reliable for detecting whether a monitor
is connected or not.  Skip HPD and just use DDC or load
detection.

Fixes phantom VGA connected bugs.

[Michel: fixes phantom VGA bugs on his llano system.]

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-05 10:31:40 +01:00
Alex Deucher 4f332844cc drm/radeon/kms: retry aux transactions if there are status flags
If there are error flags in the aux status, retry the transaction.
This makes aux much more reliable, especially on llano systems.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-05 10:30:50 +01:00
Inki Dae 1c248b7d29 DRM: add DRM Driver for Samsung SoC EXYNOS4210.
This patch is a DRM Driver for Samsung SoC Exynos4210 and now enables
only FIMD yet but we will add HDMI support also in the future.

this patch is based on git repository below:
git://people.freedesktop.org/~airlied/linux.git
branch name: drm-next
commit-id: 88ef4e3f4f

you can refer to our working repository below:
http://git.infradead.org/users/kmpark/linux-2.6-samsung
branch name: samsung-drm

We tried to re-use lowlevel codes of the FIMD driver(s3c-fb.c
based on Linux framebuffer) but couldn't so because lowlevel codes
of s3c-fb.c are included internally and so FIMD module of this driver has
its own lowlevel codes.

We used GEM framework for buffer management and DMA APIs(dma_alloc_*)
for buffer allocation so we can allocate physically continuous memory
for DMA through it and also we could use CMA later if CMA is applied to
mainline.

Refer to this link for CMA(Continuous Memory Allocator):
http://lkml.org/lkml/2011/7/20/45

this driver supports only physically continuous memory(non-iommu).

Links to previous versions of the patchset:
v1: < https://lwn.net/Articles/454380/ >
v2: < http://www.spinics.net/lists/kernel/msg1224275.html >
v3: < http://www.spinics.net/lists/dri-devel/msg13755.html >
v4: < http://permalink.gmane.org/gmane.comp.video.dri.devel/60439 >
v5: < http://comments.gmane.org/gmane.comp.video.dri.devel/60802 >

Changelog v2:
DRM: add DRM_IOCTL_SAMSUNG_GEM_MMAP ioctl command.

    this feature maps user address space to physical memory region
    once user application requests DRM_IOCTL_SAMSUNG_GEM_MMAP ioctl.

DRM: code clean and add exception codes.

Changelog v3:
DRM: Support multiple irq.

    FIMD and HDMI have their own irq handler but DRM Framework can regiter
    only one irq handler this patch supports mutiple irq for Samsung SoC.

DRM: Consider modularization.

    each DRM, FIMD could be built as a module.

DRM: Have indenpendent crtc object.

    crtc isn't specific to SoC Platform so this patch gets a crtc
    to be used as common object.
    created crtc could be attached to any encoder object.

DRM: code clean and add exception codes.

Changelog v4:
DRM: remove is_defult from samsung_fb.

    is_default isn't used for default framebuffer.

DRM: code refactoring to fimd module.
    this patch is be considered with multiple display objects and
    would use its own request_irq() to register a irq handler instead of
    drm framework's one.

DRM: remove find_samsung_drm_gem_object()

DRM: move kernel private data structures and definitions to driver folder.

    samsung_drm.h would contain only public information for userspace
    ioctl interface.

DRM: code refactoring to gem modules.
    buffer module isn't dependent of gem module anymore.

DRM: fixed security issue.

DRM: remove encoder porinter from specific connector.

    samsung connector doesn't need to have generic encoder.

DRM: code clean and add exception codes.

Changelog v5:
DRM: updated fimd(display controller) driver.
    added various pixel formats, color key and pixel blending features.

DRM: removed end_buf_off from samsung_drm_overlay structure.
    this variable isn't used and end buffer address would be
    calculated by each sub driver.

DRM: use generic function for mmap_offset.
    replaced samsung_drm_gem_create_mmap_offset() and
    samsung_drm_free_mmap_offset() with generic ones applied
    to mainline recentrly.

DRM: removed unnecessary codes and added exception codes.

DRM: added comments and code clean.

Changelog v6:
DRM: added default config options.

DRM: added padding for 64-bit align.

DRM: changed prefix 'samsung' to 'exynos'

Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-05 10:27:31 +01:00
Thomas Hellstrom 6ea77d1384 vmwgfx: Minor cleanups
As suggested by Konrad Rzeszutek Wilk

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-05 10:17:36 +01:00
Thomas Hellstrom e5ed157d93 vmwgfx: Bump driver minor to advertise support for new ioctls.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-05 10:17:34 +01:00
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
Alex Deucher 12d5180bd7 drm/radeon/kms: fix channel_remap setup (v2)
Most asics just use the hw default value which requires
no explicit programming.  For those that need a different
value, the vbios will program it properly.  As such,
there's no need to program these registers explicitly
in the driver.  Changing MC_SHARED_CHREMAP requires a reload
of all data in vram otherwise its contents will be scambled.

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

v2: drop now unused channel_remap functions.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-04 17:24:14 +01:00
Michel Dänzer 02e6859eae drm/radeon: Set cursor x/y to 0 when x/yorigin > 0.
Apart from the obvious cleanup, this should make the line

			cursor_end = x - xorigin + w;

correct now.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-03 18:37:37 +01:00
Michel Dänzer b8aee294d8 drm/radeon: Update AVIVO cursor coordinate origin before x/yorigin calculation.
Fixes cursor disappearing prematurely when moving off a top/left edge which
is not located at the desktop top/left edge.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Cc: stable@kernel.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-03 18:37:36 +01:00
Michel Dänzer 7d309529b4 drm/radeon: Simplify cursor x/yorigin calculation.
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-03 18:37:35 +01:00
Nicholas Miell b356fe0afe drm/radeon/kms: fix cursor image off-by-one error
The mouse cursor hotspot calculation when the cursor is partially off the
top or left side of the screen was off by one.

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

Signed-off-by: Nicholas Miell <nmiell@gmail.com>
Reviewed-by: Michel Dänzer <michel@daenzer.net>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-03 18:37:33 +01:00
Alex Deucher 5ba7ddf816 drm/radeon/kms: Fix logic error in DP HPD handler
Only disable the pipe if the monitor is physically
disconnected.  The previous logic also disabled the
pipe if the link was trained.

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

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-03 18:37:32 +01:00
Alex Deucher 6375bda073 drm/radeon/kms: add retry limits for native DP aux defer
The previous code could potentially loop forever.  Limit
the number of DP aux defer retries to 4 for native aux
transactions, same as i2c over aux transactions.

Noticed by: Brad Campbell <lists2009@fnarfbargle.com>

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: Brad Campbell <lists2009@fnarfbargle.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-03 18:37:31 +01:00
Alex Deucher 109bc10d30 drm/radeon/kms: fix regression in DP aux defer handling
An incorrect ordering in the error checking code lead
to DP aux defer being skipped in the aux native write
path.  Move the bytes transferred check (ret == 0)
below the defer check.

Tracked down by: Brad Campbell <brad@fnarfbargle.com>

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

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: Brad Campbell <brad@fnarfbargle.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-10-03 18:37:30 +01:00
Keith Packard bee7eb2da2 drm/i915: Turn force VDD back off when panel running in intel_dp_dpms
The VDD force bit is turned on before touching the panel, but if it
was enabled, there was no call to turn it back off. Add a call.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-09-30 16:23:46 -07:00
Keith Packard 97af61f57e drm/i915: Check for eDP inside edp panel on/off funcs
Cleans up code dealing with eDP a bit. Remove redundant checks in
callers

Signed-off-by: Keith Packard <keithp@keithp.com>
2011-09-30 16:23:46 -07:00
Keith Packard 1c0ae80a5e drm/i915: Unlock PCH_PP_CONTROL always
Avoid any question about locked registers by just writing the unlock
pattern with every write to the register.

Signed-off-by: Keith Packard <keithp@keithp.com>
2011-09-30 16:23:45 -07:00
Keith Packard 9b984daec4 drm/i915: Check eDP power when doing aux channel communications
Verify that the eDP VDD is on, either with the panel being on or with
the VDD force-on bit being set.

This demonstrates that in many instances, VDD is not on when needed,
which leads to failed EDID communications.

Signed-off-by: Keith Packard <keithp@keithp.com>
2011-09-30 16:23:45 -07:00
Keith Packard 47f0eb2234 drm/i915: Only use VBT panel mode on eDP if no EDID is found
We're going to assume that EDID is more reliable than the VBT tables
for eDP panels, which is notably true on MacBook machines where the
VBT contains completely bogus data.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-09-30 16:23:44 -07:00
Keith Packard 192aac1f19 drm/i915: Shut down PCH interrupts during irq_uninstall
This masks out all interrupts and ack's any pending ones at IRQ
uninstall time to make sure we don't receive any unexpected interrupts
later on.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-09-30 15:30:41 -07:00
Keith Packard 7fe0b973fa drm/i915: Enable digital port hotplug on PCH systems
We were relying on the BIOS to set these bits, which doesn't always
happen.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-09-30 15:30:01 -07:00
Linus Torvalds 8e8e500fca Merge branch 'drm-intel-fixes' of git://people.freedesktop.org/~keithp/linux
* 'drm-intel-fixes' of git://people.freedesktop.org/~keithp/linux:
  drm/i915: FBC off for ironlake and older, otherwise on by default
  drm/i915: Enable SDVO hotplug interrupts for HDMI and DVI
  drm/i915: Enable dither whenever display bpc < frame buffer bpc
2011-09-29 19:23:30 -07:00
Keith Packard 0ac225e569 Merge branch 'drm-intel-fixes' into drm-intel-next 2011-09-28 14:44:38 -07:00
Keith Packard 9fb526db97 drm/i915: Initialize PCH refclks at modeset init time
The reference clock configuration must be done before any mode setting
can occur as all outputs must be disabled to change
anything. Initialize the clocks after turning everything off during
the initialization process.

Also, re-initialize the refclk at resume time.

Signed-off-by: Keith Packard <keithp@keithp.com>
2011-09-28 14:08:38 -07:00
Keith Packard afffb9dfb6 drm/i915: All PCH refclks are 120MHz
I can't find any reference clocks which run at 96MHz as seems to be
indicated from the comments in this code.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-28 14:08:37 -07:00
Keith Packard 99eb6a01e5 drm/i915: Use CK505 as non-SSC source where available
When trying to use SSC on Ibex Peak without CK505, any non-SSC outputs
(like VGA or TV) get broken. So, do not use SSC on Ibex Peak unless
there is a CK505 available (as specified by the VBT).

On Cougar Point, all clocking is internal, so SSC can always be used,
and there will never be a CK505 available.

This eliminates VGA shimmer on some Ironlake machines which have a
CK505 clock source.

References: https://bugzilla.kernel.org/show_bug.cgi?id=21742
References: https://bugs.freedesktop.org/show_bug.cgi?id=38750
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-28 14:08:06 -07:00
Keith Packard 199e5d79f1 drm/i915: Fix PCH SSC reference clock settings
The PCH refclk settings are global, so we need to look at all of the
encoders, not just the current encoder when deciding how to configure
it. Also, handle systems with more than one panel (any combination of
PCH/non-PCH eDP and LVDS).

Disable SSC clocks when no panels are connected.

Signed-off-by: Keith Packard <keithp@keithp.com>
2011-09-27 11:12:56 -07:00
Keith Packard 72bbe58cd9 drm/i915: Allow SSC parameter to override VBT value
Allow SSC to be enabled even when the BIOS disables it for testing SSC paths.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-27 11:12:40 -07:00
Keith Packard d2830bdb84 drm/i915: Document a few more BDB_GENERAL_FEATURES bits from PCH BIOS
This includes whether an eDP panel is present, and whether that should
use SSC (and at what frequency)

Signed-off-by: Keith Packard <keithp@keithp.com>
2011-09-27 11:12:39 -07:00
Keith Packard abd0686018 drv/i915: Pull display_clock_mode out of VBT table
This tells the driver whether a CK505 clock source is available on
pre-PCH hardware. If so, it should be used as the non-SSC source,
leaving the internal clock for use as the SSC source.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Chris Wison <chris@chris-wilson.co.uk>
2011-09-27 11:12:26 -07:00
Keith Packard 562396b9e4 drm/i915: Use DRM_DEBUG_KMS for all messages in intel_bios.c
These are all KMS related anyways, so don't hide them under other
debug levels.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-09-27 11:12:10 -07:00
Keith Packard 395072592e drm/i915: broken copyright encoding in intel_bios.c
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-09-26 22:29:38 -07:00
Alex Deucher fdfc61594e drm/radeon/kms: fix DDIA enable on some rs690 systems
DVOOutputControl checks the value of of bios scratch reg 3
on some tables and assumes the encoder is already enabled
if the DFP2_ACTIVE bit is set.  Clear that bit so the table
sets the DDIA enable bit properly.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-09-23 14:02:18 +01:00
Dave Airlie d9ad77ebfd Revert "drm/radeon/kms: fix typo in r100_blit_copy"
This reverts commit 18b4fada27.

This code was correct, apologies to anyone who noticed things broke.

revert contents are different due to another commit in between.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-09-23 14:01:44 +01:00
Keith Packard cd0de039bf drm/i915: FBC off for ironlake and older, otherwise on by default
Make the default FBC behaviour chipset specific, allowing us to turn
it on by default for Ironlake and older where it has been seen to
cause trouble with screen updates.

Signed-off-by: Keith Packard <keithp@keithp.com>
Tested-by: Francis Moreau <francis.moro@gmail.com>
2011-09-21 15:03:11 -07:00
Simon Farnsworth cc68c81aed drm/i915: Enable SDVO hotplug interrupts for HDMI and DVI
I was seeing a nasty 5 frame glitch every 10 seconds, caused by the
poll for connection on DVI attached by SDVO.

As my SDVO DVI supports hotplug detect interrupts, the fix is to
enable them, and hook them in to the various bits of driver
infrastructure so that they work reliably.

Note that this is only tested on single-function DVI-D SDVOs, on two
platforms (965GME and 945GSE), and has not been checked against a
specification document.

With lots of help from Adam Jackson <ajax@redhat.com> on IRC.

Signed-off-by: Simon Farnsworth <simon.farnsworth@onelan.co.uk>
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-09-21 14:55:51 -07:00
Ben Widawsky c8c99b0f0d drm/i915: Dumb down the semaphore logic
While I think the previous code is correct, it was hard to follow and
hard to debug. Since we already have a ring abstraction, might as well
use it to handle the semaphore updates and compares.

I don't expect this code to make semaphores better or worse, but you
never know...

v2:
Remove magic per Keith's suggestions.
Ran Daniel's gem_ring_sync_loop test on this.

v3:
Ignored one of Keith's suggestions.

v4:
Removed some bloat per Daniel's recommendation.

Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Keith Packard <keithp@keithp.com>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-09-21 14:52:41 -07:00
Wu Fengguang e0dac65ed4 drm/i915: pass ELD to HDMI/DP audio driver
Add ELD support for Intel Eaglelake, IbexPeak/Ironlake,
SandyBridge/CougarPoint and IvyBridge/PantherPoint chips.

ELD (EDID-Like Data) describes to the HDMI/DP audio driver the audio
capabilities of the plugged monitor. It's built and passed to audio
driver in 2 steps:

(1) at get_modes time, parse EDID and save ELD to drm_connector.eld[]

(2) at mode_set time, write drm_connector.eld[] to the Transcoder's hw
    ELD buffer and set the ELD_valid bit to inform HDMI/DP audio driver

This patch is tested OK on G45/HDMI, IbexPeak/HDMI and IvyBridge/HDMI+DP.
Test scheme: plug in the HDMI/DP monitor, and run

        cat /proc/asound/card0/eld*

to check if the monitor name, HDMI/DP type, etc. show up correctly.

Minor imperfection: the GEN5_AUD_CNTL_ST/DIP_Port_Select field always
reads 0 (reserved). Without knowing the port number, I worked it around
by setting the ELD_valid bit for ALL the three ports. It's tested to not
be a problem, because the audio driver will find invalid ELD data and
hence rightfully abort, even when it sees the ELD_valid indicator.

Thanks to Zhenyu and Pierre-Louis for a lot of valuable help and testing.

CC: Zhao Yakui <yakui.zhao@intel.com>
CC: Wang Zhenyu <zhenyu.z.wang@intel.com>
CC: Jeremy Bush <contractfrombelow@gmail.com>
CC: Christopher White <c.white@pulseforce.com>
CC: Pierre-Louis Bossart <pierre-louis.bossart@intel.com>
CC: Paul Menzel <paulepanter@users.sourceforge.net>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-09-21 14:52:41 -07:00
Wu Fengguang 76adaa34db drm: support routines for HDMI/DP ELD
ELD (EDID-Like Data) describes to the HDMI/DP audio driver the audio
capabilities of the plugged monitor.

This adds drm_edid_to_eld() for converting EDID to ELD. The converted
ELD will be saved in a new drm_connector.eld[128] data field. This is
necessary because the graphics driver will need to fixup some of the
data fields (eg. HDMI/DP connection type, AV sync delay) before writing
to the hardware ELD buffer. drm_av_sync_delay() will help the graphics
drivers dynamically compute the AV sync delay for fixing-up the ELD.

ELD selection policy: it's possible for one encoder to be associated
with multiple connectors (ie. monitors), in which case the first found
ELD will be returned by drm_select_eld(). This policy may not be
suitable for all users, but let's start it simple first.

The impact of ELD selection policy: assume there are two monitors, one
supports stereo playback and the other has 8-channel output; cloned
display mode is used, so that the two monitors are associated with the
same internal encoder. If only the stereo playback capability is reported,
the user won't be able to start 8-channel playback; if the 8-channel ELD
is reported, then user space applications may send 8-channel samples
down, however the user may actually be listening to the 2-channel
monitor and not connecting speakers to the 8-channel monitor.

According to James, many TVs will either refuse the display anything or
pop-up an OSD warning whenever they receive hdmi audio which they cannot
handle. Eventually we will require configurability and/or per-monitor
audio control even when the video is cloned.

CC: Zhao Yakui <yakui.zhao@intel.com>
CC: Wang Zhenyu <zhenyu.z.wang@intel.com>
CC: Jeremy Bush <contractfrombelow@gmail.com>
CC: Christopher White <c.white@pulseforce.com>
CC: Pierre-Louis Bossart <pierre-louis.bossart@intel.com>
CC: Paul Menzel <paulepanter@users.sourceforge.net>
CC: James Cloos <cloos@jhcloos.com>
CC: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-09-21 14:52:41 -07:00
Keith Packard 578393cd1e drm/i915: Enable dither whenever display bpc < frame buffer bpc
We want to enable dithering on any pipe where the frame buffer has
more color resolution than the output device.

The previous code was incorrectly clamping the frame buffer bpc to the
display bpc, effectively disabling dithering all of the time as the
computed frame buffer bpc would never be larger than the display bpc.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reported-by: Oliver Hartkopp <socketcan@hartkopp.net>
Tested-by: Oliver Hartkopp <socketcan@hartkopp.net>
2011-09-21 14:52:40 -07: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
Ben Skeggs a002feceb7 drm/nouveau/dp: pass in required datarate to link training
Not used currently, but it will be used in preference to pre-determined
lane/bandwidth numbers at a later point.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:10:19 +10:00
Ben Skeggs a8e415d3eb drm/nouveau/bios: check for null script pointers in parser
Allows us to be lazy elsewhere...

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:10:12 +10:00
Ben Skeggs 5024c54b5c drm/nva3/backlight: add suppport for newer style backlight regs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:10:06 +10:00
Ben Skeggs 09461459e1 drm/nv50/backlight: express brightness level in percent
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:10:02 +10:00
Ben Skeggs 10b461e40a drm/nv50/backlight: take the sor into account when bashing regs
I'm sure that out there somewhere, someone will need this.  We currently
haven't seen an example of LVDS being on a non-0 SOR so far though.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:09:56 +10:00
Ben Skeggs 730764812d drm/nouveau/backlight: make more consistent with rest of driver style
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:09:53 +10:00
Ben Skeggs 68c9918479 drm/nouveau: tidy connector hotplug handler, punt messages to debug
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:09:49 +10:00
Ben Skeggs 46959b7790 drm/nouveau/dp: remove reliance on vbios for native displayport
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:09:42 +10:00
Ben Skeggs 4372013388 drm/nouveau/dp: rewrite auxch transaction routines
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:09:03 +10:00
Ben Skeggs 91a8f1ea4b drm/nouveau: workaround semaphore hw bug causing unnecessary interrupts
The HW will only accept the DMA_FROM_MEMORY class for DMA_SEMAPHORE without
asking the driver to intervene.

It appears that semaphores will work correctly even without DMA_IN_MEMORY,
so lets avoid the large amount of interrupts generated by x-chan sync.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:08:59 +10:00
Ben Skeggs afb0c796d8 drm/nouveau/tmr: fix miscalculation of ratio on pre-nv4x chipsets
The clock_get() hook returns KHz, not Hz.

Also fixed to use crystal freq from dev_priv.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:08:54 +10:00
Ben Skeggs 378f85ed54 drm/nva3/pm: fixup for NVAF special
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:08:50 +10:00
Ben Skeggs 64e740bb3d drm/nva3/pm: use crystal freq where appropriate
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:08:44 +10:00
Ben Skeggs f2cbe46f14 drm/nouveau: determine timing crystal freq from straps
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:08:41 +10:00
Ben Skeggs 93e692dc5f drm/nva3/pm: pll disabled if bit 0 of ctrl not set
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:08:37 +10:00
Ben Skeggs 6b70e48167 drm/nouveau: magic to make auxch on new macbooks booted in EFI mode work
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:08:32 +10:00
Roy Spliet 2228c6fe04 drm/nouveau/pm: Document and expose CL and WR for 0x1002Cx
Signed-off-by: Roy Spliet <r.spliet@student.tudelft.nl>
2011-09-20 16:08:28 +10:00
Roy Spliet 9a78248876 drm/nouveau/pm: add initial NV3x/NVCx memtiming support, improve other cards
NV30: Create framework for memtm
NV50: Improve reg creation,
NV50: Use P.version instead of card codename/stepping,
NVC0: Initial memtiming code for Fermi,
Renamed regs for consistency,
Overall redesign to improve readability,
Avoid kfree on null-pointer

Signed-off-by: Roy Spliet <r.spliet@student.tudelft.nl>
2011-09-20 16:08:25 +10:00
Ben Skeggs 1cb70b30e4 drm/nouveau: remove special-casing of hotplug detection type
If we support PGPIO interrupts, and know a hotplug GPIO tag for a
connector we use HPD, otherwise POLL_CONNECT.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:08:14 +10:00
Ben Skeggs bd57e7fc2e drm/nvd0: no page flipping at the moment
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:08:11 +10:00
Ben Skeggs 64c2502b77 drm/nvc0/gr: remove max tpc count info
Just assume a max of 16 everywhere, and hope it's okay.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:08:08 +10:00
Ben Skeggs e432d48f87 drm/nvd0: lets not attempt to dereference a nv50_display pointer
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:08:02 +10:00
Ken Milmore 658e86ee2d drm/nouveau: enable hwmon support when both nouveau/hwmon are built as modules.
The nouveau hwmon temperature support currently only functions when hwmon is
compiled into the kernel. There's no reason why this shouldn't also work when
both hwmon and nouveau are modularised (as is the case with Slackware's stock
kernels).

Signed-off-by: Ken Milmore <ken.milmore@googlemail.com>
Reviewed-by: Martin Peres <martin.peres@ensi-bourges.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:07:59 +10:00
Ben Skeggs 37b034a64b drm/nvd0/disp: tidy up what we have so far
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:07:49 +10:00
Ben Skeggs ee41779e76 drm/nvd0/disp: rewrite irq handler, should be somewhat sturdier now
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:07:46 +10:00
Ben Skeggs f20ce9629f drm/nvd0/disp: do modeset irq handling from tasklet
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:07:42 +10:00
Ben Skeggs 3b6d83d1b9 drm/nvd0/disp: untested LVDS support
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:07:36 +10:00
Ben Skeggs c6f2f71dae drm/nvd0/disp: track down fb positioning method
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:07:32 +10:00
Ben Skeggs ff8ff50342 drm/nvd0/disp: determine U table config in or_mode_set()
Takes a gamble and presumes that we can safely store something random in
OR_MODE_CTRL+4, the hw doesn't seem to mind...

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:07:29 +10:00
Ben Skeggs b681993f7a drm/nvd0/disp: dac load detect
VBIOS does more than this, as does nv50/nvc0 driver in nouveau.  Traces
of the NVIDIA binary driver however, show pretty much just this being
done...  Seems to work for me, it'll be fine for the moment.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:07:22 +10:00
Ben Skeggs 629c1b9207 drm/nvd0/disp: handle sync polarity, kill off some unknown
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:07:18 +10:00
Ben Skeggs f3fdc52dd7 drm/nvd0/disp: scaling
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:07:15 +10:00
Ben Skeggs a46232ee09 drm/nvd0/disp: push the update button in mode_set_base()
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:07:09 +10:00
Ben Skeggs 8ea0d4aa60 drm/nvd0/disp: fixup clut so it actually works
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:07:05 +10:00
Ben Skeggs 3a89cd0292 drm/nvd0/disp: initial attempt at modeset irq handling
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:07:01 +10:00
Ben Skeggs b6d8e7ec38 drm/nvd0/disp: stub dac load detect, prevents oops
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:06:57 +10:00
Ben Skeggs 8eaa9669f8 drm/nvd0/disp: dac encoder module
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:06:50 +10:00
Ben Skeggs a36f04c044 drm/nvd0/disp: extend the init voodoo to cover crtcs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:06:47 +10:00
Ben Skeggs c0cc92a115 drm/nvd0/disp: remove lp reordering from vram dmaobj, create fb dmaobjs
Fixes CLUT being messed up.  Mostly.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:06:44 +10:00
Ben Skeggs 1d6e7a59f7 drm/nvd0/disp: some magic to make evo happeir
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:06:37 +10:00
Ben Skeggs 2fad3d5e2b drm/nvd0/disp: they moved the linear flag..
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:06:33 +10:00
Ben Skeggs 438d99e3b1 drm/nvd0/disp: initial crtc object implementation
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:06:30 +10:00
Ben Skeggs 270a574780 drm/nvd0/disp: skeletal handling of modeset interrupts
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:06:24 +10:00
Ben Skeggs 83fc083cbb drm/nvd0/disp: start on SOR encoder functions
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:06:21 +10:00
Ben Skeggs efd272a7a0 drm/nvd0/disp: setup a couple of dma objects we'll need
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:06:07 +10:00
Ben Skeggs 4600522a8f drm/nvd0/disp: start on interrupt handling
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:06:01 +10:00
Ben Skeggs 51beb428e4 drm/nvd0/disp: whip up some basic dma handling for the evo channels
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:05:57 +10:00
Ben Skeggs 26f6d88b32 drm/nvd0/disp: very initial evo setup
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:05:54 +10:00
Ben Skeggs 02e4f5877d drm/nouveau/bios: allow passing in crtc to the init table parser
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:05:48 +10:00
Ben Skeggs 4784e4aa47 drm/nvd0/pm: enable clock/voltage hooks
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:05:44 +10:00
Ben Skeggs 75139063b7 drm/nouveau/bios: fix INIT_GPIO for new chipsets
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:05:40 +10:00
Ben Skeggs d7f8172ca9 drm/nvd0/gpio: initial implementation
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:05:36 +10:00
Ben Skeggs eeb3ca12b4 drm/nvd0/i2c: initial implementation
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:05:24 +10:00
Ben Skeggs d9f61c2d28 drm/nouveau: initial chipset description for nvdX chipsets
All the non-stubbed functions should be okay for this chipset, the rest
will be added back as they're figured out.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:05:20 +10:00
Ben Skeggs 03bc9675d3 drm/nouveau: allow modeset module option to select 'headless mode'
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:05:16 +10:00
Ben Skeggs 1575b3646c drm/nouveau: fixup init/fini sequence to deal with no CRTCs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:05:09 +10:00
Ben Skeggs 048a88595a drm/nouveau: make general drm modesetting init common
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:05:04 +10:00
Ben Skeggs 2e9733ff7d drm/nvd0: add a card_type for 0xdX chipsets
These are different enough from 0xcX to justify it, half fermi, half
kepler(??)..

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:04:45 +10:00
Martin Peres f3f2f54e11 drm/nv04/pm: recalibrate timer on nvclk changes
Signed-off-by: Martin Peres <martin.peres@ensi-bourges.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:04:42 +10:00
Ben Skeggs 591b06d73b drm/nouveau/tmr: calibrate for ns timestamps on init
We previously assumed (incorrectly a lot of the time) that PTIMER would
be programmed at a frequency which'd give its 64-bit timestamps in
nanoseconds.

By programming PTIMER ourselves, we avoid this problem.

Reviewed-by: Martin Peres <martin.peres@ensi-bourges.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:04:36 +10:00
Ben Skeggs 16cd399c65 drm/nvc0/gr: unblacklist nvcf acceleration
Reported to be working.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:04:32 +10:00
Ben Skeggs 0b3b5579e1 drm/nouveau: don't complain for disabled timingset entries
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:04:29 +10:00
Ben Skeggs e425e0b339 drm/nvc0/gr: copy GPC mpart config from PFFB
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:04:15 +10:00
Ben Skeggs aa6500964c drm/nvc0/vram: support non-uniform memory size per controller
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-09-20 16:04:11 +10:00