Commit Graph

5621 Commits

Author SHA1 Message Date
Ben Skeggs
ff2b6c6e58 drm/nouveau/pm: remove the older interfaces completely
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:25 +10:00
Ben Skeggs
36f1317ed0 drm/nv04-nv30/pm: port to newer interfaces
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:24 +10:00
Ben Skeggs
f3fbaf34e2 drm/nv50/pm: rewrite clock management, and switch to the new pm hooks
This area is horrifically complicated on these chipsets, and it's likely we
will need at least a few more tweaks yet.

Oh yes, and it's completely disabled on IGPs for the moment.  From traces,
things look potentially different there yet again.  Sigh...

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:24 +10:00
Martin Peres
d4cca9e1fc drm/nv50/pm: s/PLL_UNK05/PLL_VDEC/
Following to "drm/nv50/pm: s/unk05/vdec/", let's rename the PLL to PLL_VDEC

PLL names are purely indicative and are based on the most important engine
it clocks.

Signed-off-by: Martin Peres <martin.peres@labri.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:24 +10:00
Martin Peres
dd1da8de17 drm/nouveau/pm: make clocks_set return an error code clocks_set can fail.
Reporting an error is better than silently refusing to reclock.

V2: Use the same logic on nv40

Signed-off-by: Martin Peres <martin.peres@labri.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:23 +10:00
Martin Peres
6109183794 drm/nvd0: read temperature as we did on nv84+ boards
Signed-off-by: Martin Peres <martin.peres@labri.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:23 +10:00
Ben Skeggs
1cb9469ee7 drm/nv50/disp: fix scaling of doublescan modes
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:23 +10:00
Ben Skeggs
616a5f57b6 drm/nv50/disp: rewrite crtc timing calculation, with proper names and fixes
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:22 +10:00
Ben Skeggs
a03a8623ad drm/nouveau/disp: kill off nouveau_crtc.mode
This hasn't been necessary for a long time now..

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:22 +10:00
Ben Skeggs
c833442306 drm/nv50/disp: allow interlaced and doublescan modes on digital outputs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:22 +10:00
Ben Skeggs
4ceca5f864 drm/nouveau: don't pretend to support the DVI-I 'select subconnector' prop
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:21 +10:00
Ben Skeggs
de69185573 drm/nouveau: improve dithering properties, and implement proper auto mode
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:21 +10:00
Ben Skeggs
488ff207f9 drm/nouveau: no need to pass parameters into set_scale/dither
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:20 +10:00
Ben Skeggs
6322175530 drm/nouveau: determine a value for display_info.bpc if edid doesn't
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:20 +10:00
Ben Skeggs
9976f15c27 drm/nv50/disp: wait for encoder disconnect to complete before link training
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:20 +10:00
Ben Skeggs
7ae494e80c drm/nv50/disp: disconnect encoders before reprogramming them
Fixes a case where we don't get separate supervisor interrupt sequences for
disconnect and modeset events.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:19 +10:00
Ben Skeggs
0f6ea564de drm/nv50/disp: completely reset disp if master evo channel active at init
Should fix issues with kexec, and as a nice side bonus, the code to avoid
having PDISP disappear will also fix hibernate on those effected systems.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:19 +10:00
Ben Skeggs
b98e3f5c9e drm/nv50/disp: synchronise display right after init
This has the effect of ensuring the encoders which were active before we
loaded get disconnected properly before we start reprogramming them.

Also removing a bit of cargo-cult from the initial evo pushbuf.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:18 +10:00
Ben Skeggs
e6e039d10d drm/nv50/disp: move sync routine to where it can be used by other modules
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:18 +10:00
Maxim Levitsky
a4eaa0a042 drm/nouveau: restore cursors after restoring mode
PDISP doesn't like it when disabled CRTCs are poked.

Fixes external output not coming to life when it has cursor on.
https://bugs.freedesktop.org/show_bug.cgi?id=41608

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:18 +10:00
Maxim Levitsky
71d91f655e drm/nouveau: restore performance mode a bit later.
Otherwice code that responsible for idling the card can't work.
BIOS init tables are supposed to init the clocks to correct values,
so that shouldn't cause any problems (we don't reclock by default anyway)

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:17 +10:00
Maxim Levitsky
4bfb94a1b4 drm/nouveau: disable output polling through suspend.
Because doing polling while hardware is disabled is a bad idea...

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:17 +10:00
Maxim Levitsky
c983e6f660 drm/nv50: also report errors in MP1/MP2 when they happen.
Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:17 +10:00
Ben Skeggs
b29caa5885 drm/nouveau: add overscan compensation connector properties
Exposes the same connector properties as the Radeon implementation, however
their behaviour isn't exactly the same.  The primary difference being that
unless both hborder/vborder have been defined by the user, the driver will
keep the aspect ratio of the overscanned area the same as the mode the
display is programmed for.

Enabled for digital outputs on GeForce 8 and up, excluding GF119.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:16 +10:00
Ben Skeggs
27d5030a23 drm/nouveau: move master modesetting init to nouveau_display
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:16 +10:00
Ben Skeggs
549cd872b0 drm/nv50/crtc: disable flip overlay around scaling mode changes
Prevents EVO getting all angry at us.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:15 +10:00
Ben Skeggs
b2337f2333 drm/nouveau/hdmi: enable sending of avi/audio infoframes
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:15 +10:00
Ben Skeggs
52c7bcdb67 drm/nouveau/hdmi: add hdmi register accessors to handle hdmi block move
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:14 +10:00
Ben Skeggs
25575b414c drm/nouveau/hdmi: build ELD from EDID, notify audio driver of its presence
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:14 +10:00
Ben Skeggs
35bb5089cc drm/nv50/pm: s/unk05/vdec/
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:13 +10:00
Ben Skeggs
1e05415733 drm/nouveau/pm: remove defunct fanspeed_set/get from pm table
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:13 +10:00
Ben Skeggs
6934618014 drm/nv40/pm: convert to new pwm hooks, also fixing pwm type detection
A NV49 appeared a while back that was using the "nv41 style" pwm registers,
rather than the "nv40 style" ones my board is using.  This disproves the
previous theory that the pwm controller choice is chipset-specific.

So, after looking at a bunch of vbios images it appears that the next viable
theory is that we should select the pwm controller to use based on the gpio
line the fan is tied to, just like we do on nv50.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:13 +10:00
Ben Skeggs
5a4267ab14 drm/nv50/pm: convert to new fanspeed pwm controller hooks
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:12 +10:00
Ben Skeggs
a175094cd8 drm/nouveau/pm: introduce generic handler for on-chip fan controller
The handling of the internal pwm fan controller is similar enough between
current chipsets that it makes sense to share the logic, and bugfixes :)

No hw backends converted yet, will automatically fall-through to the
"old" per-chipset fanspeed hooks for now.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:12 +10:00
Ben Skeggs
85a2a36521 drm/nouveau/gpio: remove invert flag, use state[] everywhere
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:12 +10:00
Ben Skeggs
3f8e11e4b6 drm/nv50/pm: mostly nailed down fan pwm frequency selection
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:11 +10:00
Martin Peres
11b7d89521 drm/nouveau/pm: manual pwm fanspeed management for nv40+ boards
Exposes the following sysfs entries:
- fan0_input: read the rotational speed of the fan (poll a bit during 250ms)
- pwm0: set the pwm duty cycle
- pwm0_min/max: set the minimum/maximum pwm value

v2 (Ben Skeggs):
- nv50 pwm controller code removed in favour of other more complete code
- FAN_RPM -> FAN_SENSE
- merged FAN_SENSE readout into common code, not at all nv50-specific
- protected fanspeed changes with perflvl_wr
- formatting tidying
- added some comments where things are shaky

v3 (Martin Peres)
- ensure duty min/max from thermal table are sane

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Martin Peres <martin.peres@ensi-bourges.fr>
2011-12-21 19:01:11 +10:00
Ben Skeggs
cb9fa62671 drm/nv50/pm: add support for pwm fan control
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:11 +10:00
Ben Skeggs
8f27c54342 drm/nouveau/vdec: implement stub modules for the known engines
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:10 +10:00
Ben Skeggs
771e1035b9 drm/nouveau/pm: hook up fanspeed get/set if they're present
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:10 +10:00
Ben Skeggs
04de6a0461 drm/nv41/pm: implement a second type of fanspeed pwm
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:10 +10:00
Ben Skeggs
9232969e19 drm/nv40/pm: implement first type of pwm fanspeed funcs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:09 +10:00
Ben Skeggs
0c101461e2 drm/nv40/pm: parse fan pwm divisor from vbios tables
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2011-12-21 19:01:09 +10:00
Ville Syrjälä
d0d110e096 drm: Add drm_format_num_planes() utility function
This function returns the number of planes used by a specific pixel
format.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Rob Clark <rob.clark@linaro.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-20 20:34:32 +00:00
Rob Clark
c75488376a drm: call connector dpms fxn, when setting config
Call connector->funcs->dpms(DPMS_ON) rather than just setting
connector->dpms = DPMS_ON.  This ensures that if the connector
has something to do to enable the output (rather than just using
drm_helper_connector_dpms helper directly), that this happens
at bootup.  This solves an issue with connectors not getting
enabled from fbcon_init() when the driver is loaded.

Signed-off-by: Rob Clark <rob@ti.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-20 20:27:25 +00:00
Dave Airlie
06e4cd6417 drm/radeon/kms: don't use 0 bpc for adjusting hdmi clock
If the bpc is set from the connector is 0, we then use it later to adjust
in a special case the HDMI pixel clock, however if the bpc is 0, we end up
passing a 0 pixel clock into the code.

I'm not sure if this is the correct answer or if we should avoid the HDMI
clock adjustment for 0 values.

This fixes a divide by 0 on my Llano system with a HDMI monitor and hdmi
audio enabled.

Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-20 19:58:27 +00:00
Jerome Glisse
b15ba51207 drm/radeon: introduce a sub allocator and convert ib pool to it v4
Somewhat specializaed sub-allocator designed to perform sub-allocation
for command buffer not only for current cs ioctl but for future command
submission ioctl as well. Patch also convert current ib pool to use
the sub allocator. Idea is that ib poll buffer can be share with other
command buffer submission not having 64K granularity.

v2 Harmonize pool handling and add suspend/resume callback to pin/unpin
sa bo (tested on rv280, rv370, r420, rv515, rv610, rv710, redwood, cayman,
rs480, rs690, rs880)
v3 Simplify allocator
v4 Fix radeon_ib_get error path to properly free fence

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-20 19:52:12 +00:00
Alex Deucher
1b37078b7d drm/radeon/kms: add support for per-ring fence interrupts
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Christian König <deathsimple@vodafone.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-20 19:52:03 +00:00
Alex Deucher
b40e7e1608 drm/radeon/kms: add cayman specific fence_ring_emit
cayman is wb only and doesn't have a VC.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Christian König <deathsimple@vodafone.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-20 19:51:54 +00:00
Alex Deucher
78c5560a08 drm/radeon/kms: add some new ring params to better handle other ring types
Some rptr/wptrs fields have different offsets and not all rings are pm4
so add a new nop field.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Christian König <deathsimple@vodafone.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2011-12-20 19:51:46 +00:00