Dave Airlie [Tue, 13 Mar 2012 10:16:06 +0000 (10:16 +0000)]
Merge branch 'drm-nouveau-next' of git://anongit.freedesktop.org/git/nouveau/linux-2.6 into drm-core-next
* 'drm-nouveau-next' of git://anongit.freedesktop.org/git/nouveau/linux-2.6: (57 commits)
drm/nouveau: map first page of mmio early and determine chipset earlier
drm/nvd0/disp: disconnect encoders before reprogramming them
drm/nvd0/disp: move syncs/magic setup to or mode_set
drm/nouveau/dp: account for channel coding overhead in link training
drm/nvd0/disp: fix dcb sor link matching in supervisor handler
drm/nvd0/disp: initial implementation of displayport
drm/nouveau/dp: make dp dpms function common, call from sor code instead
drm/nv50/hwsq: some nv92 fixes
drm/nouveau/dp: move all nv50/sor-specific code out of nouveau_dp.c
drm/nouveau/dp: make functions for executing various bios tables
drm/nouveau/pm: fix oops if chipset has no pm support at all
drm/nouveau/bios: rework vbios shadowing
drm/nouveau/bios: attempt acpi rom fetch before pcirom
drm/nvd0/disp: attempt to handle more than 2 crtcs if possible
drm/nvc0/vram: get part count from PUNITS
drm/nv40/pm: fix fanspeed regression
drm/nouveau/pm: several fixes for nvc0 memory timings
drm/nvc0/pm: restrict pll mode to clocks that can actually use it
drm/nouveau/dp: fix bad comparison in dp_link_train_commit()
drm/nouveau/mxm: call mxmi to determine revision before calling mxms
...
Ben Skeggs [Mon, 12 Mar 2012 01:42:20 +0000 (11:42 +1000)]
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.
Xi Wang [Fri, 3 Feb 2012 16:13:55 +0000 (11:13 -0500)]
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>
Ben Skeggs [Wed, 1 Feb 2012 23:33:05 +0000 (09:33 +1000)]
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..
Ben Skeggs [Thu, 12 Jan 2012 05:34:54 +0000 (15:34 +1000)]
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>
Ben Skeggs [Tue, 24 Jan 2012 00:24:05 +0000 (10:24 +1000)]
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>
Ben Skeggs [Mon, 23 Jan 2012 03:12:09 +0000 (13:12 +1000)]
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>
Ben Skeggs [Tue, 17 Jan 2012 11:10:58 +0000 (21:10 +1000)]
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>
Roy Spliet [Mon, 9 Jan 2012 05:23:07 +0000 (15:23 +1000)]
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>
Ben Skeggs [Mon, 16 Jan 2012 12:34:03 +0000 (22:34 +1000)]
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>
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>
Roy Spliet [Fri, 25 Nov 2011 14:52:22 +0000 (15:52 +0100)]
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>
Ben Skeggs [Tue, 13 Dec 2011 02:46:18 +0000 (12:46 +1000)]
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.
Ben Skeggs [Tue, 13 Dec 2011 01:57:55 +0000 (11:57 +1000)]
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.
Ben Skeggs [Mon, 12 Dec 2011 23:45:25 +0000 (09:45 +1000)]
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.
Ben Skeggs [Mon, 12 Dec 2011 13:03:14 +0000 (23:03 +1000)]
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.
Dave Airlie [Sat, 10 Mar 2012 13:10:41 +0000 (13:10 +0000)]
Merge branch 'drm-gma500-alanc' into drm-core-next
* drm-gma500-alanc: (47 commits)
gma500: psb_irq: mark mid_{enable, disable}_pipe_event() as static
gma500: mark psb_intel_sdvo_hdmi_sink_detect() as static
gma500: psb_intel_display: drop unused variables
gma500: mark psb_intel_pipe_set_base() as static
gma500: drop unused psb_intel_modeset_cleanup()
gma500: oaktrail_lvds_init() drop unused variable
gma500: oaktrail_hdmi_i2c_access() drop unused variable
gma500: mark oaktrail_backlight_init() as static
gma500: oaktrail_hdmi: fix -Wmissing-field-initializers warning
gma500: oaktrail_hdmi: drop dead code
gma500: oaktrail_crtc: drop unused variables
gma500: oaktrail_crtc: mark few functions as static
gma500: mdfld_intel_display: drop unused variables
gma500: mdfld_dsi_pkg_sender: fix -Wtype-limits warning
gma500: mdfld_dsi_dpi: drop unused variables
gma500: mdfld_device: mark few functions as static
gma500: cdv_intel_lvds: #if 0 currently unused functions
gma500: cdv_intel_lvds: mark few functions as static
gma500: cdv_intel_hdmi: add missing include
gma500: cdv_intel_crt: mark few functions as static
...
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
gma500: fix two -Wmissing-field-initializers warnings
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>
gma500: mark psb_driver_device_is_agp() and psb_driver_preclose() 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>
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>
Move DRM_GMA_GET_PIPE_FROM_CRTC_ID to 0x08 to avoid confict with
DRM_GMA_GEM_MMAP.
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>
gma500: use DRM_IOCTL_DEF_DRV instead of custom PSB_IOCTL_DEF
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>
gma500: mmu: mark psb_mmu_free_pt() and psb_mmu_pt_alloc_map_lock() 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>
gma500: mmu: drop unused psb_get_default_pd_addr()
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>
gma500: gtt: mark psb_gtt_entry() and psb_gtt_alloc() 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>
gma500: mark psb_fbdev_destroy() and psb_fbdev_fini() 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>
gma500: drop unused psbfb_suspend()/psbfb_resume()
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>
drivers/gpu/drm/gma500/gem_glue.c:23:6: warning: no previous prototype for ‘drm_gem_object_release_wrap’ [-Wmissing-prototypes]
drivers/gpu/drm/gma500/gem_glue.c:44:5: warning: no previous prototype for ‘gem_create_mmap_offset’ [-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>
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>
gma500: mdfld_dsi_output_init() drop unused parameter
Nobody uses 'config' parameter.
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>
gma500: psbfb_create(): move depth initialization out of loop
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>
We need to merge this ahead of some of the cleanup because a lot of needed
cleanup spans both new and old chips. If we try and clean up and the merge
we end up fighting ourselves.
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
[With a load of the cleanup stuff folded in, register stuff reworked sanely] Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Alan Cox [Thu, 8 Mar 2012 16:02:05 +0000 (16:02 +0000)]
gma500: rework register stuff sanely
Rework registers handling to prepare for Medfield.
Signed-off-by: Alan Cox <alan@linux.intel.com>
[split out from a single big patch] Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
gma500: make init_pm callback in struct psb_op optional
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>