GitHub/LineageOS/android_kernel_motorola_exynos9610.git
14 years agodrm/radeon/kms: suppress a build warning (unused variable)
Stefan Richter [Wed, 26 May 2010 00:27:44 +0000 (10:27 +1000)]
drm/radeon/kms: suppress a build warning (unused variable)

At least 'make CONFIG_DEBUG_SECTION_MISMATCH=y' causes
drivers/gpu/drm/radeon/atombios_crtc.c: In function 'atombios_crtc_set_pll':
drivers/gpu/drm/radeon/atombios_crtc.c:684: warning: 'pll' may be used uninitialized in this function
which has the looks of a falso positive.

Add a default: case so that gcc rests assured that all possible pll_id's are covered.
Keep the present cases that fall through to the default one for self-documentation.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm: Fixes linux-next & linux-2.6 checkstack warnings:
Prarit Bhargava [Mon, 24 May 2010 00:24:07 +0000 (10:24 +1000)]
drm: Fixes linux-next & linux-2.6 checkstack warnings:

drivers/gpu/drm/nouveau/nv40_graph.c: In function `nv40_graph_init':
drivers/gpu/drm/nouveau/nv40_graph.c:400: warning: the frame size of 1184 bytes is larger than 1024 bytes
drivers/gpu/drm/radeon/radeon_atombios.c: In function `radeon_get_atom_connector_info_from_supported_devices_table':
drivers/gpu/drm/radeon/radeon_atombios.c:857: warning: the frame size of 1872 bytes is larger than 1024 bytes

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agonouveau: fix acpi_lid_open undefined
Randy Dunlap [Mon, 24 May 2010 00:00:40 +0000 (17:00 -0700)]
nouveau: fix acpi_lid_open undefined

When CONFIG_ACPI_BUTTON=m (and probably when ACPI_BUTTON is not enabled)
and NOUVEAU is built-in (not as a loadable module):

nouveau_connector.c:(.text+0xe17ce): undefined reference to `acpi_lid_open'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Acked-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms: release AGP bridge at suspend
Jerome Glisse [Fri, 21 May 2010 16:48:54 +0000 (18:48 +0200)]
drm/radeon/kms: release AGP bridge at suspend

I think it's good to release the AGP bridge at suspend
and reacquire it at resume. Also fix :
https://bugzilla.kernel.org/show_bug.cgi?id=15969

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Cc: stable <stable@kernel.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms/pm/r600: select the mid clock mode for single head low profile
Alex Deucher [Thu, 20 May 2010 22:44:49 +0000 (18:44 -0400)]
drm/radeon/kms/pm/r600: select the mid clock mode for single head low profile

This saves some more power at the expense of performance.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agoMerge remote branch 'nouveau/for-airlied' into drm-next
Dave Airlie [Fri, 21 May 2010 05:44:32 +0000 (15:44 +1000)]
Merge remote branch 'nouveau/for-airlied' into drm-next

* nouveau/for-airlied:
  drm/nouveau: fix i2c-related init table handlers
  drm/nouveau: support init table i2c device identifier 0x81
  drm/nouveau: ensure we've parsed i2c table entry for INIT_*I2C* handlers
  drm/nouveau: display error message for any failed init table opcode
  drm/nouveau: fix init table handlers to return proper error codes
  drm/nv50: support fractional feedback divider on newer chips
  drm/nv50: fix monitor detection on certain chipsets
  drm/nv50: store full dcb i2c entry from vbios
  drm/nv50: fix suspend/resume with DP outputs
  drm/nv50: output calculated crtc pll when debugging on
  drm/nouveau: dump pll limits entries when debugging is on
  drm/nouveau: bios parser fixes for eDP boards
  drm/nouveau: fix a nouveau_bo dereference after it's been destroyed
  drm/nv40: remove some completed ctxprog TODOs
  drm/nv04: Implement missing nv04 PGRAPH methods in software.
  drm/nouveau: Use 0x5f instead of 0x9f as imageblit on original NV10.

14 years agodrm/radeon: fix power supply kconfig interaction.
Dave Airlie [Fri, 21 May 2010 05:41:20 +0000 (15:41 +1000)]
drm/radeon: fix power supply kconfig interaction.

radeon needs power supply to get correct PM info so select it at the radeon
level not at the kms option.

Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms: record object that have been list reserved
Jerome Glisse [Wed, 19 May 2010 14:05:50 +0000 (16:05 +0200)]
drm/radeon/kms: record object that have been list reserved

list reservation was too optimistic about ttm object reservation
and could think that an object reserved by some other process
as reserved by the list reservation which was false. Thus when
unreserving the list it might unreserve object that it didn't
reserved in the list. Sorry if it's hard to follow but this
kind of things are just causing headheck.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon: AGP memory is only I/O if the aperture can be mapped by the CPU.
Michel Dänzer [Wed, 19 May 2010 10:46:22 +0000 (12:46 +0200)]
drm/radeon: AGP memory is only I/O if the aperture can be mapped by the CPU.

Fixes AGP initialization failure with Apple UniNorth bridges due to trying to
ioremap() normal RAM.

Signed-off-by: Michel Dänzer <daenzer@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms: don't default display priority to high on rs4xx
Alex Deucher [Thu, 20 May 2010 15:26:11 +0000 (11:26 -0400)]
drm/radeon/kms: don't default display priority to high on rs4xx

Seems to cause issues with the sound hardware.  Fixes kernel
bug 15982:
https://bugzilla.kernel.org/show_bug.cgi?id=15982

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/edid: fix typo in 1600x1200@75 mode
Alex Deucher [Wed, 19 May 2010 15:43:40 +0000 (11:43 -0400)]
drm/edid: fix typo in 1600x1200@75 mode

Spotted by Scott Bertilson.
Fixes fdo bug 28146.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Reviewed-by: Mark Marshall <mark.marshall@csr.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/nouveau: fix i2c-related init table handlers
Ben Skeggs [Wed, 12 May 2010 06:30:50 +0000 (16:30 +1000)]
drm/nouveau: fix i2c-related init table handlers

Mutliple issues.  INIT_ZM_I2C_BYTE/INIT_I2C_BYTE didn't even try and
use the register value, and all the handlers were using the wrong
slave address.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: support init table i2c device identifier 0x81
Ben Skeggs [Wed, 12 May 2010 04:45:04 +0000 (14:45 +1000)]
drm/nouveau: support init table i2c device identifier 0x81

It appears to be meant to reference the second "default index".

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: ensure we've parsed i2c table entry for INIT_*I2C* handlers
Ben Skeggs [Wed, 12 May 2010 04:38:25 +0000 (14:38 +1000)]
drm/nouveau: ensure we've parsed i2c table entry for INIT_*I2C* handlers

We may not have parsed the entry yet if the i2c_index is for an i2c bus
that's not referenced by a DCB encoder.

This could be done oh so much more nicely, except we have to care about
prehistoric DCB tables too, and they make life painful.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: display error message for any failed init table opcode
Ben Skeggs [Mon, 10 May 2010 06:59:42 +0000 (16:59 +1000)]
drm/nouveau: display error message for any failed init table opcode

Some handlers don't report specific errors, but we still *really* want to
know if we failed to parse a complete init table.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: fix init table handlers to return proper error codes
Ben Skeggs [Mon, 10 May 2010 06:54:23 +0000 (16:54 +1000)]
drm/nouveau: fix init table handlers to return proper error codes

We really want to be able to distinguish between INIT_DONE and an actual
error sometimes.  This commit fixes up several lazy "return 0;" to be
actual error codes, and explicitly reserves "0" as "success, but stop
parsing this table".

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nv50: support fractional feedback divider on newer chips
Ben Skeggs [Wed, 28 Apr 2010 04:07:06 +0000 (14:07 +1000)]
drm/nv50: support fractional feedback divider on newer chips

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nv50: fix monitor detection on certain chipsets
Ben Skeggs [Fri, 23 Apr 2010 17:53:14 +0000 (03:53 +1000)]
drm/nv50: fix monitor detection on certain chipsets

There appears to be some kind of switch on certain chips to control whether
the DP auxch or traditional i2c bus will be operational on a connector,
this commit hopefully fixes nouveau to do the right thing.

Likely only relevent on chips with DP outputs.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nv50: store full dcb i2c entry from vbios
Ben Skeggs [Fri, 23 Apr 2010 17:05:56 +0000 (03:05 +1000)]
drm/nv50: store full dcb i2c entry from vbios

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nv50: fix suspend/resume with DP outputs
Ben Skeggs [Thu, 22 Apr 2010 22:21:48 +0000 (08:21 +1000)]
drm/nv50: fix suspend/resume with DP outputs

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nv50: output calculated crtc pll when debugging on
Ben Skeggs [Thu, 22 Apr 2010 17:53:42 +0000 (03:53 +1000)]
drm/nv50: output calculated crtc pll when debugging on

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: dump pll limits entries when debugging is on
Ben Skeggs [Thu, 22 Apr 2010 17:08:02 +0000 (03:08 +1000)]
drm/nouveau: dump pll limits entries when debugging is on

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: bios parser fixes for eDP boards
Ben Skeggs [Mon, 19 Apr 2010 16:28:37 +0000 (02:28 +1000)]
drm/nouveau: bios parser fixes for eDP boards

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: fix a nouveau_bo dereference after it's been destroyed
Ben Skeggs [Thu, 15 Apr 2010 04:42:34 +0000 (14:42 +1000)]
drm/nouveau: fix a nouveau_bo dereference after it's been destroyed

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nv40: remove some completed ctxprog TODOs
Ben Skeggs [Mon, 12 Apr 2010 03:35:10 +0000 (13:35 +1000)]
drm/nv40: remove some completed ctxprog TODOs

I actually thought these were gone already when the initial commit was
done.. I guess not!

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nv04: Implement missing nv04 PGRAPH methods in software.
Marcin Kościelnicki [Sun, 11 Apr 2010 18:41:38 +0000 (18:41 +0000)]
drm/nv04: Implement missing nv04 PGRAPH methods in software.

Signed-off-by: Marcin Kościelnicki <koriakin@0x04.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/nouveau: Use 0x5f instead of 0x9f as imageblit on original NV10.
Marcin Kościelnicki [Sun, 11 Apr 2010 18:16:21 +0000 (18:16 +0000)]
drm/nouveau: Use 0x5f instead of 0x9f as imageblit on original NV10.

Signed-off-by: Marcin Kościelnicki <koriakin@0x04.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
14 years agodrm/radeon: fix hdmi offset bug reported by smatch.
Dave Airlie [Wed, 19 May 2010 00:35:02 +0000 (10:35 +1000)]
drm/radeon: fix hdmi offset bug reported by smatch.

Reported-by: Dan Carpenter
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms: hpd cleanup
Alex Deucher [Tue, 18 May 2010 23:26:47 +0000 (19:26 -0400)]
drm/radeon/kms: hpd cleanup

- Use radeon hpd enum consistently (in both hotplug and dp)
- Legacy r100 with DVI should be HPD_1 not NONE

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms: reset ddc_bus in object header parsing
Alex Deucher [Tue, 18 May 2010 23:26:46 +0000 (19:26 -0400)]
drm/radeon/kms: reset ddc_bus in object header parsing

Some LVDS connectors don't have a ddc bus, so reset the
ddc bus to invalid before parsing the next connector
to avoid using stale ddc bus data.  Should fix
fdo bug 28164.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agoamd64-agp: Probe unknown AGP devices the right way
Ben Hutchings [Wed, 24 Mar 2010 03:36:31 +0000 (03:36 +0000)]
amd64-agp: Probe unknown AGP devices the right way

The current initialisation code probes 'unsupported' AGP devices
simply by calling its own probe function.  It does not lock these
devices or even check whether another driver is already bound to
them.

We must use the device core to manage this.  So if the specific
device id table didn't match anything and agp_try_unsupported=1,
switch the device id table and call driver_attach() again.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agosis-agp: Remove SIS 760, handled by amd64-agp
Ben Hutchings [Wed, 24 Mar 2010 03:33:48 +0000 (03:33 +0000)]
sis-agp: Remove SIS 760, handled by amd64-agp

SIS 760 is listed in the device tables for both amd64-agp and sis-agp.
amd64-agp is apparently preferable since it has workarounds for some
BIOS misconfigurations that sis-agp doesn't handle.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agoMerge remote branch 'anholt/drm-intel-next' into drm-next
Dave Airlie [Tue, 18 May 2010 23:35:51 +0000 (09:35 +1000)]
Merge remote branch 'anholt/drm-intel-next' into drm-next

* anholt/drm-intel-next: (515 commits)
  drm/i915: Fix out of tree builds
  drm/i915: move fence lru to struct drm_i915_fence_reg
  drm/i915: don't allow tiling changes on pinned buffers v2
  drm/i915: Be extra careful about A/D matching for multifunction SDVO
  drm/i915: Fix DDC bus selection for multifunction SDVO
  drm/i915: cleanup mode setting before unmapping registers
  drm/i915: Make fbc control wrapper functions
  drm/i915: Wait for the GPU whilst shrinking, if truly desperate.
  drm/i915: Use spatio-temporal dithering on PCH
  [MTD] Remove zero-length files mtdbdi.c and internal.ho
  pata_pcmcia / ide-cs: Fix bad hashes for Transcend and kingston IDs
  libata: Fix several inaccuracies in developer's guide
  slub: Fix bad boundary check in init_kmem_cache_nodes()
  raid6: fix recovery performance regression
  KEYS: call_sbin_request_key() must write lock keyrings before modifying them
  KEYS: Use RCU dereference wrappers in keyring key type code
  KEYS: find_keyring_by_name() can gain access to a freed keyring
  ALSA: hda: Fix 0 dB for Packard Bell models using Conexant CX20549 (Venice)
  ALSA: hda - Add quirk for Dell Inspiron 19T using a Conexant CX20582
  ALSA: take tu->qlock with irqs disabled
  ...

14 years agodrm/radeon/pm: fix device_create_file return value checks.
Dave Airlie [Tue, 18 May 2010 09:00:14 +0000 (19:00 +1000)]
drm/radeon/pm: fix device_create_file return value checks.

print an error if these fail.

Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms/pm: fix r6xx+ profile setup
Alex Deucher [Mon, 17 May 2010 23:41:26 +0000 (19:41 -0400)]
drm/radeon/kms/pm: fix r6xx+ profile setup

This patch is a combination of the previous two profile
patches, but without the index bugs.  It cleans up and
fixes some issues with pm profile setup on r6xx chips.
Some tables have different orderings for the power states,
also, r600 only has 1 clock mode per power state. On
desktop cards there are no battery modes, so the low and high
power states are the same.  For the low profile case, choose
the lower clock mode.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms/pm: make pm spam debug only
Alex Deucher [Fri, 7 May 2010 20:58:27 +0000 (16:58 -0400)]
drm/radeon/kms/pm: make pm spam debug only

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms/pm: rework power management
Alex Deucher [Fri, 7 May 2010 19:10:16 +0000 (15:10 -0400)]
drm/radeon/kms/pm: rework power management

- Separate dynpm and profile based power management methods.  You can select the pm method
  by echoing the selected method ("dynpm" or "profile") to power_method in sysfs.
- Expose basic 4 profile in profile method
  "default" - default clocks
  "auto" - select between low and high based on ac/dc state
  "low" - DC, low power mode
  "high" - AC, performance mode
  The current base profile is "default", but it should switched to "auto" once we've tested
  on more systems.  Switching the state is a matter of echoing the requested profile to
  power_profile in sysfs.  The lowest power states are selected automatically when dpms turns
  the monitors off in all states but default.
- Remove dynamic fence-based reclocking for the moment.  We can revisit this later once we
  have basic pm in.
- Move pm init/fini to modesetting path.  pm is tightly coupled with display state.  Make sure
  display side is initialized before pm.
- Add pm suspend/resume functions to make sure pm state is properly reinitialized on resume.
- Remove dynpm module option.  It's now selectable via sysfs.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms/pm: add support for no display power states
Alex Deucher [Mon, 3 May 2010 05:13:14 +0000 (01:13 -0400)]
drm/radeon/kms/pm: add support for no display power states

The lowest power states often cause display problems, so only enable
them when all displays are off.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms: fix lock ordering in ring, ib handling
Alex Deucher [Thu, 6 May 2010 15:02:24 +0000 (11:02 -0400)]
drm/radeon/kms: fix lock ordering in ring, ib handling

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agoradeon: Use fences to gate entry to reclocking on <r600
Matthew Garrett [Fri, 30 Apr 2010 19:48:23 +0000 (15:48 -0400)]
radeon: Use fences to gate entry to reclocking on <r600

GUI idle interrupts don't seem to work terribly well on r500 and earlier,
so let's use a fence instead.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agoradeon: Split out ring locking and allocation
Matthew Garrett [Fri, 30 Apr 2010 19:24:17 +0000 (15:24 -0400)]
radeon: Split out ring locking and allocation

We need to handle the ring while we've already locked it, so split out
the allocation and commit functions in order to allow them to be used.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms: enable misc pm power state features on r1xx-r4xx
Alex Deucher [Fri, 30 Apr 2010 19:34:12 +0000 (15:34 -0400)]
drm/radeon/kms: enable misc pm power state features on r1xx-r4xx

voltage drop, dynamic voltage, dynamic sclk, pcie lane adjust, etc,

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms: enable misc pm power state features on r5xx, rs6xx
Alex Deucher [Thu, 29 Apr 2010 20:33:38 +0000 (16:33 -0400)]
drm/radeon/kms: enable misc pm power state features on r5xx, rs6xx

voltage drop, dynamic voltage, dynamic sclk, pcie lane adjust, etc,

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms: re-enable gui idle interrupts on r6xx+
Alex Deucher [Thu, 29 Apr 2010 20:14:02 +0000 (16:14 -0400)]
drm/radeon/kms: re-enable gui idle interrupts on r6xx+

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms: take vram mutex pointer before derefing object.
Dave Airlie [Thu, 29 Apr 2010 08:37:59 +0000 (18:37 +1000)]
drm/radeon/kms: take vram mutex pointer before derefing object.

since derefing the object might free it.

Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms: more pm fixes
Alex Deucher [Thu, 29 Apr 2010 04:22:43 +0000 (00:22 -0400)]
drm/radeon/kms: more pm fixes

- disable gui idle interrupt use
  Seems to hang some r5xx chips
- move vbl range check into
  existing vbl check function in
  radeon_pm.c
- disable crtc mc acccess for the
  whole reclocking process

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm: move radeon_fixed.h to shared drm_fixed.h header
Ben Skeggs [Wed, 28 Apr 2010 01:46:42 +0000 (11:46 +1000)]
drm: move radeon_fixed.h to shared drm_fixed.h header

Will be used by nouveau driver also in the near future.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agoradeon: Enable memory reclocking on r100-500
Matthew Garrett [Wed, 28 Apr 2010 18:45:05 +0000 (14:45 -0400)]
radeon: Enable memory reclocking on r100-500

This seems to be relatively stable now, so enable it for these chipsets
too.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agoradeon: Try harder to ensure we reclock in vblank
Matthew Garrett [Wed, 28 Apr 2010 16:13:06 +0000 (12:13 -0400)]
radeon: Try harder to ensure we reclock in vblank

The vblank interrupt on r600 doesn't seem to be especially reliable, so
perform some sanity checks before the actual reclock.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agoradeon: Fix locking in power management paths
Matthew Garrett [Tue, 27 Apr 2010 21:16:58 +0000 (17:16 -0400)]
radeon: Fix locking in power management paths

The ttm code could take vram_mutex followed by cp_mutex, while the
reclocking code would do the reverse. Hilarity could ensue.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agoradeon: Make sure that we determine the correct PM state before transition
Matthew Garrett [Tue, 27 Apr 2010 17:58:46 +0000 (13:58 -0400)]
radeon: Make sure that we determine the correct PM state before transition

We need to choose the correct PM state to transition into before starting
the actual change. Call radeon_get_power_state() at the top of the clock
setting to do so.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agoradeon: Enable memory reclockong on r600
Matthew Garrett [Mon, 26 Apr 2010 21:01:16 +0000 (17:01 -0400)]
radeon: Enable memory reclockong on r600

With luck, dynamic memory reclocking on r600 should be stable with
the previous patches. Enable it.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agoradeon: Stop the ttm workqueue while reclocking
Matthew Garrett [Mon, 26 Apr 2010 20:02:26 +0000 (16:02 -0400)]
radeon: Stop the ttm workqueue while reclocking

The ttm bo workqueue may touch objects while we're reclocking, so make
sure it's blocked until we're done.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agottm: Provide an API for starting and stopping the delayed workqueue
Matthew Garrett [Mon, 26 Apr 2010 20:00:09 +0000 (16:00 -0400)]
ttm: Provide an API for starting and stopping the delayed workqueue

We want to be able to prevent the delayed workqueue from changing state
while we're reclocking, so add an API to block and unblock it.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agoradeon: Take drm struct_mutex over reclocking
Matthew Garrett [Mon, 26 Apr 2010 19:57:01 +0000 (15:57 -0400)]
radeon: Take drm struct_mutex over reclocking

We need to block the drm core from doing anything that may touch our vram
during reclock, so take the drm mutex for the duration.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agoradeon: Unmap vram pages when reclocking
Matthew Garrett [Mon, 26 Apr 2010 19:52:20 +0000 (15:52 -0400)]
radeon: Unmap vram pages when reclocking

Touching vram while the card is reclocking can lead to lockups. Unmap
any pages that could be touched by the CPU and block any accesses to
vram until the reclocking is complete.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agoradeon: Unify PM entry paths
Matthew Garrett [Mon, 26 Apr 2010 19:45:23 +0000 (15:45 -0400)]
radeon: Unify PM entry paths

There's a moderate amount of effort involved in setting the card up for
clock transitions, so unify the codepaths to make it easier to implement.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms/pm: rework power management
Alex Deucher [Sat, 24 Apr 2010 18:50:23 +0000 (14:50 -0400)]
drm/radeon/kms/pm: rework power management

Add two new sysfs attributes:
- dynpm
- power_state

Echoing 0/1 to dynpm disables/enables dynamic power management.
The driver scales the sclk dynamically based on the number of
queued fences.  dynpm only scales sclk dynamically in single head
mode.

Echoing x.y to power_state selects a static power state (x) and clock
mode (y).  This allows you to statically select a power state and clock
mode.  Selecting a static clock mode will disable dynpm.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms/pm: add additional asic callbacks
Alex Deucher [Fri, 23 Apr 2010 21:57:27 +0000 (17:57 -0400)]
drm/radeon/kms/pm: add additional asic callbacks

- pm_misc() - handles voltage, pcie lanes, and other non
clock related power mode settings.  Currently disabled.
Needs further debugging

- pm_prepare() - disables crtc mem requests right now.
All memory clients need to be disabled when changing
memory clocks.  This function can be expanded to include
disabling fb access as well.

- pm_finish() - enable active memory clients.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms/pm: restore default power state on exit
Alex Deucher [Mon, 22 Mar 2010 17:31:08 +0000 (13:31 -0400)]
drm/radeon/kms/pm: restore default power state on exit

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms: minor pm cleanups
Alex Deucher [Thu, 22 Apr 2010 18:25:19 +0000 (14:25 -0400)]
drm/radeon/kms: minor pm cleanups

- remove non_clock_info struct
- track power state misc flags

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms/pm: clean power state printing
Alex Deucher [Mon, 5 Apr 2010 19:26:43 +0000 (15:26 -0400)]
drm/radeon/kms/pm: clean power state printing

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms/pm: don't enable pm if there is only on power state
Alex Deucher [Wed, 24 Mar 2010 15:32:29 +0000 (11:32 -0400)]
drm/radeon/kms/pm: don't enable pm if there is only on power state

Just adds overhead when the power state will never change.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms/atom: load hwmon drivers
Alex Deucher [Thu, 22 Apr 2010 18:17:56 +0000 (14:17 -0400)]
drm/radeon/kms/atom: load hwmon drivers

Hook the atom table parsing up to module loading, so we can automatically
load the appropriate hwmon drivers.

Based on initial patch for r6xx from Matthew Garrett

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms/pm: update display watermarks with power state changes
Alex Deucher [Mon, 22 Mar 2010 17:34:22 +0000 (13:34 -0400)]
drm/radeon/kms/pm: update display watermarks with power state changes

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms/pm: add asic specific callbacks for getting power state (v2)
Alex Deucher [Thu, 22 Apr 2010 18:03:55 +0000 (14:03 -0400)]
drm/radeon/kms/pm: add asic specific callbacks for getting power state (v2)

This also simplifies the code and enables reclocking with multiple heads
active by tracking whether the power states are single or multi-head
capable.

Eventually, we will want to select a power state based on external
factors (AC/DC state, user selection, etc.).

(v2) Update for evergreen

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms/pm: add asic specific callbacks for setting power state (v2)
Alex Deucher [Thu, 22 Apr 2010 17:38:05 +0000 (13:38 -0400)]
drm/radeon/kms/pm: add asic specific callbacks for setting power state (v2)

(v2) Add evergreen vbl checks

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms/pm: move pm state update to crtc functions
Alex Deucher [Tue, 16 Mar 2010 21:42:46 +0000 (17:42 -0400)]
drm/radeon/kms/pm: move pm state update to crtc functions

crtcs are what we ultimately care about wrt to pm.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms/pm: interate across crtcs for vblank
Alex Deucher [Mon, 15 Mar 2010 21:09:05 +0000 (17:09 -0400)]
drm/radeon/kms/pm: interate across crtcs for vblank

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms/atom/pm: rework power mode parsing
Alex Deucher [Thu, 22 Apr 2010 17:25:06 +0000 (13:25 -0400)]
drm/radeon/kms/atom/pm: rework power mode parsing

On pre-r6xx, the power mode array is usually ordered:
low
...
high
default

On r6xx+:
default
low
...
high

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms: wait for gpu idle before changing power mode
Alex Deucher [Wed, 17 Mar 2010 18:29:15 +0000 (14:29 -0400)]
drm/radeon/kms: wait for gpu idle before changing power mode

set proper wait condition as noted by Rafał Miłecki.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms: add support for gui idle interrupts (v4)
Alex Deucher [Thu, 22 Apr 2010 16:52:11 +0000 (12:52 -0400)]
drm/radeon/kms: add support for gui idle interrupts (v4)

Useful for certain power management operations.  You
need to wait for the GUI engine (2D, 3D, CP, etc.) to be
idle before changing clocks or adjusting engine parameters.

(v2) Fix gui idle enable on pre-r6xx asics

(v3) The gui idle interrrupt status bit is permanently asserted
on pre-r6xx chips, but the interrrupt is still generated.
workaround it in the driver.

(v4) Add support for evergreen

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms: add gui_idle callback
Alex Deucher [Thu, 22 Apr 2010 16:39:58 +0000 (12:39 -0400)]
drm/radeon/kms: add gui_idle callback

Check to see if the GUI engine and related blocks
(2D, 3D, CP, etc) are idle or not.  There are a number
of cases when we need to know if the drawing engine
is busy.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/fbdev: fix cloning on fbcon
Dave Airlie [Fri, 7 May 2010 05:02:30 +0000 (05:02 +0000)]
drm/fbdev: fix cloning on fbcon

Simple cloning rules compared to server:
(a) single crtc
(b) > 1 connector active
(c) check command line mode
(d) try and find 1024x768 DMT mode if no command line.
(e) fail to clone

Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/fbdev: rework output polling to be back in the core. (v4)
Dave Airlie [Fri, 7 May 2010 06:42:51 +0000 (06:42 +0000)]
drm/fbdev: rework output polling to be back in the core. (v4)

After thinking it over a lot it made more sense for the core to deal with
the output polling especially so it can notify X.

v2: drop plans for fake connector - per Michel's comments - fix X patch sent to xorg-devel, add intel polled/hpd setting, add initial nouveau polled/hpd settings.

v3: add config lock take inside polling, add intel/nouveau poll init/fini calls

v4: config lock was a bit agressive, only needed around connector list reading.
otherwise it could re-enter.

glisse: discard drm_helper_hpd_irq_event

v3: Reviewed-by: Michel Dänzer <michel@daenzer.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm: off by one in drm_edid.c
Dan Carpenter [Fri, 7 May 2010 08:38:20 +0000 (08:38 +0000)]
drm: off by one in drm_edid.c

m == num_est3_modes is one past the end of the est3_modes[].

Signed-off-by: Dan Carpenter <error27@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agovga16fb, drm: vga16fb->drm handoff
Marcin Slusarz [Sun, 16 May 2010 15:33:09 +0000 (17:33 +0200)]
vga16fb, drm: vga16fb->drm handoff

let vga16fb claim 0xA0000+0x10000 region as its aperture;
drm drivers don't use it, so we have to detect it and kick
vga16fb manually - but only if drm is driving the primary card

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Cc: James Simmons <jsimmons@infradead.org>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agofbmem, drm/nouveau: kick firmware framebuffers as soon as possible
Marcin Slusarz [Sun, 16 May 2010 15:29:56 +0000 (17:29 +0200)]
fbmem, drm/nouveau: kick firmware framebuffers as soon as possible

Currently vesafb/efifb/... is kicked when hardware driver is registering
framebuffer. To do it hardware must be fully functional, so there's a short
window between start of initialisation and framebuffer registration when
two drivers touch the hardware. Unfortunately sometimes it breaks nouveau
initialisation.

Fix it by kicking firmware driver(s) before we start touching the hardware.

Reported-by: Didier Spaier <didier.spaier@epsm.fr>
Tested-by: Didier Spaier <didier.spaier@epsm.fr>
Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: Peter Jones <pjones@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agofbdev: allow passing more than one aperture for handoff
Marcin Slusarz [Sun, 16 May 2010 15:27:03 +0000 (17:27 +0200)]
fbdev: allow passing more than one aperture for handoff

It removes a hack from nouveau code which had to detect which
region to pass to kick vesafb/efifb.

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Cc: Eric Anholt <eric@anholt.net>
Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: Thomas Hellstrom <thellstrom@vmware.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Peter Jones <pjones@redhat.com>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm: Prefix info printk about registering panic notifier with 'drm'
Kirill Smelkov [Fri, 14 May 2010 15:45:16 +0000 (19:45 +0400)]
drm: Prefix info printk about registering panic notifier with 'drm'

Recently I've studied my system dmesg and seen this:

  <lots of stuff before>
1 [    0.478416] ACPI: Battery Slot [C1B4] (battery present)
2 [    0.478648] ACPI: Battery Slot [C1B3] (battery absent)
3 [    0.906678] [drm] initialized overlay support
4 [    1.762304] Console: switching to colour frame buffer device 128x48
5 [    1.765211] fb0: inteldrmfb frame buffer device
6 [    1.765242] registered panic notifier
7 [    1.765272] [drm] Initialized i915 1.6.0 20080730 for 0000:00:02.0 on minor 0
8 [    1.765372] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
  <lots of stuff after>

and it was not evident who registered that panic notifier on line 6.

I'd bought it as some low-level stuff needed by kernel itself, but the
time was inappropriate -- too late for such things.

So I had to study sources to see it was drm who was registering
switch-to-fb on panic.

Let's avoid possible confusion and mark this message as going from drm
subsystem.

(I'm a bit unsure whether to use '[drm]:' or 'drm:' -- the rest of the
 kernel just uses 'topic:', and even in drm_fb_helper.c we use 'fb%d:'
 without [] brackets. Either way is ok with me.)

Signed-off-by: Kirill Smelkov <kirr@landau.phys.spbu.ru>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms: add query for crtc hw id from crtc id to get info V2
Jerome Glisse [Wed, 12 May 2010 16:01:13 +0000 (18:01 +0200)]
drm/radeon/kms: add query for crtc hw id from crtc id to get info V2

Userspace need to know the hw crtc id (0, 1, 2, ...) from the drm
crtc id. Bump the minor version so userspace can enable conditionaly
features depend on this.

V2 use num_crtc and avoid DRM_ERROR

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/edid: Fix 1024x768@85Hz
Adam Jackson [Thu, 13 May 2010 18:55:28 +0000 (14:55 -0400)]
drm/edid: Fix 1024x768@85Hz

Having hsync both start and end on pixel 1072 ain't gonna work very
well.  Matches the X server's list.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Tested-By: Michael Tokarev <mjt@tls.msk.ru>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrivers/gpu/drm: Use kzalloc
Julia Lawall [Thu, 13 May 2010 19:58:56 +0000 (21:58 +0200)]
drivers/gpu/drm: Use kzalloc

Use kzalloc rather than the combination of kmalloc and memset.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression x,size,flags;
statement S;
@@

-x = kmalloc(size,flags);
+x = kzalloc(size,flags);
 if (x == NULL) S
-memset(x, 0, size);
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Reviewed-by: Corbin Simpson <MostAwesomeDude@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm_edid: There should be 6 Standard Timings
Dan Carpenter [Fri, 14 May 2010 11:06:19 +0000 (13:06 +0200)]
drm_edid: There should be 6 Standard Timings

Smatch complained that we initialize 6 elements in add_detailed_modes()
but the timings[] array is declared with 5 elements.  Adam Jackson
verified that 6 is the correct number of timings.

On Mon, May 10, 2010 at 12:08:24PM -0400, Adam Jackson wrote:
> > >                 struct std_timing timings[5];
> > >                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> This decl is wrong, should be 6.  From the 1.4 spec:
>
> "Six additional Standard Timings may be listed as a display descriptor
> (tag #FAh)."
>
> The 1.3 spec is a little less explicit about it, but does show 6
> standard timing codes in the 0xFA detailed subblock, terminated by 0x0A
> in the 18th byte.  I don't have the docs for 1.2 or earlier, but we're
> paranoid enough about not adding broken timings that we should be fine.

This patch is basically a clean up, because timings[] is declared inside
a union and increasing the number of elements here doesn't change the
overall size of the union.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrivers/gpu/drm: Use kmemdup
Julia Lawall [Sat, 15 May 2010 21:17:40 +0000 (23:17 +0200)]
drivers/gpu/drm: Use kmemdup

Use kmemdup when some other buffer is immediately copied into the
allocated region.

A simplified version of the semantic patch that makes this change is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression from,to,size,flag;
statement S;
@@

-  to = \(kmalloc\|kzalloc\)(size,flag);
+  to = kmemdup(from,size,flag);
   if (to==NULL || ...) S
-  memcpy(to, from, size);
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agovga: fix kconfig text typos
Randy Dunlap [Mon, 17 May 2010 17:54:04 +0000 (10:54 -0700)]
vga: fix kconfig text typos

Fix typos in vga/Kconfig file
and use GPU (upper case) consistently.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/edid: remove an unneeded variable
Dan Carpenter [Sun, 16 May 2010 06:27:52 +0000 (08:27 +0200)]
drm/edid: remove an unneeded variable

We don't use timing_level any more after: 9cf00977da0 "drm/edid: Unify
detailed block parsing between base and extension blocks".

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms/combios: match lvds panel info parsing to ddx
Alex Deucher [Tue, 18 May 2010 04:30:05 +0000 (00:30 -0400)]
drm/radeon/kms/combios: match lvds panel info parsing to ddx

Should work better on some panels.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms/atom: fix typo in LVDS panel info parsing
Alex Deucher [Tue, 18 May 2010 04:23:15 +0000 (00:23 -0400)]
drm/radeon/kms/atom: fix typo in LVDS panel info parsing

Fixes LVDS issues on some laptops; notably laptops with
2048x1536 panels.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/radeon/kms: fix copy pasto in disable encoders patch
Alex Deucher [Sat, 8 May 2010 03:17:20 +0000 (23:17 -0400)]
drm/radeon/kms: fix copy pasto in disable encoders patch

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/i915: Fix out of tree builds
Peter Clifton [Mon, 3 May 2010 12:24:41 +0000 (13:24 +0100)]
drm/i915: Fix out of tree builds

Fixes up include paths for i915_trace.h by setting additional CFLAGS
for i915_trace_points.c to include the $src directory. The required
TRACE_INCLUDE_PATH is then "."

Signed-off-by: Peter Clifton <pcjc2@cam.ac.uk>
Signed-off-by: Eric Anholt <eric@anholt.net>
14 years agodrm/i915: move fence lru to struct drm_i915_fence_reg
Daniel Vetter [Wed, 28 Apr 2010 09:02:31 +0000 (11:02 +0200)]
drm/i915: move fence lru to struct drm_i915_fence_reg

This lru tracks fences, not objects, so move it to where it belongs.
As a side effect, this nicely shrinks drm_i915_gem_object by two
pointers.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Eric Anholt <eric@anholt.net>
14 years agodrm/i915: don't allow tiling changes on pinned buffers v2
Daniel Vetter [Fri, 23 Apr 2010 21:01:01 +0000 (23:01 +0200)]
drm/i915: don't allow tiling changes on pinned buffers v2

Makes no sense and complicates matters for pipelined tiling changes.
So don't allow it and return -EBUSY.

v2: Fix reference leak. Thanks to Owain Ainsworth for spotting this.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Eric Anholt <eric@anholt.net>
14 years agodrm/i915: Be extra careful about A/D matching for multifunction SDVO
Adam Jackson [Thu, 29 Apr 2010 18:05:18 +0000 (14:05 -0400)]
drm/i915: Be extra careful about A/D matching for multifunction SDVO

If we're both RGB and TMDS capable, we'll have set up one connector for
each.  When determining connectivity, require analog/digital state in
the EDID block to match analog/digital support in the connector.
Otherwise, both DVI and VGA will appear to be connected.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
14 years agodrm/i915: Fix DDC bus selection for multifunction SDVO
Adam Jackson [Fri, 23 Apr 2010 20:07:40 +0000 (16:07 -0400)]
drm/i915: Fix DDC bus selection for multifunction SDVO

Multifunction SDVO cards stopped working after 14571b4, and would report
something that looked remarkably like an ADD2 SPD ROM instead of EDID.
This appears to be because DDC bus selection was utterly horked by that
commit; controlled_output was no longer always a single bit, so
intel_sdvo_select_ddc_bus would pick bus 0, which is (unsurprisingly)
the SPD ROM bus, not a DDC bus.

So, instead of that, let's just use the DDC bus the child device table
tells us to use.  I'm guessing at the bitmask and shifting from VBIOS
dumps, but it can't possibly be worse.

cf. https://bugzilla.redhat.com/584229

Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
14 years agoMerge remote branch 'origin/master' into drm-intel-next
Eric Anholt [Fri, 7 May 2010 21:30:03 +0000 (14:30 -0700)]
Merge remote branch 'origin/master' into drm-intel-next

Conflicts:
drivers/gpu/drm/i915/i915_dma.c
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/radeon/r300.c

The BSD ringbuffer support that is landing in this branch
significantly conflicts with the Ironlake PIPE_CONTROL fix on master,
and requires it to be tested successfully anyway.

14 years agodrm/radeon/kms/atom: disable the encoders in encoder_disable
Alex Deucher [Fri, 7 May 2010 21:05:22 +0000 (17:05 -0400)]
drm/radeon/kms/atom: disable the encoders in encoder_disable

Previously we just set them to dpms off.  This should save
additional power.

Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
14 years agodrm/i915: cleanup mode setting before unmapping registers
Jesse Barnes [Fri, 26 Mar 2010 18:07:21 +0000 (11:07 -0700)]
drm/i915: cleanup mode setting before unmapping registers

We'll turn off outputs etc at unload time, so don't unmap the registers
before doing it.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
14 years agodrm/i915: Make fbc control wrapper functions
Adam Jackson [Fri, 23 Apr 2010 15:17:39 +0000 (11:17 -0400)]
drm/i915: Make fbc control wrapper functions

Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
14 years agodrm/i915: Wait for the GPU whilst shrinking, if truly desperate.
Chris Wilson [Tue, 20 Apr 2010 16:10:35 +0000 (17:10 +0100)]
drm/i915: Wait for the GPU whilst shrinking, if truly desperate.

By idling the GPU and discarding everything we can when under extreme
memory pressure, the number of OOM-killer events is dramatically
reduced. For instance, this makes it possible to run
firefox-planet-gnome.trace again on my swapless 512MiB i915.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Eric Anholt <eric@anholt.net>