More work needs to be done on supporting the different memory types.
v2 (Ben Skeggs):
- fixed up conflicts from not having pausing patch first
- restructured code somewhat to fit with how all the other code works
- fixed bug where incorrect mpll_ctrl could get set sometimes
- removed stuff that's cargo-culted from the binary driver
- merged nv92+ display disable into hwsq
- fixed incorrect opcode 0x5f magic at end of ucode
Signed-off-by: Martin Peres <martin.peres@ensi-bourges.fr> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Wed, 12 Oct 2011 06:36:42 +0000 (16:36 +1000)]
drm/nouveau/mxm: initial implementation of dcb sanitisation
The DCB table provided by the VBIOS on most MXM chips has a number of
entries which either need to be disabled, or modified according to the
MXM-SIS Output Device Descriptors.
The x86 vbios code usually takes care of this for us, however, with the
large number of laptops now with switchable graphics or optimus, a lot
of the time nouveau is responsible for POSTing the card instead - leaving
some fun situations like, plugging in a monitor and having nouveau decide
3 connectors actually just got plugged in..
Ben Skeggs [Fri, 18 Nov 2011 00:23:59 +0000 (10:23 +1000)]
drm/nouveau/disp: parse connector info directly in nouveau_connector.c
Another case where we parsed vbios data to some structs, then again use
that info once to construct another set of data. Skip the intermediate
step.
This is also slightly improved in that we can now use DCB 3.x connector
table info, which will allow NV4x to gain hotplug support, and to make
quirks for SPWG LVDS panels unnecessary.
Ben Skeggs [Wed, 21 Dec 2011 08:09:12 +0000 (18:09 +1000)]
drm/nouveau/i2c: handle bit-banging ourselves
i2c-algo-bit doesn't actually work very well on one card I have access to
(NVS 300), random single-bit errors occur most of the time - what we're
doing now is closer to what xf86i2c.c does.
The original plan was to figure out why i2c-algo-bit fails on the NVS 300,
and fix it. However, while investigating I discovered i2c-algo-bit calls
cond_resched(), which makes it a bad idea for us to be using as we execute
VBIOS scripts from a tasklet, and there may very well be i2c transfers as
a result.
So, since I already wrote this code in userspace to track down the NVS 300
bug, and it's not really much code - lets use it.
Ben Skeggs [Thu, 17 Nov 2011 03:56:14 +0000 (13:56 +1000)]
drm/nouveau/i2c: tidy up bit-bang helpers, also fixing nv50 setsda bug
Was using nv_mask, which is bad. Reading the reg senses the current line
states, which aren't necessarily the states we're trying to drive the
lines to.
Fixed to store SCL driver state just as we already do for SDA.
Ben Skeggs [Fri, 11 Nov 2011 00:22:19 +0000 (10:22 +1000)]
drm/nouveau/i2c: do parsing of i2c-related vbios info in nouveau_i2c.c
Not much point parsing the vbios data into a struct which is only used once
to parse the data into another struct, go directly from vbios to
nouveau_i2c_chan.
Ben Skeggs [Thu, 10 Nov 2011 05:42:55 +0000 (15:42 +1000)]
drm/nouveau/bios: start refactoring dcb routines
This primary reason for this was mostly to avoid duplication of some of
this stuff by the MXM-SIS parser. However, some other cleanups will also
follow this as a result.
Maxim Levitsky [Sun, 9 Oct 2011 20:58:35 +0000 (22:58 +0200)]
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>
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.
Ben Skeggs [Fri, 16 Sep 2011 16:11:39 +0000 (02:11 +1000)]
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.
Martin Peres [Mon, 15 Aug 2011 01:10:30 +0000 (11:10 +1000)]
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>
Ville Syrjälä [Mon, 19 Dec 2011 22:33:24 +0000 (00:33 +0200)]
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>
Rob Clark [Thu, 15 Dec 2011 20:53:24 +0000 (14:53 -0600)]
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>
Dave Airlie [Tue, 20 Dec 2011 11:44:30 +0000 (11:44 +0000)]
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>
Dave Airlie [Tue, 20 Dec 2011 19:53:44 +0000 (19:53 +0000)]
Merge branch 'drm-radeon-next' of ../drm-radeon-next into drm-core-next
* 'drm-radeon-next' of ../drm-radeon-next:
drm/radeon: introduce a sub allocator and convert ib pool to it v4
drm/radeon/kms: add support for per-ring fence interrupts
drm/radeon/kms: add cayman specific fence_ring_emit
drm/radeon/kms: add some new ring params to better handle other ring types
drm/radeon: improve radeon_test_syncing function
drm/radeon: precompute fence cpu/gpu addr once v3
drm/radeon: move ring debugfs into radeon_ring.c
drm/radeon: rename struct radeon_cp to radeon_ring
drm/radeon: disable compute rings on cayman for now
drm/radeon: add radeon_fence_count_emited function
drm/radeon: make some asic pointers per ring
drm/radeon: Add radeon_test_syncing function v2
drm/radeon: make cp variable an array
drm/radeon: make ring rptr and wptr register offsets variable
drm/radeon: make all functions work with multiple rings.
drm/radeon/kms: add support for semaphores v3
drm/radeon/kms: add support for multiple fence queues v2
drm/radeon: fix a spelling mistake
drm/radeon: no need to check all relocs for duplicates
drm/radeon: fix debugfs handling v3
Jerome Glisse [Tue, 15 Nov 2011 16:48:34 +0000 (11:48 -0500)]
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>
Alex Deucher [Fri, 18 Nov 2011 01:13:28 +0000 (20:13 -0500)]
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>