Ben Skeggs [Sat, 29 Oct 2011 01:31:29 +0000 (11:31 +1000)]
drm/nv50/disp: stricter check for evo being active on init
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Tested-by: Martin Peres <martin.peres@labri.fr>
Ben Skeggs [Fri, 28 Oct 2011 12:10:15 +0000 (22:10 +1000)]
drm/nv50/pm: free state struct after setting clocks
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Thu, 27 Oct 2011 02:02:12 +0000 (12:02 +1000)]
drm/nouveau/pm: change volt/fan before upclock, but after downclock
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Thu, 27 Oct 2011 00:28:17 +0000 (10:28 +1000)]
drm/nouveau/pm: remove the older interfaces completely
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Thu, 27 Oct 2011 00:24:12 +0000 (10:24 +1000)]
drm/nv04-nv30/pm: port to newer interfaces
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Tue, 25 Oct 2011 23:11:02 +0000 (09:11 +1000)]
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>
Martin Peres [Thu, 6 Oct 2011 21:47:58 +0000 (23:47 +0200)]
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>
Martin Peres [Sat, 9 Jul 2011 22:08:41 +0000 (00:08 +0200)]
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>
Martin Peres [Fri, 21 Oct 2011 23:40:40 +0000 (01:40 +0200)]
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>
Ben Skeggs [Tue, 25 Oct 2011 06:29:13 +0000 (16:29 +1000)]
drm/nv50/disp: fix scaling of doublescan modes
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Thu, 20 Oct 2011 05:00:22 +0000 (15:00 +1000)]
drm/nv50/disp: rewrite crtc timing calculation, with proper names and fixes
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Thu, 20 Oct 2011 04:25:53 +0000 (14:25 +1000)]
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>
Ben Skeggs [Wed, 19 Oct 2011 03:06:48 +0000 (13:06 +1000)]
drm/nv50/disp: allow interlaced and doublescan modes on digital outputs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Fri, 14 Oct 2011 13:55:47 +0000 (23:55 +1000)]
drm/nouveau: don't pretend to support the DVI-I 'select subconnector' prop
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Mon, 17 Oct 2011 02:23:41 +0000 (12:23 +1000)]
drm/nouveau: improve dithering properties, and implement proper auto mode
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Mon, 17 Oct 2011 00:38:10 +0000 (10:38 +1000)]
drm/nouveau: no need to pass parameters into set_scale/dither
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Mon, 17 Oct 2011 00:24:49 +0000 (10:24 +1000)]
drm/nouveau: determine a value for display_info.bpc if edid doesn't
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Sun, 16 Oct 2011 22:56:09 +0000 (08:56 +1000)]
drm/nv50/disp: wait for encoder disconnect to complete before link training
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Fri, 14 Oct 2011 04:43:20 +0000 (14:43 +1000)]
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>
Ben Skeggs [Fri, 14 Oct 2011 06:19:42 +0000 (16:19 +1000)]
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>
Ben Skeggs [Fri, 14 Oct 2011 06:13:10 +0000 (16:13 +1000)]
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>
Ben Skeggs [Fri, 14 Oct 2011 04:35:19 +0000 (14:35 +1000)]
drm/nv50/disp: move sync routine to where it can be used by other modules
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Maxim Levitsky [Sun, 9 Oct 2011 20:58:34 +0000 (22:58 +0200)]
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>
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>
Maxim Levitsky [Sun, 9 Oct 2011 20:58:33 +0000 (22:58 +0200)]
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>
Maxim Levitsky [Sun, 9 Oct 2011 20:58:32 +0000 (22:58 +0200)]
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>
Ben Skeggs [Thu, 6 Oct 2011 03:29:05 +0000 (13:29 +1000)]
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>
Ben Skeggs [Thu, 6 Oct 2011 02:46:40 +0000 (12:46 +1000)]
drm/nouveau: move master modesetting init to nouveau_display
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Thu, 6 Oct 2011 01:51:45 +0000 (11:51 +1000)]
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>
Ben Skeggs [Wed, 5 Oct 2011 04:59:14 +0000 (14:59 +1000)]
drm/nouveau/hdmi: enable sending of avi/audio infoframes
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Wed, 5 Oct 2011 04:52:02 +0000 (14:52 +1000)]
drm/nouveau/hdmi: add hdmi register accessors to handle hdmi block move
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Wed, 5 Oct 2011 01:05:07 +0000 (11:05 +1000)]
drm/nouveau/hdmi: build ELD from EDID, notify audio driver of its presence
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Tue, 27 Sep 2011 00:31:36 +0000 (10:31 +1000)]
drm/nv50/pm: s/unk05/vdec/
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Fri, 16 Sep 2011 20:38:56 +0000 (06:38 +1000)]
drm/nouveau/pm: remove defunct fanspeed_set/get from pm table
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
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.
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Fri, 16 Sep 2011 16:01:24 +0000 (02:01 +1000)]
drm/nv50/pm: convert to new fanspeed pwm controller hooks
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Fri, 16 Sep 2011 15:42:12 +0000 (01:42 +1000)]
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>
Ben Skeggs [Mon, 12 Sep 2011 19:32:43 +0000 (05:32 +1000)]
drm/nouveau/gpio: remove invert flag, use state[] everywhere
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Mon, 15 Aug 2011 06:13:34 +0000 (16:13 +1000)]
drm/nv50/pm: mostly nailed down fan pwm frequency selection
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
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>
Ben Skeggs [Sun, 14 Aug 2011 02:43:47 +0000 (12:43 +1000)]
drm/nv50/pm: add support for pwm fan control
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Thu, 11 Aug 2011 04:58:06 +0000 (14:58 +1000)]
drm/nouveau/vdec: implement stub modules for the known engines
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Thu, 28 Jul 2011 01:01:21 +0000 (11:01 +1000)]
drm/nouveau/pm: hook up fanspeed get/set if they're present
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Thu, 28 Jul 2011 00:52:13 +0000 (10:52 +1000)]
drm/nv41/pm: implement a second type of fanspeed pwm
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Thu, 28 Jul 2011 00:40:48 +0000 (10:40 +1000)]
drm/nv40/pm: implement first type of pwm fanspeed funcs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Thu, 28 Jul 2011 00:17:40 +0000 (10:17 +1000)]
drm/nv40/pm: parse fan pwm divisor from vbios tables
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
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>
Alex Deucher [Thu, 17 Nov 2011 19:57:50 +0000 (14:57 -0500)]
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>
Alex Deucher [Thu, 17 Nov 2011 19:25:56 +0000 (14:25 -0500)]
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>
Christian König [Thu, 17 Nov 2011 14:22:44 +0000 (15:22 +0100)]
drm/radeon: improve radeon_test_syncing function
Also test multiple waits on the same semaphore.
Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Jerome Glisse [Sun, 20 Nov 2011 20:45:34 +0000 (20:45 +0000)]
drm/radeon: precompute fence cpu/gpu addr once v3
Add a start fence driver helper function which will be call
once for each ring and will compute cpu/gpu addr for fence
depending on wether to use wb buffer or scratch reg.
This patch replace initialize fence driver separately which
was broken in regard of GPU lockup. The fence list for created,
emited, signaled must be initialize once and only from the
asic init callback not from the startup call back which is
call from the gpu reset.
v2: With this in place we no longer need to know the number of
rings in fence_driver_init, also writing to the scratch reg
before knowing its offset is a bad idea.
v3: rebase on top of change to previous patch in the serie
Signed-off-by: Christian König <deathsimple@vodafone.de>
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Christian König [Mon, 24 Oct 2011 15:08:44 +0000 (17:08 +0200)]
drm/radeon: move ring debugfs into radeon_ring.c
Those debugfs files aren't r600 specific, so they
shouldn't be in r600.c. Move them to radeon_ring.c
and also add functionality to dump CP1 & CP2 ring
informations.
Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Christian König [Sun, 23 Oct 2011 10:56:27 +0000 (12:56 +0200)]
drm/radeon: rename struct radeon_cp to radeon_ring
That naming seems to make more sense, since we not
only want to run PM4 rings with it.
Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Christian König [Thu, 20 Oct 2011 10:47:13 +0000 (12:47 +0200)]
drm/radeon: disable compute rings on cayman for now
Disable the additional compute rings on cayman
until their setup is fully implemented.
Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Christian König [Thu, 20 Oct 2011 10:38:09 +0000 (12:38 +0200)]
drm/radeon: add radeon_fence_count_emited function
Split counting of emited fences out of power
management into a seperate function.
Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Christian König [Wed, 19 Oct 2011 17:02:21 +0000 (19:02 +0200)]
drm/radeon: make some asic pointers per ring
Emitting fences, semaphores and ib works differently
on different ring, so its is easier to maintain
separate functions for each ring.
Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Christian König [Tue, 27 Sep 2011 10:31:00 +0000 (12:31 +0200)]
drm/radeon: Add radeon_test_syncing function v2
Tests syncing between all rings by using
semaphores and fences.
v2: use radeon_testing as a bit flag rather than on/off switch
this allow to test for one thing at a time (bo_move or semaphore
test). It kind of break the usage if user wheren't using 1
for bo move test but as it's a test feature i believe it's ok.
Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Christian König [Thu, 13 Oct 2011 11:19:22 +0000 (13:19 +0200)]
drm/radeon: make cp variable an array
Replace cp, cp1 and cp2 members with just an array
of radeon_cp structs.
Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Christian König [Thu, 13 Oct 2011 10:48:45 +0000 (12:48 +0200)]
drm/radeon: make ring rptr and wptr register offsets variable
Every ring seems to have the concept of read and
write pointers. Make the register offset variable
so we can use the functions for different types of rings.
Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Christian König [Fri, 23 Sep 2011 13:11:23 +0000 (15:11 +0200)]
drm/radeon: make all functions work with multiple rings.
Give all asic and radeon_ring_* functions a
radeon_cp parameter, so they know the ring to work with.
Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Christian König [Thu, 15 Sep 2011 17:02:22 +0000 (19:02 +0200)]
drm/radeon/kms: add support for semaphores v3
They are used to sync between rings, while fences
sync between a ring and the cpu.
v2 Fix radeon_semaphore_driver_fini when no semaphore were
allocated.
v3 Initialize list early on to avoid issue in case or early
error
Signed-off-by: Christian König <deathsimple@vodafone.de>
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Alex Deucher [Thu, 25 Aug 2011 17:39:48 +0000 (13:39 -0400)]
drm/radeon/kms: add support for multiple fence queues v2
For supporting multiple CP ring buffers, async DMA
engines and UVD. We still need a way to synchronize
between engines.
v2 initialize unused fence driver ring to avoid issue in
suspend/unload
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Christian König [Mon, 24 Oct 2011 13:05:29 +0000 (15:05 +0200)]
drm/radeon: fix a spelling mistake
Better fix it before this obvious typo spreads even more.
Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Christian König [Mon, 24 Oct 2011 12:59:17 +0000 (14:59 +0200)]
drm/radeon: no need to check all relocs for duplicates
Only check the previously checked relocs for
duplicates. Also leaving the handle uninitialized
isn't such a good idea.
Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Christian König [Mon, 24 Oct 2011 12:54:54 +0000 (14:54 +0200)]
drm/radeon: fix debugfs handling v3
Having registered debugfs files globally causes
the files to not show up on the second, third
etc.. card in the system.
v2: fix crash on module unloading
v3: fix space indentation
Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Alan Cox [Tue, 20 Dec 2011 15:58:44 +0000 (15:58 +0000)]
gma500/oaktrail: panel display quality fix
The GCT setup was used on Moorestown. The Oaktrail version uses a normal PC
interface. That means we must also honour the dither info from the BIOS
data.
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Alan Cox [Tue, 20 Dec 2011 15:58:29 +0000 (15:58 +0000)]
gma500: Oaktrail fixes
The move to connectors breaks Oaktrail again if we have memory poisoning
enabled. Fix this.
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Tue, 20 Dec 2011 14:43:53 +0000 (14:43 +0000)]
Merge tag 'v3.2-rc6' of /home/airlied/devel/kernel/linux-2.6 into drm-core-next
Merge in the upstream tree to bring in the mainline fixes.
Conflicts:
drivers/gpu/drm/exynos/exynos_drm_fbdev.c
drivers/gpu/drm/nouveau/nouveau_sgdma.c
Alan Cox [Mon, 19 Dec 2011 21:06:35 +0000 (21:06 +0000)]
gma500: Final enables for Oaktrail
This switches the ifdef to match the Kconfig so that Oaktrail probing occurs
and adds some additional minor bulletproofing.
Tested on a Fujtisu Stylistic Q550 internal display. HDMI might work but that
remains to be seen.
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Patrik Jakobsson [Mon, 19 Dec 2011 21:41:45 +0000 (21:41 +0000)]
gma500: SDVO DDC bus guessing isn't working so hardcode it instead
We currently don't have support for parsing SDVO mappings from BIOS so we're
guessing the bus switch parameter. This isn't working so hardcode it to a
configuration known to work on most poulsbo hardware.
Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Patrik Jakobsson [Mon, 19 Dec 2011 21:41:33 +0000 (21:41 +0000)]
gma500: Convert Oaktrail to work with new output handling
Replace psb_intel_output with psb_intel_encoder and psb_intel_connector
Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
[Changed Moorestown reference to Oaktrail]
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Patrik Jakobsson [Mon, 19 Dec 2011 21:41:22 +0000 (21:41 +0000)]
gma500: Convert Cedarview to work with new output handling
Replace psb_intel_output with psb_intel_encoder and psb_intel_connector.
Things will need to be cleaned up and tested so consider this an initial
patch for Cedarview.
Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Patrik Jakobsson [Mon, 19 Dec 2011 21:41:10 +0000 (21:41 +0000)]
gma500: Replace SDVO code with slightly modified version from i915
Our current SDVO implementation is not working properly, so replace it with
a modified version of the i915. Further testing and debugging is needed to make
sure we can handle the different SDVO setups and wiring.
Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Patrik Jakobsson [Mon, 19 Dec 2011 21:40:58 +0000 (21:40 +0000)]
gma500: Add support for Intel GMBUS
Before we integrate the new SDVO code we need GMBUS support
Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Patrik Jakobsson [Mon, 19 Dec 2011 21:40:45 +0000 (21:40 +0000)]
gma500: Convert PSB LVDS to new output handling
LVDS for PSB now uses psb_intel_encoder and psb_intel_connectors instead of
psb_intel_output. i2c_bus and ddc_bus are moved to lvds_priv. There was also a
pointer to mode_dev (for no obvious reason) that we now get directly from
dev_priv.
Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Patrik Jakobsson [Mon, 19 Dec 2011 21:40:33 +0000 (21:40 +0000)]
gma500: Fix encoder type checking for connectors
Fix cases where we need to know what encoder type is behind a given connector.
Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Patrik Jakobsson [Mon, 19 Dec 2011 21:40:05 +0000 (21:40 +0000)]
gma500: Remove psb_intel_output from ddc_probe and ddc_get_modes
Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Patrik Jakobsson [Mon, 19 Dec 2011 21:39:53 +0000 (21:39 +0000)]
gma500: Initial support for our encoder and connector structs
First step towards adding i915 alike encoder and connector abstractions. This
will make life easier when adding i915 output code into our driver. It also
removes the old psb_intel_output struct.
Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Tue, 20 Dec 2011 10:22:18 +0000 (10:22 +0000)]
staging/gma500: fixup staging code to build following core changes.
This just fixes up the staging code to keep building.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Ville Syrjälä [Mon, 19 Dec 2011 22:06:49 +0000 (00:06 +0200)]
drm: Replace pitch with pitches[] in drm_framebuffer
Otherwise each driver would need to keep the information inside
their own framebuffer object structure. Also add offsets[]. BOs
on the other hand are driver specific, so those can be kept in
driver specific structures.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Ville Syrjälä [Mon, 19 Dec 2011 22:06:48 +0000 (00:06 +0200)]
drm: Check that the requested pixel format is valid
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Ville Syrjälä [Mon, 19 Dec 2011 22:06:47 +0000 (00:06 +0200)]
drm: plane: Check that the fb pixel format is supported by the plane
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Ville Syrjälä [Mon, 19 Dec 2011 22:06:46 +0000 (00:06 +0200)]
drm: plane: Make 'formats' parameter to drm_plane_init() const
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Ville Syrjälä [Mon, 19 Dec 2011 22:06:45 +0000 (00:06 +0200)]
drm: plane: Check crtc coordinates against integer overflows in setplane ioctl
Help drivers a little by guaranteeing that crtc_x+crtc_w and
crtc_y+crtc_h don't overflow.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Ville Syrjälä [Mon, 19 Dec 2011 22:06:44 +0000 (00:06 +0200)]
drm: plane: Check source coordinates
Make sure the source coordinates stay within the buffer.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Ville Syrjälä [Mon, 19 Dec 2011 22:06:43 +0000 (00:06 +0200)]
drm: plane: Clear plane.crtc and plane.fb after disable_plane()
These are the only indication to user space that the plane was disabled.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Ville Syrjälä [Mon, 19 Dec 2011 22:06:42 +0000 (00:06 +0200)]
drm: Fix __user sparse warnings
Several pointers and casts were missing __user annotations.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Ville Syrjälä [Mon, 19 Dec 2011 22:06:41 +0000 (00:06 +0200)]
drm: plane: mutex_unlock() was missing
Unlock the mode_config mutex if drm_plane_init() fails.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Ville Syrjälä [Mon, 19 Dec 2011 22:06:40 +0000 (00:06 +0200)]
drm: fourcc: Use __u32 instead of u32
drm_fourcc.h can be included from user space so use the appropriate types.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Ville Syrjälä [Mon, 19 Dec 2011 22:06:39 +0000 (00:06 +0200)]
drm: Install drm_fourcc.h
Userspace needs this header.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Ville Syrjälä [Mon, 19 Dec 2011 22:06:38 +0000 (00:06 +0200)]
drm: Add a missing ')'
The code happened to compile because the flag wasn't actually used yet.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Christian Schmidt [Mon, 19 Dec 2011 19:03:33 +0000 (20:03 +0100)]
drm/intel: Fix initialization if startup happens in interlaced mode [v2]
My EFI BIOS starts the graphics card up in my projector's preferred EDID
mode, 1080@60i. The Intel driver does not clear all the interlaced bits.
This patch introduces a new PIPECONF_INTERLACE_MASK define and uses it
to restore progressive mode.
Signed-of-by: Christian Schmidt <schmidt@digadd.de>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Christian Schmidt [Mon, 19 Dec 2011 19:03:43 +0000 (20:03 +0100)]
Fix wrong assumptions in cea_for_each_detailed_block v2
The current logic misunderstands the spec about CEA 18byte descriptors.
First, the spec doesn't state "detailed timing descriptors" but "18 byte
descriptors", so any data record could be stored, mixed timings and
other data, just as in the standard EDID.
Second, the lower four bit of byte 3 of the CEA record do not contain
the number of descriptors, but "the total number of DTDs defining native
formats in the whole EDID [...], starting with the first DTD in the DTD
list (which starts in the base EDID block)." A device can of course
support non-native formats.
As such the number can't be used to determine n, and the existing code
will filter non-timing 18byte descriptors anyway.
Signed-off-by: Christian Schmidt <schmidt@digadd.de>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Christian Schmidt [Mon, 19 Dec 2011 19:03:38 +0000 (20:03 +0100)]
drm_edid_to_eld: check for CEA data blocks only from structure revision 3 on
CEA datablocks are only defined from revision 3 onwards. Only check for
them if the revision says so.
Signed-of-by: Christian Schmidt <schmidt@digadd.de>
Tested-by: James Cloos <cloos@jhcloos.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Christian Schmidt [Mon, 19 Dec 2011 14:53:16 +0000 (14:53 +0000)]
drm/edid: support CEA video modes.
TFT/plasma televisions and projectors have become commonplace, and so
has the use of PCs to drive them. Add the video modes specified by an
EDID's CEA extension to the mode database for a connector.
Before:
[ 1.158869] [drm:drm_mode_debug_printmodeline], Modeline
19:"1920x1080i" 0 74250 1920 2448 2492 2640 1080 1084 1094 1125 0x40 0x15
[ 1.158875] [drm:drm_mode_debug_printmodeline], Modeline
18:"1920x1080i" 0 74250 1920 2008 2052 2200 1080 1084 1094 1125 0x48 0x15
[ 1.158882] [drm:drm_mode_debug_printmodeline], Modeline
20:"1920x1080" 24 74250 1920 2558 2602 2750 1080 1084 1089 1125 0x40 0x5
After:
[ 1.144175] [drm:drm_mode_debug_printmodeline], Modeline
22:"1920x1080" 0 74250 1920 2448 2492 2640 1080 1084 1094 1125 0x40 0x15
[ 1.144179] [drm:drm_mode_debug_printmodeline], Modeline
21:"1920x1080" 0 74250 1920 2008 2052 2200 1080 1084 1094 1125 0x48 0x15
[ 1.144187] [drm:drm_mode_debug_printmodeline], Modeline
30:"1920x1080" 50 148500 1920 2448 2492 2640 1080 1084 1089 1125 0x40 0x5
[ 1.144190] [drm:drm_mode_debug_printmodeline], Modeline
29:"1920x1080" 60 148500 1920 2008 2052 2200 1080 1084 1089 1125 0x40 0x5
[ 1.144192] [drm:drm_mode_debug_printmodeline], Modeline
25:"1920x1080" 24 74250 1920 2558 2602 2750 1080 1084 1089 1125 0x40 0x5
[ 1.144195] [drm:drm_mode_debug_printmodeline], Modeline
24:"1280x720" 50 74250 1280 1720 1760 1980 720 725 730 750 0x40 0x5
[ 1.144198] [drm:drm_mode_debug_printmodeline], Modeline
23:"1280x720" 60 74250 1280 1390 1430 1650 720 725 730 750 0x40 0x5
[ 1.144201] [drm:drm_mode_debug_printmodeline], Modeline 27:"720x576"
50 27000 720 732 796 864 576 581 586 625 0x40 0xa
[ 1.144203] [drm:drm_mode_debug_printmodeline], Modeline 26:"720x480"
60 27000 720 736 798 858 480 489 495 525 0x40 0xa
[ 1.144206] [drm:drm_mode_debug_printmodeline], Modeline 28:"640x480"
60 25175 640 656 752 800 480 490 492 525 0x40 0xa
Signed-off-by: Christian Schmidt <schmidt@digadd.de>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>