]> git.karo-electronics.de Git - karo-tx-linux.git/log
karo-tx-linux.git
8 years agodrm/exynos: move dma_addr attribute from exynos plane to exynos fb
Marek Szyprowski [Mon, 30 Nov 2015 13:53:21 +0000 (14:53 +0100)]
drm/exynos: move dma_addr attribute from exynos plane to exynos fb

DMA address is a framebuffer attribute and the right place for it is
exynos_drm_framebuffer not exynos_drm_plane. This patch also introduces
helper function for getting dma address of the given framebuffer.

Changelog v2:
- use state->fb instead of plane->base.fb.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
8 years agodrm/exynos: exynos7-decon: remove excessive check
Marek Szyprowski [Mon, 30 Nov 2015 13:53:20 +0000 (14:53 +0100)]
drm/exynos: exynos7-decon: remove excessive check

Display area is already checked by exynos plane core, so there is no
need for such check in driver code.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
8 years agodrm/exynos: rotator: convert to common clock framework
Marek Szyprowski [Mon, 30 Nov 2015 13:53:19 +0000 (14:53 +0100)]
drm/exynos: rotator: convert to common clock framework

This driver was not used after introduction of common clock framework.
This patch adds missing prepare/unprepare calls and allows to use it
again with current kernel code.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
8 years agodrm/exynos: gsc: add device tree support and remove usage of static mappings
Seung-Woo Kim [Mon, 30 Nov 2015 13:53:18 +0000 (14:53 +0100)]
drm/exynos: gsc: add device tree support and remove usage of static mappings

This patch adds device tree support for exynos_drm_gsc. This patch
also fixed build issue on non-Exynos platforms, thus dependency on
!ARCH_MULTIPLATFORM can be now removed. The driver cannot be used
simultaneously with V4L2 Mem2Mem GScaller driver thought.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Acked-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
8 years agodrm/exynos: gsc: fix wrong pm_runtime state
Seung-Woo Kim [Mon, 30 Nov 2015 13:53:17 +0000 (14:53 +0100)]
drm/exynos: gsc: fix wrong pm_runtime state

At probe time, gsc clock is not enabled, so pm_runtime state should
be deactive. So this patch removes pm_runtime_set_active() from
gsc_probe().

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
8 years agodrm/exynos: gsc: prepare and unprepare gsc clock
Seung-Woo Kim [Mon, 30 Nov 2015 13:53:16 +0000 (14:53 +0100)]
drm/exynos: gsc: prepare and unprepare gsc clock

Ths patch changes the clk_enable and clk_disable call in gsc driver
into clk_prepare_enable and clk_disable_unprepare.

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
8 years agoARM: dts: Use OF graph for DP to panel connection in exynos5800-peach-pi
Javier Martinez Canillas [Thu, 3 Dec 2015 12:32:17 +0000 (09:32 -0300)]
ARM: dts: Use OF graph for DP to panel connection in exynos5800-peach-pi

The DT binding for the Exynos DRM Display Port (DP) driver isn't consistent
since it uses a phandle to describe the connection between the DP port and
the display panel but uses the OF graph ports and endpoints to describe the
connection betwen the DP port, a bridge chip and the panel.

The Exynos DP driver and the DT binding have been changed to allow also to
describe the DP port to panel connection using ports / endpoints (OF graph)
so this patch changes the Exynos5800 Peach Pi DT to make it consistent with
the Exynos5420 Peach Pit that has a eDP to LVDS chip and uses OF graph too.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Reviewed-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
8 years agodt-bindings: exynos-dp: update ports node binding for panel
Inki Dae [Thu, 3 Dec 2015 07:54:45 +0000 (16:54 +0900)]
dt-bindings: exynos-dp: update ports node binding for panel

This patch updates a ports node binding for panel.

With this, dp node can have a ports node which describes
a remote endpoint node that can be connected to panel or bridge
node.

Changelog v2:
- remove unnecessary properties and numbering.
- update description about eDP device.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Acked-by: Rob Herring <robh@kernel.org>
8 years agodrm/exynos: dp: add of_graph dt binding support for panel
Inki Dae [Thu, 26 Nov 2015 12:34:18 +0000 (21:34 +0900)]
drm/exynos: dp: add of_graph dt binding support for panel

This patch adds of_graph dt binding support for panel device
and also keeps the backward compatibility.

i.e.,
The dts file for Exynos5800 based peach pi board
has a panel property so we need to keep the backward compatibility.

Changelog v3:
- bind only one of two nodes outbound - panel or bridge.

Changelog v2:
- return -EINVAL if getting a port node failed.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
8 years agodrm/exynos: decon: remove unused variables
Inki Dae [Mon, 7 Dec 2015 11:45:35 +0000 (20:45 +0900)]
drm/exynos: decon: remove unused variables

This patch just removes unused variables, i and ret.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
8 years agodrm/exynos: dsi: modify a error type when getting a node failed
Inki Dae [Thu, 3 Dec 2015 05:35:23 +0000 (14:35 +0900)]
drm/exynos: dsi: modify a error type when getting a node failed

This patch makes it to return -EINVAL instead of -ENXIO
when getting a port or remote node failed.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
8 years agodrm/exynos: simplify sleep PM ops
Andrzej Hajda [Fri, 27 Nov 2015 14:32:45 +0000 (15:32 +0100)]
drm/exynos: simplify sleep PM ops

PM ops in exynos_drm_drv were split into two separate function as they were
used also by drm device. Since PM ops have been removed from drm device, the
functions can be merged together.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
8 years agodrm/exynos: dsi: add runtime pm support
Inki Dae [Mon, 16 Nov 2015 11:29:24 +0000 (20:29 +0900)]
drm/exynos: dsi: add runtime pm support

This patch adds runtime pm interfaces to dsi driver.

Each sub driver should control not only its own clocks and
regulator but also its power domain.

For this, it removes existing exynos_dsi_poweron/poweroff interfaces
and uses runtime pm interfaces instead.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
8 years agodrm/exynos: add pm_runtime to DECON 7
Gustavo Padovan [Mon, 2 Nov 2015 11:58:02 +0000 (20:58 +0900)]
drm/exynos: add pm_runtime to DECON 7

Let pm_runtime handle the enabling/disabling of the device with
proper refcnt instead of rely on specific flags to track the enabled
state.

Changelog v3:
- revive suspended to keep current dpms mode

Changelog v2:
- Modify CONFIG_PM_SLEEP -> CONFIG_PM

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
8 years agodrm/exynos: add pm_runtime to DECON 5433
Gustavo Padovan [Mon, 2 Nov 2015 11:54:55 +0000 (20:54 +0900)]
drm/exynos: add pm_runtime to DECON 5433

Let pm_runtime handle the enabling/disabling of the device with
proper refcnt instead of rely on specific flags to track the enabled
state.

Changelog v3:
- Change CONFIG_PM_SLEEP -> CONFIG_PM

Changelog v2:
- no change

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
8 years agodrm/exynos: add pm_runtime to FIMD
Gustavo Padovan [Fri, 4 Sep 2015 20:15:49 +0000 (17:15 -0300)]
drm/exynos: add pm_runtime to FIMD

Let pm_runtime handle the enabling/disabling of the device with proper
refcnt instead of rely on specific flags to track the enabled state.

Chnagelog v3:
- Revive suspended varable to check the suspend status.

Changelog v2:
- Remove unnecessary changes which removed commit callback from decon drivers
  and modify CONFIG_PM_SLEEP -> CONFIG_PM

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
8 years agodrm/exynos: add pm_runtime to Mixer
Gustavo Padovan [Fri, 4 Sep 2015 20:15:46 +0000 (17:15 -0300)]
drm/exynos: add pm_runtime to Mixer

Let pm_runtime handle the enabling/disabling of the device with proper
refcnt instead of rely on specific flags to track the enabled state.

Changelog v2:
- revive MXR_BIT_POWERED flag to keep current dpms mode.

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
8 years agodrm/exynos: add pm_runtime to HDMI
Gustavo Padovan [Mon, 2 Nov 2015 11:39:18 +0000 (20:39 +0900)]
drm/exynos: add pm_runtime to HDMI

Let pm_runtime handle the enabling/disabling of the device with proper
refcnt instead of rely on specific flags to track the enabled state.

Changelog v3:
- revive powered flag to keep current dpms mode

Changelog v2:
- Mofidy CONFIG_PM_SLEEP -> CONFIG_PM

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
8 years agodrm/exynos: add pm_runtime to DP
Gustavo Padovan [Mon, 2 Nov 2015 11:32:36 +0000 (20:32 +0900)]
drm/exynos: add pm_runtime to DP

Let pm_runtime handle the enabling/disabling of the device with
proper refcnt instead of rely on specific flags to track the enabled
state.

Chnagelog v3:
- revive dpms_mode to keep current dpms mode.

Changelog v2:
- no change

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
8 years agodrm/exynos: do not start enabling DP at bind() phase
Gustavo Padovan [Mon, 2 Nov 2015 11:00:03 +0000 (20:00 +0900)]
drm/exynos: do not start enabling DP at bind() phase

The DP device will be properly enabled at the enable() call just
after the bind call finishes.

Changelog v2:
- no change

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
8 years agodrm: modes: Revert cc344980c767 "replace simple_strtoul by kstrtouint"
LABBE Corentin [Fri, 11 Dec 2015 12:58:59 +0000 (13:58 +0100)]
drm: modes: Revert cc344980c767 "replace simple_strtoul by kstrtouint"

My latest commit introduce some case where a valid mode, could be
rejected.
simple_strtox functions stop at first non-digit character, but kstrtox
not.
So args like "video=HDMI-A-1:720x480-16@60" will be reject when checking
16@.

Discussions about this change comes to the conclusion that the best
solution is to revert my commit cc344980c76748e57c9c03100c2a14d36ab00334.

Signed-off-by: LABBE Corentin <clabbe.montjoie@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1449838739-29969-1-git-send-email-clabbe.montjoie@gmail.com
8 years agodrm: Expand the drm_helper_probe_single_connector_modes() docs
Ville Syrjälä [Thu, 10 Dec 2015 21:13:57 +0000 (23:13 +0200)]
drm: Expand the drm_helper_probe_single_connector_modes() docs

Describe the procedure that drm_helper_probe_single_connector_modes()
uses to do it's work in the kernel-doc comment.

Caveat: Looks like crap and trying to reverse engineer the documentation
tools is not something I want to do.

Suggested-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1449782037-19722-3-git-send-email-ville.syrjala@linux.intel.com
8 years agodrm: Allow override_edid to override the firmware EDID
Ville Syrjälä [Thu, 10 Dec 2015 21:13:56 +0000 (23:13 +0200)]
drm: Allow override_edid to override the firmware EDID

IMO the override_edid should override any default EDID for the
connector, whether that came in via the connector helper ->get_modes()
vfunc or via the firmware EDID mechanism.

Cc: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1449782037-19722-2-git-send-email-ville.syrjala@linux.intel.com
8 years agodrm/sti: Drop bogus drm_mode_sort() call
Ville Syrjälä [Thu, 3 Dec 2015 21:14:15 +0000 (23:14 +0200)]
drm/sti: Drop bogus drm_mode_sort() call

sti seems confused about which mode list is used in its .get_modes()
hook. It adds the modes to the probed_modes list (as is appropriate)
but then for some reason it tries to sort the old mode list.

Just drop the sorting since it does nothing, and let the probe helper
do its thing. It will sort the final mode list after merging in the
modes from the probed_modes list and validating them.

Cc: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Cc: Vincent Abriou <vincent.abriou@st.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1449177255-9515-8-git-send-email-ville.syrjala@linux.intel.com
8 years agodrm: Drop drm_helper_probe_single_connector_modes_nomerge()
Ville Syrjälä [Thu, 3 Dec 2015 21:14:14 +0000 (23:14 +0200)]
drm: Drop drm_helper_probe_single_connector_modes_nomerge()

Now that the mode type bit merge logic is fixed to only merge
between new probed modes, hopefully we can eliminat the special
case for qxl and virtio. That is make the merge the mode type
bits from all matching new probed modes, just like every other
driver.

qxl and virtio got excluded from the merging in
commit 3fbd6439e463 ("drm: copy mode type in drm_mode_connector_list_update()")
commit abce1ec9b08a ("Revert "drm: copy mode type in drm_mode_connector_list_update()"")
commit b87577b7c768 ("drm: try harder to avoid regression when merging mode bits")

Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Adam Jackson <ajax@redhat.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
[danvet: Resolve conflicts with doc updates.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
8 years agodrm: Only merge mode type bits between new probed modes
Ville Syrjälä [Fri, 4 Dec 2015 13:13:01 +0000 (15:13 +0200)]
drm: Only merge mode type bits between new probed modes

Currently most drivers request that any mode appearing on both the
old mode list and the new probed_modes list get their type bits ORed
together if the modes are deemed to otherwise match each other.

I don't know why anyone would want to merge in the mode type bits
from any mode left over from a previous probe. For instance, you
could never get rid of ther preferred bit if a matching non-preferred
mode is returned by the new probe. So let's not merge anything from
the stale old modes, and just replace them outright with matching new
modes.

If multiple matching modes are produced by the same probe, merging
the type bits between them would seem like a sensible thing to do.
For a bit of extra finesse if two modes are considered equal we can
pick the actual timings from the one marked as preferrred. And if
multiple preferred modes are produced by the same probe somehow, we
can just favor the first one added to the probed_modes list.

You may be asking yourself why we bother with the merging at all if
nothing from the old list survives in practice. The only answer I have
is "debug output". That is we want to print out a list of pruned modes,
which is why we still want to look for duplicates with the old modes.

There was a previous attempt to get rid of the mode type merging
entirely, but it caused some kind of regression on Daniels's G33
machine. Apparently the sdvo transcoder on said machine started to
die at around the same time and has since rotted away totally, so
it may have been a red herring. So we don't have to worry about
it anymore. The relevant commits are:
commit 3fbd6439e463 ("drm: copy mode type in drm_mode_connector_list_update()")
commit abce1ec9b08a ("Revert "drm: copy mode type in drm_mode_connector_list_update()"")

It was then decided in
commit b87577b7c768 ("drm: try harder to avoid regression when merging mode bits")
that just qxl virtio are excluded from the merging, while everyone
else does it. That is not changed, although now even qxl and virtio
will be subject to the previously mentioned logic to choose which
actual timings are picked for the new mode.

v2: Fix typos in commit message, and clarify the details on
    the G33 regression from the previous attempt (Daniel)

Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
Cc: Dave Airlie <airlied@redhat.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Adam Jackson <ajax@redhat.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1449234781-22332-1-git-send-email-ville.syrjala@linux.intel.com
8 years agodrm: Flatten drm_mode_connector_list_update() a bit
Ville Syrjälä [Thu, 3 Dec 2015 21:14:12 +0000 (23:14 +0200)]
drm: Flatten drm_mode_connector_list_update() a bit

Use 'continue' to eliminate one indent level from
drm_mode_connector_list_update(). And while at it,
make 'found_it' bool.

Cc: Adam Jackson <ajax@redhat.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1449177255-9515-5-git-send-email-ville.syrjala@linux.intel.com
8 years agodrm: Rename MODE_UNVERIFIED to MODE_STALE
Ville Syrjälä [Thu, 10 Dec 2015 20:39:08 +0000 (22:39 +0200)]
drm: Rename MODE_UNVERIFIED to MODE_STALE

MODE_UNVERIFIED actually means that the mode came from a previous probe,
and if the new probe doesn't produce a matching mode it will get pruned
from the list. Rename the flag to MODE_STALE to better convey the
meaning.

v2: Rebased due to conflicts with Daniel's doc stuff

Cc: Adam Jackson <ajax@redhat.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1449779948-10906-1-git-send-email-ville.syrjala@linux.intel.com
8 years agodrm: Don't overwrite UNVERFIED mode status to OK
Ville Syrjälä [Thu, 3 Dec 2015 21:14:09 +0000 (23:14 +0200)]
drm: Don't overwrite UNVERFIED mode status to OK

The way the mode probing works is this:
1. All modes currently on the mode list are marked as UNVERIFIED
2. New modes are on the probed_modes list (they start with
   status OK)
3. Modes are moved from the probed_modes list to the actual
   mode list. If a mode already on the mode list is deemed
   to match one of the probed modes, the duplicate is dropped
   and the mode status updated to OK. After this the
   probed_modes list will be empty.
4. All modes on the mode list are verified to not violate any
   constraints. Any that do are marked as such.
5. Any mode left with a non-OK status is pruned from the list,
   with an appropriate debug message.

What all this means is that any mode on the original list that
didn't have a duplicate on the probed_modes list, should be left
with status UNVERFIED (or previously could have been left with
some other status, but never OK).

I broke that in
commit 05acaec334fc ("drm: Reorganize probed mode validation")
by always assigning something to the mode->status during the validation
step. So any mode from the old list that still passed the validation
would be left on the list with status OK in the end.

Fix this by not doing the basic mode validation unless the mode
already has status OK (meaning it came from the probed_modes list,
or at least a duplicate of it was on that list). This way we will
correctly prune away any mode from the old mode list that didn't
appear on the probed_modes list.

Cc: stable@vger.kernel.org
Cc: Adam Jackson <ajax@redhat.com>
Fixes: 05acaec334fc ("drm: Reorganize probed mode validation")
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1449177255-9515-2-git-send-email-ville.syrjala@linux.intel.com
Testcase: igt/kms_force_connector_basic/prune-stale-modes
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93332
[danvet: Also applying to drm-misc to avoid too much conflict hell -
there's a big pile of patches from Ville on top of this one.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
8 years agodrm: Add plane->name and use it in debug prints
Ville Syrjälä [Tue, 8 Dec 2015 16:41:54 +0000 (18:41 +0200)]
drm: Add plane->name and use it in debug prints

Show a sensible name for the plane in debug mesages. The driver
may supply its own name, otherwise the core genrates the name
("plane-0", "plane-1" etc.).

v2: kstrdup() the name passed by the caller (Jani)
v3: Generate a default name if the driver doesn't supply one

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1449592922-5545-7-git-send-email-ville.syrjala@linux.intel.com
8 years agodrm: Add crtc->name and use it in debug messages
Ville Syrjälä [Tue, 8 Dec 2015 16:41:53 +0000 (18:41 +0200)]
drm: Add crtc->name and use it in debug messages

Show a sensible name for the crtc in debug mesages. The driver may
supply its own name, otherwise the core genrates the name
("crtc-0", "crtc-1" etc.).

v2: kstrdup() the name passed by the caller (Jani)
v3: Generate a default name if the driver doesn't supply one

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1449592922-5545-6-git-send-email-ville.syrjala@linux.intel.com
8 years agodrm: Use driver specified encoder name
Ville Syrjälä [Tue, 8 Dec 2015 16:41:52 +0000 (18:41 +0200)]
drm: Use driver specified encoder name

Use the encoder name passed by the driver if non-NULL, otherwise fall
back to the old style name.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1449592922-5545-5-git-send-email-ville.syrjala@linux.intel.com
8 years agodrm: Pass 'name' to drm_encoder_init()
Ville Syrjälä [Wed, 9 Dec 2015 14:20:18 +0000 (16:20 +0200)]
drm: Pass 'name' to drm_encoder_init()

Done with coccinelle for the most part. However, it thinks '...' is
part of the semantic patch, so I put an 'int DOTDOTDOT' placeholder
in its place and got rid of it with sed afterwards.

@@
identifier dev, encoder, funcs;
@@
 int drm_encoder_init(struct drm_device *dev,
                      struct drm_encoder *encoder,
                      const struct drm_encoder_funcs *funcs,
                      int encoder_type
+                     ,const char *name, int DOTDOTDOT
                      )
{ ... }

@@
identifier dev, encoder, funcs;
@@
 int drm_encoder_init(struct drm_device *dev,
                      struct drm_encoder *encoder,
                      const struct drm_encoder_funcs *funcs,
                      int encoder_type
+                     ,const char *name, int DOTDOTDOT
                      );

@@
expression E1, E2, E3, E4;
@@
 drm_encoder_init(E1, E2, E3, E4
+                 ,NULL
                  )

v2: Add ', or NULL...' to @name kernel doc (Jani)
    Annotate the function with __printf() attribute (Jani)

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1449670818-2966-1-git-send-email-ville.syrjala@linux.intel.com
8 years agodrm: Pass 'name' to drm_universal_plane_init()
Ville Syrjälä [Wed, 9 Dec 2015 14:19:55 +0000 (16:19 +0200)]
drm: Pass 'name' to drm_universal_plane_init()

Done with coccinelle for the most part. It choked on
msm/mdp/mdp5/mdp5_plane.c like so:
"BAD:!!!!!  enum drm_plane_type type;"
No idea how to deal with that, so I just fixed that up
by hand.

Also it thinks '...' is part of the semantic patch, so I put an
'int DOTDOTDOT' placeholder in its place and got rid of it with
sed afterwards.

I didn't convert drm_plane_init() since passing the varargs through
would mean either cpp macros or va_list, and I figured we don't
care about these legacy functions enough to warrant the extra pain.

@@
typedef uint32_t;
identifier dev, plane, possible_crtcs, funcs, formats, format_count, type;
@@
 int drm_universal_plane_init(struct drm_device *dev,
                              struct drm_plane *plane,
                              unsigned long possible_crtcs,
                              const struct drm_plane_funcs *funcs,
                              const uint32_t *formats,
                              unsigned int format_count,
                              enum drm_plane_type type
+                             ,const char *name, int DOTDOTDOT
                              )
{ ... }

@@
identifier dev, plane, possible_crtcs, funcs, formats, format_count, type;
@@
 int drm_universal_plane_init(struct drm_device *dev,
                              struct drm_plane *plane,
                              unsigned long possible_crtcs,
                              const struct drm_plane_funcs *funcs,
                              const uint32_t *formats,
                              unsigned int format_count,
                              enum drm_plane_type type
+                             ,const char *name, int DOTDOTDOT
                              );

@@
expression E1, E2, E3, E4, E5, E6, E7;
@@
 drm_universal_plane_init(E1, E2, E3, E4, E5, E6, E7
+                         ,NULL
                          )

v2: Split crtc and plane changes apart
    Pass NUL for no-name instead of ""
    Leave drm_plane_init() alone
v3: Add ', or NULL...' to @name kernel doc (Jani)
    Annotate the function with __printf() attribute (Jani)

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1449670795-2853-1-git-send-email-ville.syrjala@linux.intel.com
8 years agodrm: Pass 'name' to drm_crtc_init_with_planes()
Ville Syrjälä [Wed, 9 Dec 2015 14:19:31 +0000 (16:19 +0200)]
drm: Pass 'name' to drm_crtc_init_with_planes()

Done with coccinelle for the most part. However, it thinks '...' is
part of the semantic patch, so I put an 'int DOTDOTDOT' placeholder
in its place and got rid of it with sed afterwards.

I didn't convert drm_crtc_init() since passing the varargs through
would mean either cpp macros or va_list, and I figured we don't
care about these legacy functions enough to warrant the extra pain.

@@
identifier dev, crtc, primary, cursor, funcs;
@@
 int drm_crtc_init_with_planes(struct drm_device *dev,
                               struct drm_crtc *crtc,
                               struct drm_plane *primary, struct drm_plane *cursor,
                               const struct drm_crtc_funcs *funcs
+                              ,const char *name, int DOTDOTDOT
                               )
{ ... }

@@
identifier dev, crtc, primary, cursor, funcs;
@@
 int drm_crtc_init_with_planes(struct drm_device *dev,
                               struct drm_crtc *crtc,
                               struct drm_plane *primary, struct drm_plane *cursor,
                               const struct drm_crtc_funcs *funcs
+                              ,const char *name, int DOTDOTDOT
                               );

@@
expression E1, E2, E3, E4, E5;
@@
 drm_crtc_init_with_planes(E1, E2, E3, E4, E5
+                          ,NULL
                           )

v2: Split crtc and plane changes apart
    Pass NULL for no-name instead of ""
    Leave drm_crtc_init() alone
v3: Add ', or NULL...' to @name kernel doc (Jani)
    Annotate the function with __printf() attribute (Jani)

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1449670771-2751-1-git-send-email-ville.syrjala@linux.intel.com
8 years agoMerge branch 'drm-header-fixes' of https://github.com/GabrielL/linux into drm-next
Dave Airlie [Fri, 11 Dec 2015 03:46:05 +0000 (13:46 +1000)]
Merge branch 'drm-header-fixes' of https://github.com/GabrielL/linux into drm-next

Fix all the problems with the header files and userspace builds
off them. I really care so little about this, but hey who am
I to stop progress.

* 'drm-header-fixes' of https://github.com/GabrielL/linux: (30 commits)
  drm: fix inclusion of drm.h in via_drm.h
  drm: fix inclusion of drm.h in vmwgfx_drm.h
  drm: fix inclusion of drm.h in virtgpu_drm.h
  drm: fix inclusion of drm.h in tegra_drm.h
  drm: fix inclusion of drm.h in savage_drm.h
  drm: fix inclusion of drm.h in r128_drm.h
  drm: fix inclusion of drm.h in qxl_drm.h
  drm: fix inclusion of drm.h in omap_drm.h
  drm: fix inclusion of drm.h in msm_drm.h
  drm: fix inclusion of drm.h in mga_drm.h
  drm: fix inclusion of drm.h in exynos_sarea.h
  drm: fix inclusion of drm.h in i810_drm.h
  drm: fix inclusion of drm.h in exynos_sarea.h
  drm: fix inclusion of drm.h in drm_sarea.h
  drm: drm_mode.h fix includes
  drm: drm_fourcc.h fix includes
  drm: include drm.h in armada_drm.h
  include/uapi/drm/amdgpu_drm.h: use __u32 and __u64 from <linux/types.h>
  drm: Kbuild: add admgpu_drm.h to the installed headers
  drm: use __u{32,64} instead of uint{32,64}_t in virtgpu_drm.h
  ...

8 years agodrm: fix inclusion of drm.h in via_drm.h
Gabriel Laskar [Mon, 30 Nov 2015 14:10:57 +0000 (15:10 +0100)]
drm: fix inclusion of drm.h in via_drm.h

Using `#include "drm.h"` instead of `#include <drm/drm.h>` allow drm
headers to be moved in another directory without changes, like for the
libdrm imports.

Signed-off-by: Gabriel Laskar <gabriel@lse.epita.fr>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
CC: Emil Velikov <emil.l.velikov@gmail.com>
CC: Mikko Rapeli <mikko.rapeli@iki.fi>
8 years agodrm: fix inclusion of drm.h in vmwgfx_drm.h
Gabriel Laskar [Mon, 30 Nov 2015 14:10:56 +0000 (15:10 +0100)]
drm: fix inclusion of drm.h in vmwgfx_drm.h

Using `#include "drm.h"` instead of `#include <drm/drm.h>` allow drm
headers to be moved in another directory without changes, like for the
libdrm imports.

Signed-off-by: Gabriel Laskar <gabriel@lse.epita.fr>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
CC: Emil Velikov <emil.l.velikov@gmail.com>
CC: Mikko Rapeli <mikko.rapeli@iki.fi>
8 years agodrm: fix inclusion of drm.h in virtgpu_drm.h
Gabriel Laskar [Mon, 30 Nov 2015 14:10:55 +0000 (15:10 +0100)]
drm: fix inclusion of drm.h in virtgpu_drm.h

Using `#include "drm.h"` instead of `#include <drm/drm.h>` allow drm
headers to be moved in another directory without changes, like for the
libdrm imports.

Signed-off-by: Gabriel Laskar <gabriel@lse.epita.fr>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
CC: Emil Velikov <emil.l.velikov@gmail.com>
CC: Mikko Rapeli <mikko.rapeli@iki.fi>
8 years agodrm: fix inclusion of drm.h in tegra_drm.h
Gabriel Laskar [Mon, 30 Nov 2015 14:10:54 +0000 (15:10 +0100)]
drm: fix inclusion of drm.h in tegra_drm.h

Using `#include "drm.h"` instead of `#include <drm/drm.h>` allow drm
headers to be moved in another directory without changes, like for the
libdrm imports.

Signed-off-by: Gabriel Laskar <gabriel@lse.epita.fr>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
CC: Emil Velikov <emil.l.velikov@gmail.com>
CC: Mikko Rapeli <mikko.rapeli@iki.fi>
8 years agodrm: fix inclusion of drm.h in savage_drm.h
Gabriel Laskar [Mon, 30 Nov 2015 14:10:53 +0000 (15:10 +0100)]
drm: fix inclusion of drm.h in savage_drm.h

Using `#include "drm.h"` instead of `#include <drm/drm.h>` allow drm
headers to be moved in another directory without changes, like for the
libdrm imports.

Signed-off-by: Gabriel Laskar <gabriel@lse.epita.fr>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
CC: Emil Velikov <emil.l.velikov@gmail.com>
CC: Mikko Rapeli <mikko.rapeli@iki.fi>
8 years agodrm: fix inclusion of drm.h in r128_drm.h
Gabriel Laskar [Mon, 30 Nov 2015 14:10:52 +0000 (15:10 +0100)]
drm: fix inclusion of drm.h in r128_drm.h

Using `#include "drm.h"` instead of `#include <drm/drm.h>` allow drm
headers to be moved in another directory without changes, like for the
libdrm imports.

Signed-off-by: Gabriel Laskar <gabriel@lse.epita.fr>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
CC: Emil Velikov <emil.l.velikov@gmail.com>
CC: Mikko Rapeli <mikko.rapeli@iki.fi>
8 years agodrm: fix inclusion of drm.h in qxl_drm.h
Gabriel Laskar [Mon, 30 Nov 2015 14:10:51 +0000 (15:10 +0100)]
drm: fix inclusion of drm.h in qxl_drm.h

Using `#include "drm.h"` instead of `#include <drm/drm.h>` allow drm
headers to be moved in another directory without changes, like for the
libdrm imports.

Signed-off-by: Gabriel Laskar <gabriel@lse.epita.fr>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
CC: Emil Velikov <emil.l.velikov@gmail.com>
CC: Mikko Rapeli <mikko.rapeli@iki.fi>
8 years agodrm: fix inclusion of drm.h in omap_drm.h
Gabriel Laskar [Mon, 30 Nov 2015 14:10:50 +0000 (15:10 +0100)]
drm: fix inclusion of drm.h in omap_drm.h

Using `#include "drm.h"` instead of `#include <drm/drm.h>` allow drm
headers to be moved in another directory without changes, like for the
libdrm imports.

Signed-off-by: Gabriel Laskar <gabriel@lse.epita.fr>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
CC: Emil Velikov <emil.l.velikov@gmail.com>
CC: Mikko Rapeli <mikko.rapeli@iki.fi>
8 years agodrm: fix inclusion of drm.h in msm_drm.h
Gabriel Laskar [Mon, 30 Nov 2015 14:10:49 +0000 (15:10 +0100)]
drm: fix inclusion of drm.h in msm_drm.h

Using `#include "drm.h"` instead of `#include <drm/drm.h>` allow drm
headers to be moved in another directory without changes, like for the
libdrm imports.

Signed-off-by: Gabriel Laskar <gabriel@lse.epita.fr>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
CC: Emil Velikov <emil.l.velikov@gmail.com>
CC: Mikko Rapeli <mikko.rapeli@iki.fi>
8 years agodrm: fix inclusion of drm.h in mga_drm.h
Gabriel Laskar [Mon, 30 Nov 2015 14:10:48 +0000 (15:10 +0100)]
drm: fix inclusion of drm.h in mga_drm.h

Using `#include "drm.h"` instead of `#include <drm/drm.h>` allow drm
headers to be moved in another directory without changes, like for the
libdrm imports.

Signed-off-by: Gabriel Laskar <gabriel@lse.epita.fr>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
CC: Emil Velikov <emil.l.velikov@gmail.com>
CC: Mikko Rapeli <mikko.rapeli@iki.fi>
8 years agodrm: fix inclusion of drm.h in exynos_sarea.h
Gabriel Laskar [Mon, 30 Nov 2015 14:10:47 +0000 (15:10 +0100)]
drm: fix inclusion of drm.h in exynos_sarea.h

Using `#include "drm.h"` instead of `#include <drm/drm.h>` allow drm
headers to be moved in another directory without changes, like for the
libdrm imports.

Signed-off-by: Gabriel Laskar <gabriel@lse.epita.fr>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
CC: Emil Velikov <emil.l.velikov@gmail.com>
CC: Mikko Rapeli <mikko.rapeli@iki.fi>
8 years agodrm: fix inclusion of drm.h in i810_drm.h
Gabriel Laskar [Mon, 30 Nov 2015 14:10:46 +0000 (15:10 +0100)]
drm: fix inclusion of drm.h in i810_drm.h

Using `#include "drm.h"` instead of `#include <drm/drm.h>` allow drm
headers to be moved in another directory without changes, like for
the libdrm imports.

Signed-off-by: Gabriel Laskar <gabriel@lse.epita.fr>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
CC: Emil Velikov <emil.l.velikov@gmail.com>
CC: Mikko Rapeli <mikko.rapeli@iki.fi>
8 years agodrm: fix inclusion of drm.h in exynos_sarea.h
Gabriel Laskar [Mon, 30 Nov 2015 14:10:45 +0000 (15:10 +0100)]
drm: fix inclusion of drm.h in exynos_sarea.h

Using `#include "drm.h"` instead of `#include <drm/drm.h>` allow drm
headers to be moved in another directory without changes, like for the
libdrm imports.

Signed-off-by: Gabriel Laskar <gabriel@lse.epita.fr>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
CC: Emil Velikov <emil.l.velikov@gmail.com>
CC: Mikko Rapeli <mikko.rapeli@iki.fi>
8 years agodrm: fix inclusion of drm.h in drm_sarea.h
Gabriel Laskar [Mon, 30 Nov 2015 14:10:44 +0000 (15:10 +0100)]
drm: fix inclusion of drm.h in drm_sarea.h

Using `#include "drm.h"` instead of `#include <drm/drm.h>` allow drm
headers to be moved in another directory without changes, like for the
libdrm imports.

Signed-off-by: Gabriel Laskar <gabriel@lse.epita.fr>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
CC: Emil Velikov <emil.l.velikov@gmail.com>
CC: Mikko Rapeli <mikko.rapeli@iki.fi>
8 years agodrm: drm_mode.h fix includes
Gabriel Laskar [Mon, 30 Nov 2015 14:10:43 +0000 (15:10 +0100)]
drm: drm_mode.h fix includes

Instead of using linux/types.h, drm headers should use drm.h, in order
to handle the portability issues in only one place.

Signed-off-by: Gabriel Laskar <gabriel@lse.epita.fr>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
CC: Emil Velikov <emil.l.velikov@gmail.com>
CC: Mikko Rapeli <mikko.rapeli@iki.fi>
8 years agodrm: drm_fourcc.h fix includes
Gabriel Laskar [Mon, 30 Nov 2015 14:10:42 +0000 (15:10 +0100)]
drm: drm_fourcc.h fix includes

Instead of using linux/types.h, drm headers should use drm.h, in order
to handle the portability issues in only one place.

Signed-off-by: Gabriel Laskar <gabriel@lse.epita.fr>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
CC: Emil Velikov <emil.l.velikov@gmail.com>
CC: Mikko Rapeli <mikko.rapeli@iki.fi>
8 years agodrm: include drm.h in armada_drm.h
Gabriel Laskar [Mon, 30 Nov 2015 14:10:41 +0000 (15:10 +0100)]
drm: include drm.h in armada_drm.h

Signed-off-by: Gabriel Laskar <gabriel@lse.epita.fr>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
CC: Emil Velikov <emil.l.velikov@gmail.com>
CC: Mikko Rapeli <mikko.rapeli@iki.fi>
8 years agoinclude/uapi/drm/amdgpu_drm.h: use __u32 and __u64 from <linux/types.h>
Mikko Rapeli [Wed, 2 Dec 2015 22:44:33 +0000 (23:44 +0100)]
include/uapi/drm/amdgpu_drm.h: use __u32 and __u64 from <linux/types.h>

Kernel headers exported to userspace are supposed to use these.

Fixes compilation errors in userspace:

error: unknown type name ‘uint64_t’
error: unknown type name ‘uint32_t’

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
8 years agodrm: Kbuild: add admgpu_drm.h to the installed headers
Gabriel Laskar [Mon, 30 Nov 2015 14:10:40 +0000 (15:10 +0100)]
drm: Kbuild: add admgpu_drm.h to the installed headers

Signed-off-by: Gabriel Laskar <gabriel@lse.epita.fr>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
CC: Emil Velikov <emil.l.velikov@gmail.com>
CC: Mikko Rapeli <mikko.rapeli@iki.fi>
8 years agodrm: use __u{32,64} instead of uint{32,64}_t in virtgpu_drm.h
Gabriel Laskar [Mon, 30 Nov 2015 14:10:39 +0000 (15:10 +0100)]
drm: use __u{32,64} instead of uint{32,64}_t in virtgpu_drm.h

Signed-off-by: Gabriel Laskar <gabriel@lse.epita.fr>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
CC: Emil Velikov <emil.l.velikov@gmail.com>
CC: Mikko Rapeli <mikko.rapeli@iki.fi>
8 years agoinclude/uapi/linux/agpgart.h: include stdlib.h in userspace
Mikko Rapeli [Sun, 1 Feb 2015 14:10:41 +0000 (15:10 +0100)]
include/uapi/linux/agpgart.h: include stdlib.h in userspace

Fixes userspace compiler error:
error: unknown type name ‘size_t’

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
8 years agoinclude/uapi/linux/virtio_gpu.h: use __u8 from <linux/types.h>
Mikko Rapeli [Wed, 2 Dec 2015 22:17:47 +0000 (23:17 +0100)]
include/uapi/linux/virtio_gpu.h: use __u8 from <linux/types.h>

Kernel headers exported to userspace are should these types.

Fixes userspace compilation error:

error: unknown type name ‘uint8_t’

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
8 years agoinclude/uapi/drm/qxl_drm.h: use __s32, __u32 and __u64 from linux/types.h
Mikko Rapeli [Wed, 11 Mar 2015 02:12:23 +0000 (03:12 +0100)]
include/uapi/drm/qxl_drm.h: use __s32, __u32 and __u64 from linux/types.h

Fixes userspace compilation errors like:

error: unknown type name ‘uint32_t’

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
8 years agoinclude/uapi/drm/vmwgfx_drm.h: use __s32, __u32 and __u64 from linux/types.h
Mikko Rapeli [Wed, 11 Mar 2015 02:07:51 +0000 (03:07 +0100)]
include/uapi/drm/vmwgfx_drm.h: use __s32, __u32 and __u64 from linux/types.h

Fixes userspace compilation errors like:

error: unknown type name ‘uint32_t’

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
8 years agovia_drm.h: don't include non-existing via_drmclient.h
Mikko Rapeli [Sun, 31 Aug 2014 14:20:20 +0000 (16:20 +0200)]
via_drm.h: don't include non-existing via_drmclient.h

Fixes compiler error:

drm/via_drm.h:36:27: fatal error: via_drmclient.h: No such file or directory

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
8 years agoradeon_drm.h: use __u32 and __u64 from linux/types.h
Mikko Rapeli [Sun, 31 Aug 2014 11:11:54 +0000 (13:11 +0200)]
radeon_drm.h: use __u32 and __u64 from linux/types.h

Fixes userspace compiler error:

drm/radeon_drm.h:794:2: error: unknown type name ‘uint64_t’

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
8 years agonouveau_drm.h: use __u32 and __u64 from linux/types.h
Mikko Rapeli [Sun, 31 Aug 2014 11:09:51 +0000 (13:09 +0200)]
nouveau_drm.h: use __u32 and __u64 from linux/types.h

Fixes userspace compilation errors like:

drm/nouveau_drm.h:41:2: error: unknown type name ‘uint32_t’

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
8 years agoexynos_drm.h: use __u64 from linux/types.h
Mikko Rapeli [Sun, 31 Aug 2014 11:07:31 +0000 (13:07 +0200)]
exynos_drm.h: use __u64 from linux/types.h

Fixes userspace compilation error:

drm/exynos_drm.h:30:2: error: unknown type name ‘uint64_t’

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
8 years agodrm_mode.h: use __u32 and __u64 from linux/types.h
Mikko Rapeli [Sun, 31 Aug 2014 11:01:09 +0000 (13:01 +0200)]
drm_mode.h: use __u32 and __u64 from linux/types.h

Fixes userspace compilation error:

drm/drm_mode.h:472:2: error: unknown type name ‘uint32_t’

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
8 years agodrm.h: use __kernel_size_t instead of size_t
Mikko Rapeli [Sun, 31 Aug 2014 10:58:46 +0000 (12:58 +0200)]
drm.h: use __kernel_size_t instead of size_t

Fall back to size_t for non Linux platforms.

Fixes userspace compilation error:

drm/drm.h:132:2: error: unknown type name ‘size_t’

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
8 years agodrm: Documentation style guide
Daniel Vetter [Tue, 8 Dec 2015 08:49:17 +0000 (09:49 +0100)]
drm: Documentation style guide

Every time I type or review docs this seems a bit different. Try to
document the common style so we can try to unify at least new docs.

v2: Spelling fixes from Pierre, Laurent and Jani.

v3: More spelling fixes from Lukas.

Cc: Pierre Moreau <pierre.morrow@free.fr>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Lukas Wunner <lukas@wunner.de>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1449564561-3896-1-git-send-email-daniel.vetter@ffwll.ch
8 years agodrm: Document drm_encoder/crtc_helper_funcs
Daniel Vetter [Fri, 4 Dec 2015 08:46:08 +0000 (09:46 +0100)]
drm: Document drm_encoder/crtc_helper_funcs

Mostly this is about all the callbacks used for modesets by both legacy
CRTC helpers and atomic helpers and I figured it doesn't make all that
much sense to split this up.

v2: Suggestions from Thierry.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1449218769-16577-28-git-send-email-daniel.vetter@ffwll.ch
Reviewed-by: Thierry Reding <treding@nvidia.com>
8 years agodrm: Move drm_display_mode an related docs into kerneldoc
Daniel Vetter [Wed, 9 Dec 2015 08:29:36 +0000 (09:29 +0100)]
drm: Move drm_display_mode an related docs into kerneldoc

This was in the documentation for modeset helper hooks, where it is a
bit misplaced.

v2: Reindent the drm_mode_status enum, inspired by Ville.

v3: Suggestions from Ville and Thierry.

v4: Small fixup that 0day spotted.

v5: Slight change to avoid accidental headings in kerneldoc output.

Cc: ville.syrjala@linux.intel.com
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1449218769-16577-27-git-send-email-daniel.vetter@ffwll.ch
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> (v3)
Reviewed-by: Thierry Reding <treding@nvidia.com> (v3)
8 years agodrm/atomic-helper: Mention the new system/resume helpers the docs
Daniel Vetter [Fri, 4 Dec 2015 08:46:06 +0000 (09:46 +0100)]
drm/atomic-helper: Mention the new system/resume helpers the docs

They have pretty kerneldoc already, but better to link to that in
one of the overview sections.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1449218769-16577-26-git-send-email-daniel.vetter@ffwll.ch
Reviewed-by: Thierry Reding <treding@nvidia.com>
8 years agodrm: Document drm_connector_helper_funcs
Daniel Vetter [Fri, 4 Dec 2015 08:46:05 +0000 (09:46 +0100)]
drm: Document drm_connector_helper_funcs

Nothing special, except the somewhat awkward split in probe helper
callbacks between here and drm_crtc_funcs.

v2: Suggestions from Thierry.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1449218769-16577-25-git-send-email-daniel.vetter@ffwll.ch
Reviewed-by: Thierry Reding <treding@nvidia.com>
8 years agodrm: Document drm_plane_helper_funcs
Daniel Vetter [Fri, 4 Dec 2015 08:46:04 +0000 (09:46 +0100)]
drm: Document drm_plane_helper_funcs

Plus related hooks used to do atomic plane updates since they only
really make sense as a package.

v2: Suggestions from Thierry.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1449218769-16577-24-git-send-email-daniel.vetter@ffwll.ch
Reviewed-by: Thierry Reding <treding@nvidia.com>
8 years agodrm: Kerneldoc for drm_mode_config_funcs
Daniel Vetter [Fri, 4 Dec 2015 08:46:02 +0000 (09:46 +0100)]
drm: Kerneldoc for drm_mode_config_funcs

The meat here is definitely the detailed specs for what atomic_check
and atomic_commit are supposed to do.

And another candidate for a core vfunc that should be in a helper really
(output_poll_changed this time around).

v2: Feedback from Eric on irc:
- spelling fixes.
- spec what async should do
- copy the event related paragraphs from page_flip and adjust
- make it clear that a successful async commit is not allowed to leave
  the pipe dead or disabled.

v3: Use FIXME comments to annotate functions that we should move to
some helpers.

v4: Suggestions from Thierry.

Cc: Eric Anholt <eric@anholt.net>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1449218769-16577-22-git-send-email-daniel.vetter@ffwll.ch
Reviewed-by: Thierry Reding <treding@nvidia.com>
8 years agodrm: Add kerneldoc for drm_framebuffer_funcs
Daniel Vetter [Fri, 4 Dec 2015 08:46:01 +0000 (09:46 +0100)]
drm: Add kerneldoc for drm_framebuffer_funcs

While typing these I noticed that ->dirty is a bit a can of worms
and even supports blt/fill semantics ... shocked me a bit.

Oh well it's defined in a way that nothing bad (just a bit of inefficiency)
will happen for drivers which supports this. So I didn't bother copying
the detailed spec into the new kerneldoc.

v2: Suggestions from Thierry.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1449218769-16577-21-git-send-email-daniel.vetter@ffwll.ch
Reviewed-by: Thierry Reding <treding@nvidia.com>
8 years agodrm: document drm_crtc_funcs
Daniel Vetter [Fri, 4 Dec 2015 08:46:00 +0000 (09:46 +0100)]
drm: document drm_crtc_funcs

And merge any docbook we have into the kerneldoc comments.

Since it's a legacy entry point with only two implementation (one each
in atomic and legacy crtc helpers) I've made the documentation for
set_config fairly sparse - no one should ever need to look at this
again, all the ABI we have is baked into code.

For ->page_flip otoh I kept all the extensive docs from the docbook
and even extended it where it was lacking: Currently we have a pile of
legacy page_flip implemantations, and even for atomic drivers there's
not yet a standard implementation in the helpers. Which means every
driver needs to implement this itself, and precise specs are really
valuable.

Otherwise there's just cursor, which really just boils down to "use at
least universal planes". And gamma tables (where we have a bit a mess
with the fbdev helper gamma hooks).

v2: Spelling fixes (Eric).

v3: Suggestions from Thierry.

Cc: Eric Anholt <eric@anholt.net>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1449218769-16577-20-git-send-email-daniel.vetter@ffwll.ch
8 years agodrm: connector->dpms is not optional
Daniel Vetter [Fri, 4 Dec 2015 08:45:59 +0000 (09:45 +0100)]
drm: connector->dpms is not optional

We always register the DPMS property, it's really a fundamental
part of a display driver. So don't check whether the vfunc is there,
it's non-optional

Yes I've audited all the almost 100 drm_connector_funcs we have, no
one botched this ;-)

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1449218769-16577-19-git-send-email-daniel.vetter@ffwll.ch
Reviewed-by: Thierry Reding <treding@nvidia.com>
8 years agodrm: Document drm_connector_funcs
Daniel Vetter [Fri, 4 Dec 2015 08:45:58 +0000 (09:45 +0100)]
drm: Document drm_connector_funcs

The special case here is that both ->detect and ->force are actually
functions only called by the probe helpers and hence really shouldn't
be here. But since they've used by pretty much every driver I figured
it's better to just document this for now instead of holding this doc
patch hostage until that's all fixed. For that reason also group force
right next to detect.

v2: Use FIXME comments to annotate where we should move a hook to
helpers.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1449218769-16577-18-git-send-email-daniel.vetter@ffwll.ch
Reviewed-by: Thierry Reding <treding@nvidia.com>
8 years agodrm: Document drm_atomic_*_get_property
Daniel Vetter [Fri, 4 Dec 2015 08:45:57 +0000 (09:45 +0100)]
drm: Document drm_atomic_*_get_property

Yes these are internal functions and not exported and we generally
don't document them. But for symmetry with the _set_property functions
(which are exported for the atomic helpers) I'd like to document them.
Upcoming vtable kerneldoc will reference both the set and get_property
functions.

v2: Suggestions from Thierry.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Thierry Reding <treding@nvidia.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1449218769-16577-17-git-send-email-daniel.vetter@ffwll.ch
8 years agodrm: Move encoder->save/restore into nouveau
Daniel Vetter [Fri, 4 Dec 2015 16:14:07 +0000 (17:14 +0100)]
drm: Move encoder->save/restore into nouveau

Nouveau is the only user, and atomic drivers should do state
save/restoring differently. So move it into noveau.

Saves me typing some kerneldoc, too ;-)

v2: Move misplaced hunk into earlier nouveau patch.

Cc: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1449245647-1315-1-git-send-email-daniel.vetter@ffwll.ch
Reviewed-by: Thierry Reding <treding@nvidia.com>
8 years agodrm: Remove crtc/connector->save/restore hooks
Daniel Vetter [Fri, 4 Dec 2015 08:45:55 +0000 (09:45 +0100)]
drm: Remove crtc/connector->save/restore hooks

They're not how system suspend/resume should be done with atomic
(there's new helpers for that developed by Thierry Reding), and for
legacy drivers this really should be a helper hook and not a core one.

But there's not even helper code to use them, and only 2 drivers
(which now have their own private hooks) set them. Ditch them.

Saves me typing some kerneldoc, too ;-)

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1449218769-16577-15-git-send-email-daniel.vetter@ffwll.ch
Reviewed-by: Thierry Reding <treding@nvidia.com>
8 years agodrm/nouveau: Use private save/restore hooks for CRTCs
Daniel Vetter [Fri, 4 Dec 2015 16:13:38 +0000 (17:13 +0100)]
drm/nouveau: Use private save/restore hooks for CRTCs

I want to remove the core ones since with atomic drivers system
suspend/resume is solved much differently. And there's only 2 drivers
(gma500 besides nouveau) really using them.

v2: Fixup bugs Ilia spotted.

Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1449245618-1127-1-git-send-email-daniel.vetter@ffwll.ch
Reviewed-by: Thierry Reding <treding@nvidia.com>
8 years agodrm/gma500: Move to private save/restore hooks
Daniel Vetter [Fri, 4 Dec 2015 08:45:53 +0000 (09:45 +0100)]
drm/gma500: Move to private save/restore hooks

I want to remove the core ones since with atomic drivers system
suspend/resume is solved much differently. And there's only 2 drivers
(nouveau besides gma500) really using them.

v2: Fixup build noise 0day reported.

Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1449218769-16577-13-git-send-email-daniel.vetter@ffwll.ch
Reviewed-by: Thierry Reding <treding@nvidia.com> (v1)
8 years agodrm/i2c/tda998x: Remove unused save/restore drm encoder helpers.
Rodrigo Vivi [Mon, 7 Dec 2015 18:35:06 +0000 (10:35 -0800)]
drm/i2c/tda998x: Remove unused save/restore drm encoder helpers.

save/restore have been removed from drm_encoder_helper_funcs by
'commit 79f13ad5d8e0 ("drm: Move encoder->save/restore into nouveau")'

But this module was still defining it with empty content causing
compilation fails:

drivers/gpu/drm/i2c/tda998x_drv.c:1354:10: warning: initialization from
incompatible pointer type [-Wincompatible-pointer-types]
  .save = tda998x_encoder_save,

drivers/gpu/drm/i2c/tda998x_drv.c:1355:2: error: unknown field 'restore'
specified in initializer
  .restore = tda998x_encoder_restore,

Cc: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1449513306-17309-1-git-send-email-rodrigo.vivi@intel.com
8 years agodrm/vmwgfx: Drop dummy save/restore hooks
Daniel Vetter [Fri, 4 Dec 2015 08:45:52 +0000 (09:45 +0100)]
drm/vmwgfx: Drop dummy save/restore hooks

These hooks will be gone soon.

Cc: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1449218769-16577-12-git-send-email-daniel.vetter@ffwll.ch
Reviewed-by: Thierry Reding <treding@nvidia.com>
8 years agodrm/virtio: Drop dummy save/restore functions
Daniel Vetter [Fri, 4 Dec 2015 08:45:51 +0000 (09:45 +0100)]
drm/virtio: Drop dummy save/restore functions

These hooks will be gone soon.

Cc: Dave Airlie <airlied@redhat.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1449218769-16577-11-git-send-email-daniel.vetter@ffwll.ch
Reviewed-by: Thierry Reding <treding@nvidia.com>
8 years agodrm/qxl: Drop dummy save/restore hooks
Daniel Vetter [Fri, 4 Dec 2015 08:45:50 +0000 (09:45 +0100)]
drm/qxl: Drop dummy save/restore hooks

These hooks will be gone soon.

Cc: Dave Airlie <airlied@redhat.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1449218769-16577-10-git-send-email-daniel.vetter@ffwll.ch
Reviewed-by: Thierry Reding <treding@nvidia.com>
8 years agodrm/nouveau: Ditch NULL save/restore hook assignments
Daniel Vetter [Fri, 4 Dec 2015 08:45:49 +0000 (09:45 +0100)]
drm/nouveau: Ditch NULL save/restore hook assignments

gcc does this for us, and these hooks will be gone soon.

Cc: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1449218769-16577-9-git-send-email-daniel.vetter@ffwll.ch
Reviewed-by: Thierry Reding <treding@nvidia.com>
8 years agodrm: Update drm_plane_funcs kerneldoc
Daniel Vetter [Fri, 4 Dec 2015 08:45:48 +0000 (09:45 +0100)]
drm: Update drm_plane_funcs kerneldoc

- Merge the docbook into the kerneldoc comments.

- Spec in detail the precise semantics of the callbacks.

- For consistency in wording and easier review roll out kerneldoc also
  for crtc, encoder and connector for the standard hooks they share
  with planes.

v2: Suggestions from Thierry.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1449218769-16577-8-git-send-email-daniel.vetter@ffwll.ch
Reviewed-by: Thierry Reding <treding@nvidia.com>
8 years agodrm/bridge: Improve kerneldoc
Daniel Vetter [Fri, 4 Dec 2015 08:45:47 +0000 (09:45 +0100)]
drm/bridge: Improve kerneldoc

Especially document the assumptions and semantics of the callbacks
carefully. Just a warm-up excercise really.

v2: Spelling fixes (Eric).

v3: Consolidate more with existing docs:

- Remove the overview section explaining the bridge funcs, that's
  now all in the drm_bridge_funcs kerneldoc in much more detail.

- Use & to reference structs so that kerneldoc automatically inserts
  hyperlinks.

v4: Review from Thierry.

Cc: Eric Anholt <eric@anholt.net>
Cc: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Archit Taneja <architt@codeaurora.org> (v3)
Link: http://patchwork.freedesktop.org/patch/msgid/1449218769-16577-7-git-send-email-daniel.vetter@ffwll.ch
Reviewed-by: Thierry Reding <treding@nvidia.com>
8 years agodrm: Merge helper docbook into kerneldoc comments
Daniel Vetter [Fri, 4 Dec 2015 08:45:46 +0000 (09:45 +0100)]
drm: Merge helper docbook into kerneldoc comments

Duplication is bad, luckily both help texts highlighted different
issues so the kerneldoc gained quite a bit!

While at it also sprinkle more references to the vtable structs around
and make it clear that legacy CRTC helpers are deprecated and which
functions to use instead.

v2: Spelling fixes and polish (Thierry).

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1449218769-16577-6-git-send-email-daniel.vetter@ffwll.ch
Reviewed-by: Thierry Reding <treding@nvidia.com>
8 years agodrm: Make helper vtable pointers type-safe
Daniel Vetter [Fri, 4 Dec 2015 08:45:45 +0000 (09:45 +0100)]
drm: Make helper vtable pointers type-safe

Originally the idea behind void* was to allow different sets of
helpers. But now we have that (with probe, plane, crtc and atomic
helpers) and we still just use the same set of vtables. That's the
only way to make the individual helpers modular and allow drivers to
pick&choose and transition between them. So this flexibility isn't
really needed. Also we have lots of non-vtable data meanwhile in core
structures too, this is not the first one at all.

Given that the void * is only trouble since gcc can't warn you if you
mix them up. Let's fix that and make them typesafe.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1449218769-16577-5-git-send-email-daniel.vetter@ffwll.ch
Reviewed-by: Thierry Reding <treding@nvidia.com>
8 years agodrm: Reorganize helper vtables and their docs
Daniel Vetter [Fri, 4 Dec 2015 08:45:44 +0000 (09:45 +0100)]
drm: Reorganize helper vtables and their docs

Currently we have 4 helper libraries (probe, crtc, plane & atomic)
that all use the same helper vtables. And that's by necessity since we
don't want to litter the core structs with one ops pointer per helper
library. Also often the reuse the same hooks (like atomic does, to
facilite conversion from existing drivers using crtc and plane
helpers).

Given all that it doesn't make sense to put the docs for these next to
specific helpers. Instead extract them into a new header file and
section in the docbook, and add references to them everywhere.

Unfortunately kernel-doc complains when an include directive doesn't
find anything (and it does by dumping crap into the output file). We
have to remove the now empty includes to avoid that, instead of leaving
them in for future proofing.

v2: More OCD in ordering functions.

v3: Spelling plus collate copyright headers properly.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1449218769-16577-4-git-send-email-daniel.vetter@ffwll.ch
Reviewed-by: Thierry Reding <treding@nvidia.com>
8 years agodrm: Move LEAVE/ENTER_ATOMIC_MODESET to fbdev helpers
Daniel Vetter [Fri, 4 Dec 2015 08:45:43 +0000 (09:45 +0100)]
drm: Move LEAVE/ENTER_ATOMIC_MODESET to fbdev helpers

This is only used for kgdb (and previously panic) handlers in
the fbdev emulation, so belongs there.

Note that this means we'll leave behind a forward declaration, but
once all the helper vtables are consolidated (in the next patch) that
will make more sense.

v2: fixup radone/amdgpu.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1449218769-16577-3-git-send-email-daniel.vetter@ffwll.ch
Reviewed-by: Thierry Reding <treding@nvidia.com> (v2)
8 years agodrm: Polish fbdev helper struct docs
Daniel Vetter [Fri, 4 Dec 2015 08:45:42 +0000 (09:45 +0100)]
drm: Polish fbdev helper struct docs

Mostly this is just adding extensive docs for the callbacks, but also
a few other additions.

v2: Use FIXME comments to annotate helper hooks that should be
replaced.

v3: Small nits (Thierry).

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1449218769-16577-2-git-send-email-daniel.vetter@ffwll.ch
Reviewed-by: Thierry Reding <treding@nvidia.com>
8 years agodrm/vc4: Add an interface for capturing the GPU state after a hang.
Eric Anholt [Fri, 30 Oct 2015 17:09:02 +0000 (10:09 -0700)]
drm/vc4: Add an interface for capturing the GPU state after a hang.

This can be parsed with vc4-gpu-tools tools for trying to figure out
what was going on.

v2: Use __u32-style types.

Signed-off-by: Eric Anholt <eric@anholt.net>
8 years agodrm/vc4: Add support for async pageflips.
Eric Anholt [Mon, 30 Nov 2015 20:34:01 +0000 (12:34 -0800)]
drm/vc4: Add support for async pageflips.

An async pageflip stores the modeset to be done and executes it once
the BOs are ready to be displayed.  This gets us about 3x performance
in full screen rendering with pageflipping.

Signed-off-by: Eric Anholt <eric@anholt.net>
8 years agodrm/vc4: Add support for drawing 3D frames.
Eric Anholt [Mon, 30 Nov 2015 20:13:37 +0000 (12:13 -0800)]
drm/vc4: Add support for drawing 3D frames.

The user submission is basically a pointer to a command list and a
pointer to uniforms.  We copy those in to the kernel, validate and
relocate them, and store the result in a GPU BO which we queue for
execution.

v2: Drop support for NV shader recs (not necessary for GL), simplify
    vc4_use_bo(), improve bin flush/semaphore checks, use __u32 style
    types.

Signed-off-by: Eric Anholt <eric@anholt.net>
8 years agodrm/vc4: Bind and initialize the V3D engine.
Eric Anholt [Mon, 2 Mar 2015 21:01:12 +0000 (13:01 -0800)]
drm/vc4: Bind and initialize the V3D engine.

This is the component of the GPU that does 3D rendering.

Signed-off-by: Eric Anholt <eric@anholt.net>
8 years agodrm/vc4: Fix a typo in a V3D debug register.
Eric Anholt [Fri, 23 Oct 2015 13:57:22 +0000 (14:57 +0100)]
drm/vc4: Fix a typo in a V3D debug register.

Signed-off-by: Eric Anholt <eric@anholt.net>
8 years agodrm/vc4: Add an API for creating GPU shaders in GEM BOs.
Eric Anholt [Mon, 30 Nov 2015 19:41:40 +0000 (11:41 -0800)]
drm/vc4: Add an API for creating GPU shaders in GEM BOs.

Since we have no MMU, the kernel needs to validate that the submitted
shader code won't make any accesses to memory that the user doesn't
control, which involves banning some operations (general purpose DMA
writes), and tracking where we need to write out pointers for other
operations (texture sampling).  Once it's validated, we return a GEM
BO containing the shader, which doesn't allow mapping for write or
exporting to other subsystems.

v2: Use __u32-style types.

Signed-off-by: Eric Anholt <eric@anholt.net>