Jani Nikula [Fri, 17 Feb 2017 15:20:52 +0000 (17:20 +0200)]
drm: do not debug log about missing CEA extensions on NULL edid
Make the drm_edid_to_eld() function useful for resetting, not just
setting, the ELD and HDMI VSDB data, without debug warnings about
missing CEA extensions.
Eric Anholt [Wed, 8 Feb 2017 20:47:01 +0000 (12:47 -0800)]
drm/vc4: Drop debug print at boot with DPI enabled.
Unlike the other encoders in the driver, I've also dropped the debug
dump function. There's only really one register to this device, and
we have the debugfs reg entry still.
Chris Wilson [Fri, 10 Feb 2017 19:59:13 +0000 (19:59 +0000)]
drm: Reduce EDID warnings from DRM_ERROR to DRM_NOTE
The warnings from parsing the EDID are not driver errors, but the
"normal but significant" conditions from the external device. As such,
they do not need the ferocity of an *ERROR*, but can use the less harsh
DRM_NOTE instead.
Russell King [Mon, 13 Feb 2017 12:27:03 +0000 (12:27 +0000)]
drm: ensure atomic messages consistently include the name of the component
Most DRM messages include three pieces of information: the type of the
component (CRTC, ENCODER, CONNECTOR etc), the DRM object ID of the
component, and the component name. However, there are some messages
which omit the last piece of identifying information. This makes it
harder to debug failures when these messages are printed, because the
DRM object ID doesn't supply enough information to know which piece of
hardware had a problem.
Update the atomic modeset code to always print the component name along
with the type and DRM object ID.
Fixes: 4cba68507cf5 ("drm/atomic-helper: Reject legacy flips on a disabled pipe") Fixes: 8d4d0d700dda ("drm/atomic-helper: Print an error if vblank wait times out") Fixes: 5481c8fb1da2 ("drm/atomic-helper: Check encoder/crtc constraints") Fixes: 99cf4a29fa24 ("drm/atomic: Add current-mode blob to CRTC state") Fixes: cc4ceb484b37 ("drm: Global atomic state handling") Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Acked-by: Thierry Reding <treding@nvidia.com>
[danvet: Wiggle in conflicting hunk.] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drm/atomic: Make add_affected_connectors look at crtc_state.
This kills another dereference of connector->state. connector_mask
holds all unchanged connectors at least and any changed connectors
are already in state anyway.
Add for_each_(old)(new)_(plane,connector,crtc)_in_state iterators to
replace the old for_each_xxx_in_state ones. This is useful for >1 flip
depth and getting rid of all xxx->state dereferences.
This requires extra fixups done when committing a state after
duplicating, which in general isn't valid but is used by suspend/resume.
To handle these, introduce drm_atomic_helper_commit_duplicated_state
which performs those fixups before checking & committing the state.
Changes since v1:
- Remove nonblock parameter for commit_duplicated_state.
Changes since v2:
- Use commit_duplicated_state for i915 load detection.
- Add WARN_ON(old_state != obj->state) before swapping.
Shawn Guo [Tue, 7 Feb 2017 09:16:35 +0000 (17:16 +0800)]
drm: zte: use vblank hooks in struct drm_crtc_funcs
The vblank hooks in struct drm_driver are deprecated and only meant for
legacy drivers. For modern drivers with DRIVER_MODESET flag, the hooks
in struct drm_crtc_funcs should be used instead.
The functions are moved around to save forward declaration.
Shawn Guo [Tue, 7 Feb 2017 09:16:34 +0000 (17:16 +0800)]
drm: vc4: use vblank hooks in struct drm_crtc_funcs
The vblank hooks in struct drm_driver are deprecated and only meant for
legacy drivers. For modern drivers with DRIVER_MODESET flag, the hooks
in struct drm_crtc_funcs should be used instead.
Shawn Guo [Tue, 7 Feb 2017 09:16:33 +0000 (17:16 +0800)]
drm: tilcdc: use vblank hooks in struct drm_crtc_funcs
The vblank hooks in struct drm_driver are deprecated and only meant for
legacy drivers. For modern drivers with DRIVER_MODESET flag, the hooks
in struct drm_crtc_funcs should be used instead.
While at it, the 'return' of .disable_vblank is dropped to fix the
following checkpatch warning.
WARNING: void function return statements are not generally useful
Shawn Guo [Tue, 7 Feb 2017 09:16:32 +0000 (17:16 +0800)]
drm: tegra: use vblank hooks in struct drm_crtc_funcs
The vblank hooks in struct drm_driver are deprecated and only meant for
legacy drivers. For modern drivers with DRIVER_MODESET flag, the hooks
in struct drm_crtc_funcs should be used instead.
As the result, the wrapper functions tegra_drm_xxx get killed
completely, and tegra_dc_xxx are filled into struct drm_crtc_funcs as
vblank hooks directly.
Shawn Guo [Tue, 7 Feb 2017 09:16:31 +0000 (17:16 +0800)]
drm: sun4i: use vblank hooks in struct drm_crtc_funcs
The vblank hooks in struct drm_driver are deprecated and only meant for
legacy drivers. For modern drivers with DRIVER_MODESET flag, the hooks
in struct drm_crtc_funcs should be used instead.
Shawn Guo [Tue, 7 Feb 2017 09:16:30 +0000 (17:16 +0800)]
drm: shmobile: use vblank hooks in struct drm_crtc_funcs
The vblank hooks in struct drm_driver are deprecated and only meant for
legacy drivers. For modern drivers with DRIVER_MODESET flag, the hooks
in struct drm_crtc_funcs should be used instead.
As the result, shmob_drm_crtc_enable_vblank() becomes a static function,
although it gets moved around a bit to save forward declaration.
Shawn Guo [Tue, 7 Feb 2017 09:16:29 +0000 (17:16 +0800)]
drm: rockchip: remove struct rockchip_crtc_funcs
With the vblank hooks in struct drm_crtc_funcs, we do not need to
maintain struct rockchip_crtc_funcs and the related registration
functions. Remove them.
Shawn Guo [Tue, 7 Feb 2017 09:16:28 +0000 (17:16 +0800)]
drm: rcar-du: use vblank hooks in struct drm_crtc_funcs
The vblank hooks in struct drm_driver are deprecated and only meant for
legacy drivers. For modern drivers with DRIVER_MODESET flag, the hooks
in struct drm_crtc_funcs should be used instead.
Shawn Guo [Tue, 7 Feb 2017 09:16:26 +0000 (17:16 +0800)]
drm: meson: use vblank hooks in struct drm_crtc_funcs
The vblank hooks in struct drm_driver are deprecated and only meant for
legacy drivers. For modern drivers with DRIVER_MODESET flag, the hooks
in struct drm_crtc_funcs should be used instead.
Shawn Guo [Tue, 7 Feb 2017 09:16:24 +0000 (17:16 +0800)]
drm: imx: remove struct imx_drm_crtc and imx_drm_crtc_helper_funcs
With the vblank hooks in struct drm_crtc_funcs, we do not need to
maintain the CRTC specific vblank callbacks with struct
imx_drm_crtc_helper_funcs any more. By moving the stuff that we
currently do in imx_drm_add_crtc(), like of_node setting and
drm_crtc_helper_add()/drm_crtc_init_with_planes() invoking, we can kill
things like struct imx_drm_crtc, imx_drm_crtc_helper_funcs and related
functions completely.
Functions ipu_enable_vblank() and ipu_disable_vblank() are moved around
without changes, only for saving the forward declarations.
Shawn Guo [Tue, 7 Feb 2017 09:16:22 +0000 (17:16 +0800)]
drm: hibmc: use vblank hooks in struct drm_crtc_funcs
The vblank hooks in struct drm_driver are deprecated and only meant for
legacy drivers. For modern drivers with DRIVER_MODESET flag, the hooks
in struct drm_crtc_funcs should be used instead.
Tomi Valkeinen [Wed, 8 Feb 2017 11:26:00 +0000 (13:26 +0200)]
drm/omap: use vblank hooks in struct drm_crtc_funcs
The vblank hooks in struct drm_driver are deprecated and only meant for
legacy drivers. For modern drivers with DRIVER_MODESET flag, the hooks
in struct drm_crtc_funcs should be used instead.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Tomeu Vizoso [Thu, 8 Dec 2016 13:11:56 +0000 (14:11 +0100)]
drm/edid: Don't print an error if the checksum of a CEA block is wrong
It's common to share screens within CI labs, and it's also common for
KVM switches to alter the contents of the CEA block but leave the
checksum outdated.
So in this case, print a debug message instead of an error.
References: https://bugs.freedesktop.org/show_bug.cgi?id=98228 Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tomi Sarvela <tomi.p.sarvela@intel.com> Cc: intel-gfx@lists.freedesktop.org Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Tested-by: Jari Tahvanainen <jari.tahvanainen@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1481202716-31317-1-git-send-email-tomeu.vizoso@collabora.com
Shawn Guo [Tue, 7 Feb 2017 09:16:21 +0000 (17:16 +0800)]
drm: fsl-dcu: use vblank hooks in struct drm_crtc_funcs
The vblank hooks in struct drm_driver are deprecated and only meant for
legacy drivers. For modern drivers with DRIVER_MODESET flag, the hooks
in struct drm_crtc_funcs should be used instead.
Colin Ian King [Fri, 3 Feb 2017 19:56:24 +0000 (19:56 +0000)]
drm/vc4: simplify exit path of a failed allocation of dsi_connector
If dsi_connector fails to allocate, the exit path via label 'fail'
checks if connector is null, which it always is, so the cleanup
that destroys connector is never going to be called. Hence the
failure path can be more optimally performed by removing this
and just returning ERR_PTR(-ENOMEM). This also removes the need
to initialize connector to NULL, and we can also remove ret too.
Detected by CoverityScan, CID#1399504 ("Logicall Dead Code")
Shawn Guo [Tue, 7 Feb 2017 09:16:20 +0000 (17:16 +0800)]
drm: exynos: use vblank hooks in struct drm_crtc_funcs
The vblank hooks in struct drm_driver are deprecated and only meant for
legacy drivers. For modern drivers with DRIVER_MODESET flag, the hooks
in struct drm_crtc_funcs should be used instead.
As the result, exynos_drm_crtc_enable[disable]_vblank() become static
functions. They are moved around a bit to save forward declaration
though. Also while at it, we move one step further to kill
exynos_drm_crtc_from_pipe() completely by updating hdmi_bind() a bit.
Shawn Guo [Tue, 7 Feb 2017 09:16:19 +0000 (17:16 +0800)]
drm: atmel: use vblank hooks in struct drm_crtc_funcs
The vblank hooks in struct drm_driver are deprecated and only meant for
legacy drivers. For modern drivers with DRIVER_MODESET flag, the hooks
in struct drm_crtc_funcs should be used instead.
Shawn Guo [Tue, 7 Feb 2017 09:16:18 +0000 (17:16 +0800)]
drm: armada: use vblank hooks in struct drm_crtc_funcs
The vblank hooks in struct drm_driver are deprecated and only meant for
legacy drivers. For modern drivers with DRIVER_MODESET flag, the hooks
in struct drm_crtc_funcs should be used instead. As the result,
functions armada_drm_crtc_enable[disable]_irq() can be static, although
they are moved around a bit to save forward declaration.
The armada_crtc pointer array in struct armada_private is still kept in
there, because armada_debugfs.c still have reference to it.
Shawn Guo [Tue, 7 Feb 2017 09:16:17 +0000 (17:16 +0800)]
drm: malidp: use vblank hooks in struct drm_crtc_funcs
The vblank hooks in struct drm_driver are deprecated and only meant for
legacy drivers. For modern drivers with DRIVER_MODESET flag, the hooks
in struct drm_crtc_funcs should be used instead.
Shawn Guo [Tue, 7 Feb 2017 09:16:16 +0000 (17:16 +0800)]
drm: hdlcd: use vblank hooks in struct drm_crtc_funcs
The vblank hooks in struct drm_driver are deprecated and only meant for
legacy drivers. For modern drivers with DRIVER_MODESET flag, the hooks
in struct drm_crtc_funcs should be used instead.
Shawn Guo [Tue, 7 Feb 2017 09:16:14 +0000 (17:16 +0800)]
drm: remove drm_vblank_no_hw_counter assignment from driver code
Core code already makes drm_driver.get_vblank_counter hook optional by
letting drm_vblank_no_hw_counter be the default implementation for the
function hook. So the drm_vblank_no_hw_counter assignment in the driver
code becomes redundant and can be removed now.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Cc: Alexey Brodkin <abrodkin@synopsys.com> Cc: Liviu Dudau <liviu.dudau@arm.com> Cc: Mali DP Maintainers <malidp@foss.arm.com> Cc: Russell King <linux@armlinux.org.uk> Cc: Boris Brezillon <boris.brezillon@free-electrons.com> Cc: Inki Dae <inki.dae@samsung.com> Cc: Stefan Agner <stefan@agner.ch> Cc: Xinliang Liu <z.liuxinliang@hisilicon.com> Cc: Daniel Vetter <daniel.vetter@intel.com> Cc: Philipp Zabel <p.zabel@pengutronix.de> Cc: CK Hu <ck.hu@mediatek.com> Cc: Neil Armstrong <narmstrong@baylibre.com> Cc: Rob Clark <robdclark@gmail.com> Cc: Marek Vasut <marex@denx.de> Cc: Ben Skeggs <bskeggs@redhat.com> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Mark Yao <mark.yao@rock-chips.com> Cc: Benjamin Gaignard <benjamin.gaignard@linaro.org> Cc: Maxime Ripard <maxime.ripard@free-electrons.com> Cc: Jyri Sarha <jsarha@ti.com> Cc: Eric Anholt <eric@anholt.net> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com> Acked-by: Neil Armstrong <narmstrong@baylibre.com> Acked-by: Russell King <rmk+kernel@armlinux.org.uk> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Alexey Brodkin <abrodkin@synopsys.com> Acked-by: Liviu Dudau <liviu.dudau@arm.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1486458995-31018-3-git-send-email-shawnguo@kernel.org
Shawn Guo [Tue, 7 Feb 2017 09:16:13 +0000 (17:16 +0800)]
drm: add vblank hooks to struct drm_crtc_funcs
The vblank is mostly CRTC specific and implemented as part of CRTC
driver. Let's keep the vblank hooks struct drm_driver for legacy
drivers, and add corresponding hooks in struct drm_crtc_funcs. These
hooks take struct drm_crtc pointer as argument, and will be called by
core vblank handling code for DRIVER_MODESET drivers.
The new hooks get plugged into core by adding wrapper functions for
vblank handling code. The .get_vblank_counter hook is effectively
optional, as we provide drm_vblank_no_hw_counter() as the default
fallback in the wrapper function.
Daniel Vetter [Tue, 7 Feb 2017 16:16:03 +0000 (17:16 +0100)]
drm/fb-helper: Automatically clean up fb_info
Noticed that everyone duplicates the same logic here and we could safe
a few lines per driver. Yay for lots of drivers to make such tiny
refactors worth-while!
Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Sean Paul <seanpaul@chromium.org> Cc: Noralf Trønnes <noralf@tronnes.org> Cc: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/20170207161603.17611-1-daniel.vetter@ffwll.ch
Daniel Vetter [Tue, 7 Feb 2017 14:10:49 +0000 (15:10 +0100)]
drm/fb-helper: Explain unload sequence a bit better
While reviewing Chris' patches to properly cancel our async workers I
checked that this happens after the fbdev is already unregistered.
That's the case, but I found a small gap in our docs, fill that in.
Note that I don't explain what release_fbi does, because that function
will disappear in the next patch ...
Thierry Reding [Tue, 7 Feb 2017 17:51:13 +0000 (18:51 +0100)]
drm/doc: Add TODO list
This commit adds a TODO list to the GPU driver developer's guide. The
content was taken from the DRMJanitors page on the X.Org wiki:
https://www.x.org/wiki/DRMJanitors/
The goal is to track a list of refactorings that would be nice to see
merged eventually. Sometimes these would be encountered during patch
review on the mailing list, and at other times one can come across
these while working in a specific area of code.
As we require valid start/end parameters, we can replace the initial
potential NULL with a pointer to the drm_mm.head_node and so reduce the
test on every iteration from a NULL + address comparison to just an
address comparison.
add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-26 (-26)
function old new delta
i915_gem_evict_for_node 719 693 -26
Allows using atomic flip helpers for drivers
using ASYNC flip.
Remove ASYNC_FLIP restriction in helpers and
caches the page flip flags in drm_crtc_state
to be used in the low level drivers.
v2:
Resending the patch since the original was broken.
v3:
Save flag in crtc_state instead of plane_state
v4:
Reset the flag before using again.
v5:
Fix type in header.
Rename the field to pageflip_flags.
Remove unrelated hunk.
Chris Wilson [Thu, 2 Feb 2017 21:04:38 +0000 (21:04 +0000)]
drm: Improve drm_mm search (and fix topdown allocation) with rbtrees
The drm_mm range manager claimed to support top-down insertion, but it
was neither searching for the top-most hole that could fit the
allocation request nor fitting the request to the hole correctly.
In order to search the range efficiently, we create a secondary index
for the holes using either their size or their address. This index
allows us to find the smallest hole or the hole at the bottom or top of
the range efficiently, whilst keeping the hole stack to rapidly service
evictions.
v2: Search for holes both high and low. Rename flags to mode.
v3: Discover rb_entry_safe() and use it!
v4: Kerneldoc for enum drm_mm_insert_mode.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Cc: Alex Deucher <alexander.deucher@amd.com> Cc: "Christian König" <christian.koenig@amd.com> Cc: David Airlie <airlied@linux.ie> Cc: Russell King <rmk+kernel@armlinux.org.uk> Cc: Daniel Vetter <daniel.vetter@intel.com> Cc: Jani Nikula <jani.nikula@linux.intel.com> Cc: Sean Paul <seanpaul@chromium.org> Cc: Lucas Stach <l.stach@pengutronix.de> Cc: Christian Gmeiner <christian.gmeiner@gmail.com> Cc: Rob Clark <robdclark@gmail.com> Cc: Thierry Reding <thierry.reding@gmail.com> Cc: Stephen Warren <swarren@wwwdotorg.org> Cc: Alexandre Courbot <gnurou@gmail.com> Cc: Eric Anholt <eric@anholt.net> Cc: Sinclair Yeh <syeh@vmware.com> Cc: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Reviewed-by: Sinclair Yeh <syeh@vmware.com> # vmwgfx Reviewed-by: Lucas Stach <l.stach@pengutronix.de> #etnaviv Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/20170202210438.28702-1-chris@chris-wilson.co.uk
Dave Airlie [Thu, 2 Feb 2017 19:41:58 +0000 (05:41 +1000)]
Merge branch 'drm-etnaviv-next' of https://git.pengutronix.de/git/lst/linux into drm-next
It includes code cleanups from Bhumika and Liviu, a significant shader
performance fix and additions to the cmdstream validator from Wladimir
and the addition of a cmdbuf suballocator by myself.
The suballocator improves performance on all chips by reducing the CPU
overhead of the kernel driver and side steps the GC3000 FE MMU flush
erratum, now making the workarounds in IOVA allocation we had before
unnecessary, which results in a nice cleanup of the code in that area.
* 'drm-etnaviv-next' of https://git.pengutronix.de/git/lst/linux:
drm/etnaviv: Remove duplicate header file include
Revert "drm/etnaviv: trick drm_mm into giving out a low IOVA"
drm/etnaviv: add cmdbuf suballocator
drm/etnaviv: get cmdbuf physical address through the cmdbuf abstraction
drm/etnaviv: wire up iova handling in new cmdbuf abstraction
drm/etnaviv: move cmdbuf de-/allocation into own file
drm/etnaviv: always flush MMU TLBs on map/unmap
drm/etnaviv: constify etnaviv_iommu_ops structures
drm/etnaviv: set up initial PULSE_EATER register
drm/etnaviv: add new GC3000 sensitive states
Commit be7f735cd5ea ("drm: Rely on mode_config data for fb_helper
initialization") broke the build when CONFIG_DRM_FBDEV_EMULATION is
disabled because it didn't update the prototype for drm_fb_helper_init
in that case.
drm: Rely on mode_config data for fb_helper initialization
Instead of receiving the num_crts as a parameter, we can read it
directly from the mode_config structure. I audited the drivers that
invoke this helper and I believe all of them initialize the mode_config
struct accordingly, prior to calling the fb_helper.
I used the following coccinelle hack to make this transformation, except
for the function headers and comment updates. The first and second
rules are split because I couldn't find a way to remove the unused
temporary variables at the same time I removed the parameter.
Chris Wilson [Thu, 2 Feb 2017 09:36:32 +0000 (09:36 +0000)]
drm: Provide a driver hook for drm_dev_release()
Some state is coupled into the device lifetime outside of the
load/unload timeframe and requires teardown during final unreference
from drm_dev_release(). For example, dmabufs hold both a device and
module reference and may live longer than expected (i.e. the current
pattern of the driver tearing down its state and then releasing a
reference to the drm device) and yet touch driver private state when
destroyed.
v2: Export drm_dev_fini() and move the responsibility for finalizing the
drm_device and freeing it to the release callback. (If no callback is
provided, the core will call drm_dev_fini() and kfree(dev) as before.)
v3: Remember to add drm_dev_fini() to drm_drv.h
v4: Tidy language for kerneldoc
v5: Cross reference from drm_dev_init() to note that driver->release()
allows for arbitrary embedding.
v6: Refer to driver data rather than driver state, as state is now
becoming associated with the struct drm_atomic_state and friends.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
[danvet: Use the proper reference for struct members, which is
&drm_driver.release.] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/20170202093632.31017-1-chris@chris-wilson.co.uk
Neil Armstrong [Thu, 2 Feb 2017 09:47:44 +0000 (10:47 +0100)]
drm: meson: rename driver name to meson-drm
The platform driver name is currently "meson" which can lead to some
confusion, this patch renames it to "meson-drm" and removes the owner
attribute since is always added by __platform_driver_register called by the
module_platform_driver() macro.
Andrzej Hajda [Wed, 1 Feb 2017 07:47:51 +0000 (08:47 +0100)]
drm/bridge/sii8620: enable MHL3 mode if possible
Since all sub-protocols of MHL3 are already supported MHL3 mode can be
enabled. With this patch it is possible to use packed pixel modes and
clocks up to 300MHz - 1920x1080@60Hz and 4K modes.
Andrzej Hajda [Wed, 1 Feb 2017 07:47:47 +0000 (08:47 +0100)]
drm/bridge/sii8620: rewrite hdmi start sequence
MHL3 protocol requires registry adjustments depending on chosen video mode.
Necessary information is gathered in mode_fixup callback. In case of HDMI
video modes driver should also send special AVI and MHL3 infoframes.
The patch introduces generic helpers for handling MHL3 infoframes, in
case of appearance of other users of MHL3 infoframes these function can
be moved to common library.
Andrzej Hajda [Wed, 1 Feb 2017 07:47:46 +0000 (08:47 +0100)]
drm/bridge/mhl: add MHL3 infoframe related definitions
MHL3 protocol uses vendor specific infoframes to transmit additional
information to the sink. This patch adds definitions of structures and
constants used to create such frames.
Andrzej Hajda [Wed, 1 Feb 2017 07:47:44 +0000 (08:47 +0100)]
drm/bridge/sii8620: split EDID read and write code
MHL3 requires that after reading EDID from the sink source should ask
peer for features. To make both protocols happy the patch splits the code
accordingly.
Andrzej Hajda [Wed, 1 Feb 2017 07:47:41 +0000 (08:47 +0100)]
drm/bridge/sii8620: set gen2 write burst before sending MSC command
Write burst should be enabled for MHL_INT_RC_FEAT_REQ and disabled for
other commands. The patch moves functions up and adds delay setting
for MHL3 burst mode.
Andrzej Hajda [Wed, 1 Feb 2017 07:47:38 +0000 (08:47 +0100)]
drm/bridge/sii8620: fix MSC message removal
Messages queue can be cleaned up by message callbacks, to avoid repeated
removal of current message it should be removed from the queue before
calling these callbacks.
Andrzej Hajda [Wed, 1 Feb 2017 07:47:35 +0000 (08:47 +0100)]
drm/bridge/sii8620: respond to feature requests
MHL3 protocol requires device to respond to feature request from peer.
This minimal answer fulfills the requirement and allows to continue
negotiation.
Andrzej Hajda [Wed, 1 Feb 2017 07:47:32 +0000 (08:47 +0100)]
drm/bridge/sii8620: initial support for eCBUS-S mode
The Single-ended eCBUS Mode (eCBUS-S) mode provides 60 Mb/s full-duplex
bidirectional traffic for three channels:
- CBUS data (CBUS1 channel),
- High-bandwidth MHL data (eMSC channel),
- tunneling data (T-CBUS channel).
It is required to fully support MHL3 dongles.
Andrzej Hajda [Wed, 1 Feb 2017 07:47:31 +0000 (08:47 +0100)]
drm/bridge/sii8620: add continuations to messages
Due to asynchronous nature of MHL flow of execution is dispersed.
Logical continuation of some actions happens after response of peer,
i.e in interrupt handler. To simplify coding continuation mechanism
has been added - it is now possible to provide continuation callback,
which will be called after peer responds to given action.
Lucas Stach [Mon, 16 Jan 2017 16:29:57 +0000 (17:29 +0100)]
drm/etnaviv: add cmdbuf suballocator
There are 3 big benefits to suballocating a single big DMA buffer
for command submission:
1. Avoid hammering CMA. The old way of allocating and freeing a DMA
buffer for each submission was hitting some of the real slow
pathes in CMA, as this allocator was not designed for a concurrent
small buffers load.
2. Less TLB flushes on IOMMUv2. If a new command buffer is mapped into
the GPU address space the MMU TLBs need to be flushed. By having
one big buffer statically mapped to the GPU, a lot of those flushes
can be avoided.
3. No funky workarounds for GC3000. The FE TLB flush on GC3000 isn't
reliable. To work around that we tried to lay out the cmdbufs in
the GPU address space in a way to avoid this issue. This hasn't
always worked if the address space is crowded. A single statically
mapped buffer avoids the erratum completely.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Lucas Stach [Tue, 17 Jan 2017 09:59:37 +0000 (10:59 +0100)]
drm/etnaviv: always flush MMU TLBs on map/unmap
This ensures that the GPU isn't able to write into already freed
objects, as doing this in the IOVA reaper isn't enough, as the
gem_free_object path will also cause unmaps to happen.
On MMUv2 this also ensures that stale entries, which may have
been prefetched into the TLB will be purged.
The flush is low overhead, as it gets batched up with the next
user command buffer, so this isn't incuring an overhead for
each buffer map/unmap.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Declare etnaviv_iommu_ops structure as const as it is only used when
the reference of one of its field is stored in the ops field of a
iommu_domain structure. This ops field is of type const, so
etnaviv_iommu_ops structures having similar properties can be declared
const too.
Done using Coccinelle.
Before and after size details of .o file remains the same after
cross compiling for arm architecture.
lst: Trimmed commit message, apply the same change to iommu_v2.
Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
No longer true since commit 07f8d9bdb235 ("drm/qxl: add support for > 1
output"). qxl_num_crtc defaults to 4 and is configurable as a module
parameter.
Eric Anholt [Tue, 31 Jan 2017 19:29:11 +0000 (11:29 -0800)]
drm/vc4: Add DSI driver
The DSI0 and DSI1 blocks on the 2835 are related hardware blocks.
Some registers move around, and the featureset is slightly different,
as DSI1 (the 4-lane DSI) is a later version of the hardware block.
This driver doesn't yet enable DSI0, since we don't have any hardware
to test against, but it does put a lot of the register definitions and
code in place.
v2: Use the clk_hw interfaces, don't set CLK_IS_BASIC (from review by
Stephen Boyd)
Eric Anholt [Wed, 14 Dec 2016 19:46:15 +0000 (11:46 -0800)]
drm/vc4: Add support for feeding DSI encoders from the pixel valve.
We have to set a different pixel format, which tells the hardware to
use the pix_width field that's fed in sideband from the DSI encoder to
divide the "pixel" clock.
Eric Anholt [Wed, 14 Dec 2016 19:46:14 +0000 (11:46 -0800)]
drm/vc4: Set up SCALER_DISPCTRL at boot.
We want the HVS on, obviously, and we also want DSP3 (PV1's source) to
be muxed from HVS channel 2 like we expect in vc4_crtc.c. The
firmware wasn't setting the DSP3 mux up when both the LCD and HDMI
were disabled.
Takashi Iwai [Tue, 17 Jan 2017 16:43:29 +0000 (17:43 +0100)]
drm: Clean up the 1366x768 fixup codes
This is just a cleanup, no functional change.
The fixup code for 1366x768 in drm_mode_create_from_cmdline_mode() is
basically a copy of the existing code in drm_edid.c. Make the latter
code public so that it can be called from the former function.
Dave Airlie [Tue, 31 Jan 2017 22:40:13 +0000 (08:40 +1000)]
Merge branch 'drm-vmwgfx-next' of git://people.freedesktop.org/~syeh/repos_linux into drm-next
This is to address what we've discussed, moving some of the minor changes
into a drm-next request.
* 'drm-vmwgfx-next' of git://people.freedesktop.org/~syeh/repos_linux:
drm/vmwgfx: Use kmemdup instead of kmalloc and memcpy
drm/vmwgfx: Fix depth input into drm_mode_legacy_fb_format
drm/vmwgfx: Fix a potential integer overflow
drm/vmwgfx: Clear an uninitialized struct member
drm/vmwgfx: Annotate ignored return values
drm/vmwgfx: Clear uninitialized fields of a parameter