Commit graph

6245 commits

Author SHA1 Message Date
Ville Syrjälä d63f5e6bf6 drm: Use a flexible array member for blob property data
The blob property data is always allocated immediately after the object
header. No need for the extra indirection when accessing it, just use
a flexible array member.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-15 09:52:37 +00:00
Ville Syrjälä 6bfc56aa89 drm: Handle drm_object_get() failures
Check drm_mode_object_get() return value everywhere.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-15 09:52:30 +00:00
Ville Syrjälä 93bbf6dbda drm: Make drm_crtc_convert_{umode, to_umode} static and constify their params
drm_crtc_convert_umode() and drm_crtc_convert_to_umode() are never
used outside drm_crtc.c, so make them static. Also make the input
mode structure const for both functions.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-15 09:52:02 +00:00
Ville Syrjälä ac235dafb6 drm: Fix drm_mode_attachmode_crtc()
Change drm_mode_attachmode_crtc() to take an "all or nothing" approach.
If an error is returned, there are no side effects visible.

Also change the function to always duplicate the mode passed in.

Also change the function to not give up when it finds the first
connector without and encoder.

A simpler approach would be to just remove the function completely as
it's unused currently.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-15 09:51:42 +00:00
Ville Syrjälä 5f61bb421f drm: Check CRTC viewport against framebuffer size
Make sure the requested CRTC viewport fits inside the
framebuffer.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-15 09:51:04 +00:00
Ville Syrjälä 90367bf6e9 drm: Check user mode against overflows
The internal mode representation drm_display_mode uses signed data
types. When converting the user mode to internal representation,
check that the unsigned values don't overflow the signed datatypes.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-15 09:50:39 +00:00
Ville Syrjälä ee34ab5b01 drm: Fix memory leak in drm_mode_setcrtc()
The mode passed to the .set_config() hook was never freed. The drivers
will make a copy of the mode, so simply free it when done.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-15 09:50:20 +00:00
Ville Syrjälä 1dd6c8bda9 drm: Make drm_mode_attachmode() void
drm_mode_attachmode() always returns 0. Change the return type to void.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-15 09:49:57 +00:00
Ville Syrjälä 1d97e91548 drm: Check crtc x and y coordinates
The crtc x/y panning coordinates are stored as signed integers
internally. The user provides them as unsigned, so we should check
that the user provided values actually fit in the internal datatypes.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-15 09:49:26 +00:00
Ville Syrjälä e36fae3889 drm: Warn if mode to umode conversion overflows the destination types
When converting from a drm_display_mode to drm_mode_modeinfo, print a
warning if the the timings values don't fit into the __u16 datatype.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-15 09:49:18 +00:00
Ville Syrjälä 6653cc8d3b drm: Reject mode set with current fb if no current fb is bound
When doing a mode set with the special fb id -1, reject the mode set if
no fb is currently bound to the crtc.

Also remove the pointless list traversal to find the current crtc based
on the current crtc :)

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-15 09:48:56 +00:00
Alan Cox 09016a11fc gma500: suspend/resume support for Cedartrail
Update our tree to match the current driver head.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-15 09:46:22 +00:00
Alan Cox 50d44a5237 gma500: Fix resume paths
We fall apart somewhat on resume because we don't invoke all the resume
methods as we should. Fix the silly error in the logic.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-15 09:46:02 +00:00
Dave Airlie bb2551da10 Merge branch 'exynos-drm-fixes' of git://git.infradead.org/users/kmpark/linux-samsung into drm-fixes
* 'exynos-drm-fixes' of git://git.infradead.org/users/kmpark/linux-samsung:
  drm exynos: use drm_fb_helper_set_par directly
  drm/exynos: Fix fb_videomode <-> drm_mode_modeinfo conversion
  drm/exynos: fix runtime_pm fimd device state on probe
  drm/exynos: use correct 'exynos-drm' name for platform device
2012-03-15 09:41:26 +00:00
Dave Airlie f1377998ee drm/nouveau: add userspace fallback hints.
This lets the modesetting driver work better.

Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-15 09:39:03 +00:00
Sascha Hauer 34418c25d6 drm exynos: use drm_fb_helper_set_par directly
info->fix.visual already is correctly set from drm_fb_helper_fill_fix.
info->fix.line_length is also set from drm_fb_helper_fill_fix,
so drm_fb_helper_set_par directly instead of a custom
exynos_drm_fbdev_set_par.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2012-03-15 11:39:00 +09:00
Laurent Pinchart f7d86075fa drm/exynos: Fix fb_videomode <-> drm_mode_modeinfo conversion
The fb_videomode structure stores the front porch and back porch in the
right_margin and left_margin fields respectively. right_margin should
thus be computed with hsync_start - hdisplay, and left_margin with
htotal - hsync_end. The same holds for the vertical direction.

       Active               Front           Sync            Back
       Region               Porch                           Porch
<-------------------><----------------><-------------><---------------->

  //////////////////|
 ////////////////// |
//////////////////  |..................               ..................
                                       _______________

<------ xres -------><- right_margin -><- hsync_len -><- left_margin -->

<---- hdisplay ----->
<------------ hsync_start ------------>
<--------------------- hsync_end -------------------->
<--------------------------------- htotal ----------------------------->

Fix the fb_videomode <-> drm_mode_modeinfo conversion functions
accordingly.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2012-03-15 11:39:00 +09:00
Marek Szyprowski 0d8ce3ae37 drm/exynos: fix runtime_pm fimd device state on probe
A call to pm_runtime_set_active() forces device to be at the active
state and skips calling its runtime suspend/resume callbacks. This
results in a freeze with a new power domain code based on gen_pd. Fimd
driver does all required runtime power management calls, so this
pm_runtime_set_active call is buggy. This patch removes it and corrects
clock management in probe function (clocks are now enabled by
pm_runtime_get_sync() call).

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2012-03-15 11:38:59 +09:00
Marek Szyprowski 9866b6c64b drm/exynos: use correct 'exynos-drm' name for platform device
Currently Exynos DRM driver uses DRIVER_NAME ('exynos') name for the
core platform device. This is confusing, because it doesn't refer to the
function the platform device is performing. This patch renames the
platform device to the 'exynos-drm', which matches the convention for
naming the platform devices. The name used inside DRM subsystem has not
been changed.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2012-03-15 11:38:59 +09:00
Dave Airlie 57387177a3 Merge branch 'drm-intel-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/keithp/linux into drm-fixes
* 'drm-intel-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/keithp/linux:
  drm/i915: support 32 bit BGR formats in sprite planes
  drm/i915: fix color order for BGR formats on SNB
  drm/gma500: Fix Cedarview boot failures in 3.3-rc
2012-03-14 18:32:27 +00:00
Ben Skeggs 2f5394c3ed drm/nouveau: map first page of mmio early and determine chipset earlier
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-03-13 17:15:07 +10:00
Ben Skeggs 4cbb0f8d2b drm/nvd0/disp: disconnect encoders before reprogramming them
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-03-13 17:15:07 +10:00
Ben Skeggs 3488c57b98 drm/nvd0/disp: move syncs/magic setup to or mode_set
NVIDIA appear to do these around the same place they do the MODE_CTRL
methods, and for DP at least we need to bash some extra bits in "syncs"
to keep EVO happy.

It's a bit of a guess as to the 6/8bpc, but i have no better idea yet.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-03-13 17:15:06 +10:00
Ben Skeggs 6860dc8251 drm/nouveau/dp: account for channel coding overhead in link training
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-03-13 17:15:05 +10:00
Ben Skeggs c674844bab drm/nvd0/disp: fix dcb sor link matching in supervisor handler
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-03-13 17:15:05 +10:00
Ben Skeggs 6e83fda2c0 drm/nvd0/disp: initial implementation of displayport
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-03-13 17:15:04 +10:00
Ben Skeggs f14d9a4dda drm/nouveau/dp: make dp dpms function common, call from sor code instead
GF119 will use this too.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-03-13 17:15:04 +10:00
Martin Peres e436d1bb0a drm/nv50/hwsq: some nv92 fixes
The shift from hwsq_data = 0x1400 to 0x080000 actually happened in nv94, not nv92
This fixes some reclocking issues on my newly acquired nv92

Signed-off-by: Martin Peres <martin.peres@labri.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-03-13 17:15:03 +10:00
Ben Skeggs 8663bc7cde drm/nouveau/dp: move all nv50/sor-specific code out of nouveau_dp.c
Off-chip encoders (which we don't support yet anyway), and newer chipsets
(such as NVD9...), will need their own code for this.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-03-13 17:15:03 +10:00
Ben Skeggs 8c1dcb6573 drm/nouveau/dp: make functions for executing various bios tables
More code to do the same thing, but will make it easier to handle various
changes that could possibly happen the the VBIOS tables.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-03-13 17:15:02 +10:00
Ben Skeggs c11dd0da52 drm/nouveau/pm: fix oops if chipset has no pm support at all
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-03-13 17:15:02 +10:00
Ben Skeggs 4489b9835a drm/nouveau/bios: rework vbios shadowing
Refactored to allow shadowing of VBIOS images longer than 64KiB, which
allows us to pass the VBIOS checksum test on certain boards.

There's also a workaround for reading the PROM VBIOS on some chipsets.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-03-13 17:15:01 +10:00
Ben Skeggs 05a7c15d48 drm/nouveau/bios: attempt acpi rom fetch before pcirom
There's cards out there with completely messed up PCIROM images that have
a perfectly valid signature.. Sigh!

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-03-13 17:15:01 +10:00
Ben Skeggs 7c5f6a87b2 drm/nvd0/disp: attempt to handle more than 2 crtcs if possible
Theoretically handles CRTC2/CRTC3, should any GF119 out there actually
have them enabled.  The room is there for the regs etc, so why not :)

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-03-13 17:15:00 +10:00
Ben Skeggs 29181d2f7b drm/nvc0/vram: get part count from PUNITS
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-03-13 17:15:00 +10:00
Ben Skeggs 8b83d67c2e drm/nv40/pm: fix fanspeed regression
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-03-13 17:14:59 +10:00
Roy Spliet e6084257d0 drm/nouveau/pm: several fixes for nvc0 memory timings
This patch fixes two small issues in timing generation as spotted on
several NVCx cards.

In addition, the header of the file is updated to also contain (some of)
the current developers of this code.

Signed-off-by: Roy Spliet <r.spliet@student.tudelft.nl>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-03-13 17:14:59 +10:00
Ben Skeggs 1ae73f2f16 drm/nvc0/pm: restrict pll mode to clocks that can actually use it
Fixes reclocking failure on some chips where we attempted to set PDAEMON
to PLL mode.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-03-13 17:14:58 +10:00
Xi Wang 44ab8cc56c drm/nouveau/dp: fix bad comparison in dp_link_train_commit()
The comparison (lpre == DP_TRAIN_PRE_EMPHASIS_9_5) is always false:
lpre is initialized as (lane & 0x0c) >> 2, which is at most 3, while
DP_TRAIN_PRE_EMPHASIS_9_5 is defined as (3 << 3).

Signed-off-by: Xi Wang <xi.wang@gmail.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-03-13 17:14:58 +10:00
Ben Skeggs 84ddfda6d4 drm/nouveau/mxm: call mxmi to determine revision before calling mxms
There's a HP laptop out there where the MXM version in the VBIOS doesn't
match what the ACPI implementation is expecting.  These tables will accept
0x00 to MXMS to return latest version, but *only* if MXMI has been called
first..

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-03-13 17:14:57 +10:00
Ben Skeggs 7d3a766b6a drm/nouveau/pm: init only after display subsystem has been created
This patch fixes an oops cause by pm_trigger accessing the (uninitialised)
crtc list.

Reported-by: Roy Spliet <r.spliet@student.tudelft.nl>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-03-13 17:14:57 +10:00
Ben Skeggs 950c44b6dd drm/nvc0/fb: detect presense of second rank
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-03-13 17:14:56 +10:00
Christoph Bumiller df26bc9c32 drm/nv50/display: expose color vibrance control
Signed-off-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-03-13 17:14:56 +10:00
Ben Skeggs 990449c77c drm/nv50-nvc0/vm: support unsnooped system memory
v2 (Emil Velikov <emil.l.velikov@gmail.com>):
- Fixed a regression on certain nv50 IGP due to not passing the correct
  target type to nv50_vm_addr()

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Tested-by: Johannes Obermayr <johannesobermayr@gmx.de>
2012-03-13 17:14:06 +10:00
Ben Skeggs 4abb410a13 drm/nouveau: recognise DCB connector type for DP+DVI+VGA DMS-59
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-03-13 17:09:23 +10:00
Ben Skeggs 070be296b6 drm/nouveau/mem: handle dll_off for ddr2/ddr3
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Martin Peres <martin.peres@labri.fr>
2012-03-13 17:09:14 +10:00
Ben Skeggs 25c53c1068 drm/nouveau/pm: extend profile interface for destroy/init/fini
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Martin Peres <martin.peres@labri.fr>
2012-03-13 17:09:11 +10:00
Ben Skeggs 8d7bb40063 drm/nouveau/pm: rework to allow selecting separate profiles for ac/battery
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Martin Peres <martin.peres@labri.fr>
2012-03-13 17:09:04 +10:00
Ben Skeggs b830973b68 drm/nouveau/pm: fix dll off -> dll on transitions
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Martin Peres <martin.peres@labri.fr>
2012-03-13 17:09:00 +10:00
Ben Skeggs a9bc247cbb drm/nouveau/pm: detect when we need dll disabled for gddr3
Fixes minor flickering on NVS295 when at perflvl 0.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Martin Peres <martin.peres@labri.fr>
2012-03-13 17:08:54 +10:00
Ben Skeggs 0ce7141558 drm/nv50: fix detection of second vram rank
Goes a long way to correcting NVS295 memory reclocking issues.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Martin Peres <martin.peres@labri.fr>
2012-03-13 17:08:51 +10:00
Ben Skeggs 1a7287ea6f drm/nouveau/pm: track mr2 for gddr3
There's some "extended" GDDR3 chipsets out there with EMRS2 settings that
change the layout of MRS/EMRS1 bitmaps.. Sigh.. Still need to track down
how exactly we're supposed to handle this.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Martin Peres <martin.peres@labri.fr>
2012-03-13 17:08:44 +10:00
Martin Peres c57ebf5ef3 drm/nv50/pm: wait for all fifo-connected engines to idle before reclocking
Signed-off-by: Martin Peres <martin.peres@labri.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-03-13 17:08:38 +10:00
Ben Skeggs 496a73bbec drm/nv50/pm: use hwsq for engine reclocking too
Idea from Martin Peres, different implementation by me.

v2: Martin Peres:
- fix mast calculation

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Martin Peres <martin.peres@labri.fr>
2012-03-13 17:08:32 +10:00
Ben Skeggs e495d0d7e3 drm/nv50/disp: more accurate function to determine active crtcs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Martin Peres <martin.peres@labri.fr>
2012-03-13 17:08:29 +10:00
Ben Skeggs 6bdf68c9a4 drm/nv50/pm: initial work towards proper memory reclocking, with timings
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Martin Peres <martin.peres@labri.fr>
2012-03-13 17:08:18 +10:00
Ben Skeggs 2d85bc8855 drm/nouveau/pm: introduce ram reclocking helper
This will probably result in more lines of code, however, we're going to
have at least 3 slightly different implementations of this very soon and
I'd rather keep the ram reclocking logic separate from the hw specifics.

DDR2/DDR3/GDDR3 implemented thus far, others will be added as necessary.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Martin Peres <martin.peres@labri.fr>
2012-03-13 17:08:13 +10:00
Ben Skeggs 085028ce3b drm/nouveau/pm: embed timings into perflvl structs
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Martin Peres <martin.peres@labri.fr>
2012-03-13 17:08:06 +10:00
Ben Skeggs fd99fd6100 drm/nouveau/pm: calculate memory timings at perflvl creation time
Statically generating the PFB register and MR values for each timing set
turns out to be insufficient.  There's at least one (so far) known piece
of information which effects MR values which is stored in the perflvl
entry on some chipsets (and in another table on later ones), which is
disconnected from the timing table entries.

After this change we will generate a timing set based on an input clock
frequency instead, and have this data stored in the performance level
data.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Martin Peres <martin.peres@labri.fr>
2012-03-13 17:08:03 +10:00
Ben Skeggs 68a64cad07 drm/nouveau/pm: readback boot perflvl *before* parsing vbios
We might want/need the boot data to generate the other perflevels.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Martin Peres <martin.peres@labri.fr>
2012-03-13 17:07:55 +10:00
Roy Spliet c7c039fd31 drm/nouveau/pm: implement DDR2/DDR3/GDDR3/GDDR5 MR generation and validation
Roy Spliet:
- Implement according to specs
- Simplify
- Make array for mc latency registers

Martin Peres:
- squash and split all the commits from Roy
- rework following Ben Skeggs comments
- add a form of timings validation
- store the initial timings for later use

Ben Skeggs
- merge slightly modified tidy-up patch with this one
- remove perflvl-dropping logic for the moment

Signed-off-by: Roy Spliet <r.spliet@student.tudelft.nl>
Signed-off-by: Martin Peres <martin.peres@labri.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-03-13 17:07:50 +10:00
Ben Skeggs 03ddf04bdb drm/nouveau/pm: restructure bios table parsing
It turns out we need access to some additional information in various VBIOS
tables to handle PFB memory timings correctly.

Rather than hack in parsing of the new stuff in some kludgy way, I've
restructured the VBIOS parsing to be more primitive, so we can use them in
more flexible ways in the future.

The perflvl->timing association code is disabled for the moment until it can
be reworked.  We don't use this stuff yet anyway, so no harm done.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Martin Peres <martin.peres@labri.fr>
2012-03-13 17:07:00 +10:00
Ben Skeggs 3d8a408c43 drm/nouveau/pm: avoid potential divide-by-zero
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Martin Peres <martin.peres@labri.fr>
2012-03-13 17:06:53 +10:00
Jean Delvare 1a5f985c17 drm/nouveau: Fix module parameter description formats
Module parameter descriptions don't take a trailing \n, otherwise it
breaks formatting of modinfo's output. Also remove trailing space.

Signed-off-by: Jean Delvare <jdelvare@suse.de>
Cc: David Airlie <airlied@linux.ie>
Cc: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-03-13 17:06:38 +10:00
Roy Spliet bfb3146524 drm/nouveau/pm: improve memory timing generation
- Rename several VBIOS entries to closer match the real world
- Add the missing 0x100238 and 0x100240 register values
- Parse bit 14 of the VBIOS timing table
- "Magic value" -> tCWL, fixing some minor bugs in the process
- Also name a few more by their name rather than their number.
- Some values seem to be dependent on the memory type. Fix

Edits by Martin Peres <martin.peres@labri.fr>:
- this is a squash commit
- reworked for fixing some style issues

Signed-off-by: Roy Spliet <r.spliet@student.tudelft.nl>
Signed-off-by: Martin Peres <martin.peres@labri.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-03-13 17:06:26 +10:00
Martin Peres b010374709 drm/nouveau/pm: improve the reclocking logs' readability
Signed-off-by: Martin Peres <martin.peres@labri.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-03-13 17:06:19 +10:00
Martin Peres b1aa5531cc drm/nouveau: move pwm_divisor to the nouveau_pm_fan struct
Signed-off-by: Martin Peres <martin.peres@labri.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-03-13 17:06:11 +10:00
Martin Peres bc6389e4fa drm/nouveau/pm: restore fan speed after suspend
Signed-off-by: Martin Peres <martin.peres@labri.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-03-13 17:06:07 +10:00
Martin Peres ddb2005516 drm/nouveau/pm: style fixes
Signed-off-by: Martin Peres <martin.peres@labri.fr>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-03-13 17:06:04 +10:00
Ben Skeggs 668b6c097d drm/nouveau: rework the init/takedown ordering
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-03-13 17:05:58 +10:00
Ben Skeggs f3298532f7 drm/nvc0: add initial memory type detection
Uses only the VBIOS tables, from what I can tell this is what NVIDIA do
too, I was able to change the detected memory type by modifying this table
on a NVC1 chipset.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-03-13 17:05:52 +10:00
Ben Skeggs c70c41e89f drm/nv50: hopefully handle the DDR2/DDR3 memtype detection somewhat better
M version 2 appears to have a table with some form of memory type info
available.

NVIDIA appear to ignore the table information except for this DDR2/DDR3
case (which has the same value in 0x100714).  My guess is this is due to
some of the supported memory types not being represented in the table.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-03-13 17:05:46 +10:00
Ben Skeggs 1072856a1c drm/nv50: add memory type detection
DDR1/DDR[23] confirmed on NVA8 (see note about DDR3 in source) by changing
the value and watching the binary driver's behaviour.

GDDR3/4 values confirmed on a NV96 via the same method above.  That GDDR4
is present is interesting, as far as I can see no boards using it were ever
released.

GDDR5 value is based on VBIOS images of known GDDR5 boards.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-03-13 17:05:40 +10:00
Ben Skeggs ff92a6cda7 drm/nv20-nv40: add memory type detection
NV20/NV30 is partially educated guesswork at this point, based on any
information around about available memory types and a horribly unspeakable
amount of vbios image scouring.  I'm not entirely certain the GDDR3 define
is correct, I have not spotted a single vbios with that value yet (though
it is mentioned in some 1218-using nv4x vbios), but there are reports that
some nv3x did use it..

NV40(100914) confirmed by switching an NV49 to DDR1/DDR2 values and making
sure that the binary driver behaviour showed it had detected DDR1/DDR2
instead of GDDR3 before dying horribly.

NV40(100474) confirmed by doing much the same task as above on an NV44,
except this was *much* easier as changing the values didn't seem to have
any noticable effect on the memory controller aside from changing the
binary driver's behaviour.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-03-13 17:05:35 +10:00
Ben Skeggs d81c19e312 drm/nv20: split PFB code out of nv10_fb.c
Most functions were quite different between NV10/NV20 already, and they're
about to get even more so.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-03-13 17:05:29 +10:00
Ben Skeggs ddfd2da484 drm/nouveau: memory type detection for the really old chipsets
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-03-13 17:05:23 +10:00
Ben Skeggs 7ad2d31cb6 drm/nouveau: move vram detection funcs to chipset-specific fb code
Also, display detected memory type in logs - though, we don't even try to
detect this yet.

Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
2012-03-13 17:05:20 +10:00
Kirill A. Shutemov 8e18db815c gma500: psb_irq: mark mid_{enable, disable}_pipe_event() as static
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-10 13:06:40 +00:00
Kirill A. Shutemov f42aaa6f7c gma500: mark psb_intel_sdvo_hdmi_sink_detect() as static
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-10 13:06:39 +00:00
Kirill A. Shutemov 2e33d6b92f gma500: psb_intel_display: drop unused variables
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-10 13:06:38 +00:00
Kirill A. Shutemov 3c1d08d7af gma500: mark psb_intel_pipe_set_base() as static
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-10 13:06:37 +00:00
Kirill A. Shutemov 412a3df1ce gma500: drop unused psb_intel_modeset_cleanup()
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-10 13:06:35 +00:00
Kirill A. Shutemov cc2e991c15 gma500: oaktrail_lvds_init() drop unused variable
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-10 13:06:35 +00:00
Kirill A. Shutemov 1e30296a60 gma500: oaktrail_hdmi_i2c_access() drop unused variable
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-10 13:06:34 +00:00
Kirill A. Shutemov 771f64d027 gma500: mark oaktrail_backlight_init() as static
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-10 13:06:33 +00:00
Kirill A. Shutemov 6e7f45736e gma500: oaktrail_hdmi: fix -Wmissing-field-initializers warning
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-10 13:06:32 +00:00
Kirill A. Shutemov e1bb07cbe1 gma500: oaktrail_hdmi: drop dead code
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-10 13:06:31 +00:00
Kirill A. Shutemov 4398e58c5f gma500: oaktrail_crtc: drop unused variables
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-10 13:06:30 +00:00
Kirill A. Shutemov 44332ddfeb gma500: oaktrail_crtc: mark few functions as static
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-10 13:06:29 +00:00
Kirill A. Shutemov cbc5a1850d gma500: mdfld_intel_display: drop unused variables
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-10 13:06:28 +00:00
Kirill A. Shutemov c7a5ae2f23 gma500: mdfld_dsi_pkg_sender: fix -Wtype-limits warning
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-10 13:06:28 +00:00
Kirill A. Shutemov e4b9ff716f gma500: mdfld_dsi_dpi: drop unused variables
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-10 13:06:27 +00:00
Kirill A. Shutemov 1c6a62680b gma500: mdfld_device: mark few functions as static
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-10 13:06:26 +00:00
Kirill A. Shutemov 062d054eb3 gma500: cdv_intel_lvds: #if 0 currently unused functions
cdv_intel_lvds_set_brightness() is only used in commented out code in
cdv_set_brightness().

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-10 13:06:25 +00:00
Kirill A. Shutemov bc11da70ac gma500: cdv_intel_lvds: mark few functions as static
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-10 13:06:24 +00:00
Kirill A. Shutemov 455b9e91f2 gma500: cdv_intel_hdmi: add missing include
drivers/gpu/drm/gma500/cdv_intel_hdmi.c:305:6: warning: no previous prototype for 'cdv_hdmi_init' [-Wmissing-prototypes]

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-10 13:06:23 +00:00
Kirill A. Shutemov 657da160cc gma500: cdv_intel_crt: mark few functions as static
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-10 13:06:21 +00:00
Kirill A. Shutemov 0313c0de54 gma500: cdv_intel_crt: drop unused variables
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-10 13:06:20 +00:00
Kirill A. Shutemov a8ec622965 gma500: cdv_intel_crt: drop dead code
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-10 13:06:18 +00:00
Kirill A. Shutemov 2acdc9fa7e gma500: cdv_intel_crt: add missing include
drivers/gpu/drm/gma500/cdv_intel_crt.c:273:6: warning: no previous prototype for 'cdv_intel_crt_init' [-Wmissing-prototypes]

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-03-10 13:06:17 +00:00