drm/gma500: Activate the gtt rebuild on suspend/resume
This patch activates the rebuilding of the gtt. Currently we reinitialize the
gtt by inserting the stolen pages again and map the rest to our scratch page.
Then we go about restoring the needed ranges. This is a bit overkill but right
now we don't have that much to restore so better safe than sorry.
Kero van Gelder [Sun, 31 Mar 2013 11:38:44 +0000 (13:38 +0200)]
gma500: Make VGA and HDMI connector hotpluggable
Both VGA and HDMI connectors are available on my Asus EeePC X101CH.
This patch will cause output to be shown on either when plugged in.
For both, it shows the leftmost 800x600, of the 1024x600 on LVDS.
Signed-off-by: Kero van Gelder <kero@chello.nl> Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Wang YanQing [Wed, 13 Mar 2013 08:19:55 +0000 (16:19 +0800)]
gma500: remove unused drm_psb_no_fb
commit f9f23a77f07506a32d9dc1d925bf85c0e7507b66(gma500: remove no_fb bits)
remove all the drm_psb_no_fb relations code in gma500 except this line code,
so remove it also.
Signed-off-by: Wang YanQing <udknight@gmail.com> Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Stephen Rothwell [Mon, 25 Feb 2013 23:54:48 +0000 (09:54 +1000)]
drm/tilcdc: only build on arm
[airlied: hack for now until we fix cma helpers on other OF platforms] Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Dave Airlie <airlied@linux.ie>
Dave Airlie [Sun, 24 Feb 2013 02:39:42 +0000 (12:39 +1000)]
Merge branch 'drm/hdmi-for-3.9' of git://anongit.freedesktop.org/tegra/linux into drm-next
Thierry writes:
"Remove a duplicate implementation of the CEA VIC lookup and move the CEA
and other mode tables to drm_edid.c to make it more difficult to create
duplicates of the tables.
Add some helpers to pack CEA-861/HDMI AVI, audio and SPD infoframes into
binary buffers that can easily be written into hardware registers. A new
helper function makes it easy construct an AVI infoframe from a DRM
display mode.
Convert the Tegra and Radeon drivers to use the new HDMI helpers."
* 'drm/hdmi-for-3.9' of git://anongit.freedesktop.org/tegra/linux:
drm/radeon: Use generic HDMI infoframe helpers
drm/tegra: Use generic HDMI infoframe helpers
drm: Add EDID helper documentation
drm: Add HDMI infoframe helpers
video: Add generic HDMI infoframe helpers
drm: Add some missing forward declarations
drm: Move mode tables to drm_edid.c
drm: Remove duplicate drm_mode_cea_vic()
Dave Airlie [Sun, 24 Feb 2013 02:38:22 +0000 (12:38 +1000)]
Merge branch 'drm/tegra-for-3.9' of git://anongit.freedesktop.org/tegra/linux into drm-next
Thierry writes:
"Add support for 2 hardware overlays found on Tegra. These support YUV
pixel formats and can be used as video overlays. .mode_set_base() is
implemented and support for VBLANK and page-flipping is added.
A few minor bug fixes are also included and a new debugfs file allows
to inspect the framebuffers attached to the Tegra DRM device."
* 'drm/tegra-for-3.9' of git://anongit.freedesktop.org/tegra/linux:
drm/tegra: Add list of framebuffers to debugfs
drm/tegra: Fix color expansion
drm/tegra: Split DC_CMD_STATE_CONTROL register write
drm/tegra: Implement page-flipping support
drm/tegra: Implement VBLANK support
drm/tegra: Implement .mode_set_base()
drm/tegra: Add plane support
drm/tegra: Remove bogus tegra_framebuffer structure
drm: Add consistency check for page-flipping
drm/i915/hdmi: Read the HPD status before trying to read the EDID
They reliably cause HDMI to not be detected on some systems (like my
ivb or the bug reporters gm45). To fix up the very slow unplug issues
we might want to fire up a 2nd detect cycle a few hundred ms after
each hotplug. But for now at least make displays work again.
I somewhat suspect that this is confined to HDMI connectors, since all
the machines I have with DP+ outputs work correctly.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=52361 Cc: Damien Lespiau <damien.lespiau@intel.com> Cc: Jani Nikula <jani.nikula@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: stable@vger.kernel.org.kernel.org # for 8ec22b21 Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Thierry Reding [Wed, 28 Nov 2012 10:45:47 +0000 (11:45 +0100)]
drm/tegra: Implement VBLANK support
Implement support for the VBLANK IOCTL. Note that Tegra is somewhat
special in this case because it doesn't use the generic IRQ support
provided by the DRM core (DRIVER_HAVE_IRQ) but rather registers one
interrupt handler for each display controller.
While at it, clean up the way that interrupts are enabled to ensure
that the VBLANK interrupt only gets enabled when required.
Thierry Reding [Wed, 28 Nov 2012 10:38:24 +0000 (11:38 +0100)]
drm/tegra: Implement .mode_set_base()
The sequence for replacing the scanout buffer is much shorter than a
full mode change operation so implementing this callback considerably
speeds up cases where only a new framebuffer is to be scanned out.
Thierry Reding [Sun, 4 Nov 2012 20:47:13 +0000 (21:47 +0100)]
drm/tegra: Add plane support
Add support for the B and C planes which support RGB and YUV pixel
formats and can be used as overlays or hardware cursor. Currently 32-bit
XRGB as well as UYVY, YUV420 and YUV422 pixel formats are advertised.
Other formats should be easy to add but these are the most common ones
and should cover the majority of use-cases.
Thierry Reding [Wed, 13 Feb 2013 15:08:33 +0000 (16:08 +0100)]
drm: Add consistency check for page-flipping
Driver implementations of the drm_crtc's .page_flip() function are
required to update the crtc->fb field on success to reflect that the new
framebuffer is now in use. This is important to keep reference counting
on the framebuffers balanced.
While at it, document this requirement to keep others from falling into
the same trap.
Suggested-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Thierry Reding [Wed, 21 Nov 2012 14:00:47 +0000 (15:00 +0100)]
drm: Add some missing forward declarations
The drm_file and drm_clip_rect structures are used throughout the file
but they are never declared nor pulled in through an include. Add
forward declarations to make them available.
Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Thierry Reding [Fri, 23 Nov 2012 14:01:42 +0000 (15:01 +0100)]
drm: Move mode tables to drm_edid.c
The modes are only used from within drm_edid.c so we move them there to
avoid creating duplicates by multiple inclusion of drm_edid_modes.h. As
a side-effect we can also get rid of a few variables that keep track of
the number of entries in the tables and use ARRAY_SIZE() instead.
Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Thierry Reding [Thu, 20 Dec 2012 14:41:44 +0000 (15:41 +0100)]
drm: Remove duplicate drm_mode_cea_vic()
The same function had already been merged with a different name. Remove
the duplicate one but reuse some of its kerneldoc fragments for the
existing implementation.
Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Dave Airlie [Fri, 22 Feb 2013 00:17:11 +0000 (10:17 +1000)]
Merge branch 'exynos-drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos into drm-next
The summary:
. Add display mode check operaion to mixer driver
- Mixer IP also can put certain restrictions on the proposed
display modes and these restrictions need to be considered
during mode negotiation, which happens immediately after
edid parsing.
. Set correct mode for range of resolutions
- With this patch, the mixer driver could find the correct mode
for the range of resolutions upto 1080 vertical lines.
. Support extra resolution for hdmi
- This patch programs the core and timing generator registers
using the timing data provided in drm_display_mode without
hard-coded configurations. So this patch adds additional PHY
configs to allow us to support more permissible resolutions
and refresh rates.
. Add device tree support for g2d
- This patch adds just the compatible string for exynos5250 SoC
so that with device tree enabling, this driver can be probed.
. And bug fixes and code cleanups.
* 'exynos-drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos:
drm/exynos: Add device tree based discovery support for G2D
drm/exynos: hdmi: support extra resolutions using drm_display_mode timings
drm/exynos: mixer: set correct mode for range of resolutions
drm/exynos: implement display-mode-check callback in mixer driver
drm/exynos: add display-mode-check operation to exynos_mixer_ops struct
drm/exynos: release resources properly when fb creation is failed.
drm/exynos: fix wrong pointer access at vm close.
drm/exynos: Add missing braces around sizeof
drm/exynos: consider exception case to fb handle creation
drm/exynos: fix iommu address allocation order
Patrik Jakobsson [Sat, 16 Feb 2013 12:04:21 +0000 (13:04 +0100)]
gma500: Fix n, m1 and m2 clock limits for sdvo and lvds
The values of n, m1 and m2 needs to be subtracted by 2 before writing them to
the FP register. The dot clock calculation already thinks of these values in
register form so we must also specify them as such.
Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Chris Wilson [Thu, 21 Feb 2013 20:04:31 +0000 (20:04 +0000)]
drm/i915: Handle untiled planes when computing their offsets
We trim the fb to fit the CRTC by computing the offset of that CRTC to
its nearest tile_row origin. This allows us to use framebuffers that are
larger than the CRTC limits without additional work.
However, we failed to compute the offset for a linear framebuffer
correctly as we treated its x-advance in whole tiles (instead of the
linear increment expected), leaving the CRTC misaligned with its
contents.
drm/i915: adjust framebuffer base address on gen4+
v2: Adjust relative x-coordinate after linear alignment (vsyrjala)
v3: Repaint with pokadots (vsyrjala)
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=61152 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: stable@vger.kernel.org Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Sean Paul [Tue, 15 Jan 2013 13:11:08 +0000 (08:11 -0500)]
drm/exynos: hdmi: support extra resolutions using drm_display_mode timings
This patch programs the core and timing generator registers using the
timing data provided in drm_display_mode and not using hard-coded
configurations.
Additional PHY configs has been added. This allows us to support more
permissible resolutions and refresh rates.
Signed-off-by: Rahul Sharma <rahul.sharma@samsung.com> Signed-off-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Shirish S <s.shirish@samsung.com> Signed-off-by: Akshay Saraswat <Akshay.s@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
Rahul Sharma [Tue, 15 Jan 2013 13:11:07 +0000 (08:11 -0500)]
drm/exynos: mixer: set correct mode for range of resolutions
With this patch, mixer driver find the correct resolution mode for
the range of resolutions, upto 1080 vertical lines. Resolution will
be categorized to NTSC SD, PAL SD or HD and the correct mode is
set to the mixer configuration register.
Signed-off-by: Rahul Sharma <rahul.sharma@samsung.com> Signed-off-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Inki Dae <inki.dae@samsung.com>
Rahul Sharma [Tue, 15 Jan 2013 13:11:06 +0000 (08:11 -0500)]
drm/exynos: implement display-mode-check callback in mixer driver
This patch adds the implementation of check_timing callback in the mixer
driver. Based on the mixer version, correct set of restrictions will be
exposed by the mixer driver. A resolution will be acceptable only if passes
the criteria set by mixer and hdmi IPs.
Signed-off-by: Rahul Sharma <rahul.sharma@samsung.com> Signed-off-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Inki Dae <inki.dae@samsung.com>
Rahul Sharma [Tue, 15 Jan 2013 13:11:05 +0000 (08:11 -0500)]
drm/exynos: add display-mode-check operation to exynos_mixer_ops struct
This patch adds the display mode check operation to exynos_mixer_ops
in drm-common-hdmi. In Exynos SoCs, mixer IP can put certain restrictions
on the proposed display modes. These restriction needs to be considered
during mode negotiation, which happens immediately after edid parsing.
Both, mixer check-mode and hdmi check-timing callbacks are called one after
another and ANDed result is returned back.
Signed-off-by: Rahul Sharma <rahul.sharma@samsung.com> Reviewed-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Inki Dae <inki.dae@samsung.com>
YoungJun Cho [Thu, 7 Feb 2013 07:17:54 +0000 (16:17 +0900)]
drm/exynos: fix wrong pointer access at vm close.
This patch fixes wrong pointer access issue to filp->f_op and
filp->private_data.
The exynos_drm_gem_mmap_ioctl() changes filp->f_op and
filp->private_data temporarily and restore them to use
original ones in exynos_drm_gem_mmap_buffer() but there
was no lock between the changing and the restoring so
wrong pointer access to filp->f_op and filp->private_data
was induced by vm close callback.
So this patch uses mutex lock properly to resolve this issue.
Signed-off-by: YoungJun Cho <yj44.cho@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Dave Airlie [Wed, 20 Feb 2013 21:15:10 +0000 (07:15 +1000)]
Merge branch 'drm-next-3.9' of git://people.freedesktop.org/~agd5f/linux into drm-next
More drm-next bits for radeon. Just bug fixes.
* 'drm-next-3.9' of git://people.freedesktop.org/~agd5f/linux:
drm/radeon: properly validate the atpx interface
drm/radeon: switch get_gpu_clock() to a callback (v2)
drm/radeon: add a asic callback to get the xclk
drm/radeon: Avoid NULL pointer dereference from atom_index_iio() allocation failure
drm/radeon: remove overzealous warning in hdmi handling
drm/radeon: fix multi-head power profile stability on BTC+ asics
Dave Airlie [Wed, 20 Feb 2013 21:13:17 +0000 (07:13 +1000)]
Merge branch 'drm-nouveau-next' of git://anongit.freedesktop.org/git/nouveau/linux-2.6 into drm-next
restore debugfs vbios, fix multiple actions with supervisor intrs
* 'drm-nouveau-next' of git://anongit.freedesktop.org/git/nouveau/linux-2.6:
drm/nouveau: restore debugfs/vbios.rom support
drm/nv50-/kms: remove UPDATE methods after each encoder disconnect
drm/nvd0/disp: handle multiple actions from one set of supervisor intrs
drm/nv50/disp: handle multiple actions from one set of supervisor intrs
Alex Deucher [Thu, 14 Feb 2013 15:04:02 +0000 (10:04 -0500)]
drm/radeon: add a asic callback to get the xclk
This is required to get the reference clock used
by the gfx engine for things like timestamps. Fixes
support for GL extensions the use timestamps on
certain boards.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Lee, Chun-Yi [Wed, 20 Feb 2013 06:32:01 +0000 (14:32 +0800)]
gpu: remove gma500 stub driver
In v3.3, the gma500 drm driver moved from staging to drm group by
Alan Cox's 3abcf41fb patch. the gma500 drm driver should control
brightness well and don't need gma500 stub driver anymore.
Dave Airlie [Wed, 20 Feb 2013 07:46:25 +0000 (17:46 +1000)]
Merge branch 'drm-nouveau-next' of git://anongit.freedesktop.org/git/nouveau/linux-2.6 into drm-next
Nothing terribly exciting in here probably:
- reworked thermal stuff from mupuf/I, has a chance of possibly working
well enough when we get to being able to reclock..
- driver will report mmio access faults on chipsets where it's supported
- will now sleep waiting on fences on nv84+ rather than polling
- some cleanup of the internal fencing, looking towards sli/dmabuf sync
- initial support for anx9805 dp/tmds encoder
- nv50+ display fixes related to the above, and also might fix a few
other issues
- nicer error reporting (will log process names with channel errors)
- various other random fixes
* 'drm-nouveau-next' of git://anongit.freedesktop.org/git/nouveau/linux-2.6: (87 commits)
nouveau: ACPI support depends on X86 and X86_PLATFORM_DEVICES
drm/nouveau/i2c: add support for ddc/aux, and dp link training on anx9805
drm/nv50: initial kms support for off-chip TMDS/DP encoders
drm/nv50-/disp: initial supervisor support for off-chip encoders
drm/nv50-/disp: initial work towards supporting external encoders
drm/nv50-/kms: remove unnecessary wait-for-completion points
drm/nv50-/disp: move DP link training to core and train from supervisor
drm/nv50-/disp: handle supervisor tasks from workqueue
drm/nouveau/i2c: create proper chipset-specific class implementations
drm/nv50-/disp: 0x0000 is a valid udisp config value
drm/nv50/devinit: reverse the logic for running encoder init scripts
drm/nouveau/bios: store a type/mask hash in parsed dcb data
drm/nouveau/i2c: extend type to 16-bits, add lookup-by-type function
drm/nouveau/i2c: aux channels not necessarily on nvio
drm/nouveau/i2c: fix a bit of a thinko in nv_wri2cr helper functions
drm/nouveau/bios: parse external transmitter type if off-chip
drm/nouveau: store i2c port pointer directly in nouveau_encoder
drm/nouveau/i2c: handle i2c/aux mux outside of port lookup function
drm/nv50/graph: avoid touching 400724, it doesn't exist
drm/nouveau: Fix DPMS 1 on G4 Snowball, from snow white to coal black.
...
Ben Hutchings [Wed, 20 Feb 2013 02:57:32 +0000 (02:57 +0000)]
nouveau: ACPI support depends on X86 and X86_PLATFORM_DEVICES
If I build nouveau on ia64, Kconfig warns:
warning: (DRM_NOUVEAU) selects ACPI_WMI which has unmet direct dependencies (X86 && X86_PLATFORM_DEVICES && ACPI)
warning: (DRM_NOUVEAU) selects MXM_WMI which has unmet direct dependencies (X86 && X86_PLATFORM_DEVICES && ACPI_WMI)
Make all the ACPI support depend on X86 and select
X86_PLATFORM_DEVICES.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Tue, 19 Feb 2013 04:17:53 +0000 (23:17 -0500)]
drm/nv50-/disp: move DP link training to core and train from supervisor
We need to be able to do link training for PIOR-connected ANX9805 from
the third supervisor handler (due to script ordering in the bios, can't
have the "user" call train because some settings are overwritten from
the modesetting bios scripts).
This moves link training for SOR-connected DP encoders to the second
supervisor interrupt, *before* we call the modesetting scripts (yes,
different ordering from PIOR is necessary). This is useful since we
should now be able to remove some hacks to workaround races between
the supervisor and link training paths.
Ben Skeggs [Sat, 16 Feb 2013 02:10:38 +0000 (12:10 +1000)]
drm/nv50/devinit: reverse the logic for running encoder init scripts
A single U encoder table can match multiple DCB entries, whereas the
reverse is not true and can lead to us not matching a DCB entry at
all, and fail to initialise some encoders.
Ben Skeggs [Sat, 16 Feb 2013 03:19:18 +0000 (13:19 +1000)]
drm/nouveau/i2c: extend type to 16-bits, add lookup-by-type function
For off-chip transmitters we won't necessarily have an i2c table entry
to lookup, but we can do it instead by encoding the type to include
the extdev type and looking that up instead.
Ben Skeggs [Mon, 11 Feb 2013 10:15:03 +0000 (20:15 +1000)]
drm/nouveau: store i2c port pointer directly in nouveau_encoder
This is about to become somewhat more complicated to determine in a
number of cases, so store the "common" case (DDC/AUX) directly inside
the encoder structure.
Pre-nv50 code not touched except to fill the pointer, don't care.
Ben Skeggs [Mon, 11 Feb 2013 10:06:04 +0000 (20:06 +1000)]
drm/nouveau/i2c: handle i2c/aux mux outside of port lookup function
Not quite how I want it yet, but, I'll fix that at some point. For
right now, it's needed because find() won't necessarily be used right
before a transaction anymore.
Signed-off-by: Stefan de Konink <stefan@konink.de> Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Dan Carpenter [Wed, 23 Jan 2013 08:27:56 +0000 (11:27 +0300)]
drm/nouveau/disp: sizeof() wrong pointer
"data" is a void pointer and "args" is "data" after we have casted it to
a struct. We care about the size of the struct here. Btw,
sizeof(*data) is 1.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Ben Skeggs [Wed, 13 Feb 2013 23:28:37 +0000 (09:28 +1000)]
drm/nv84/fence: access fences with full virtual address, not offset
Allows most of the code to be shared between nv84/nvc0 implementations,
and paves the way for doing emit/sync on non-VRAM buffers (multi-gpu,
dma-buf).