summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/pl111
Commit message (Collapse)AuthorAgeFilesLines
* drm/pl111: Add handling of Versatile platformsLinus Walleij2017-09-105-10/+285
| | | | | | | | | | | The ARM reference designs in the Versatile family: Integrator, Versatile and RealView can make use of the new DRM driver as well. We just need to create a bit of platform-specific code for them that we isolate to its own file. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/20170908124709.4758-7-linus.walleij@linaro.org
* drm/pl111: Add optional variant display en/disable callbacksLinus Walleij2017-09-102-0/+9
| | | | | | | | | | The silcon and components around the PL111 may require some variants to perform special set-up of the display. Add two callbacks to manage this. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/20170908124709.4758-6-linus.walleij@linaro.org
* drm/pl111: Insert delay before powering up PL11xLinus Walleij2017-09-101-3/+28
| | | | | | | | | | | | | | | | The old codebase has a delay between enabling and powering up the PL11x. According to the manual for PL110, ARM DDI 0161E page 1-5 and the PL111 manual ARM DDI 0293C page 1-6, the power sequence should be such that once Vdd is stable (which we assume it is at boot) LCDEN is enabled first and then CLPOWER should be enabled "after the signals have stabilized" and this is said to be display-dependent. The old codebase uses 20ms. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/20170908124709.4758-5-linus.walleij@linaro.org
* drm/pl111: Enable PL110 variantLinus Walleij2017-09-103-25/+108
| | | | | | | | | | | | | We detect and enable the use of the PL110 variant, an earlier incarnation of PL111. The only real difference is that the control and interrupt enable registers have swapped place. The Versatile AB and Versatile PB have a variant inbetween PL110 and PL111, it is PL110 but they have already swapped the two registers so those two need a bit of special handling. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/20170908124709.4758-4-linus.walleij@linaro.org
* drm/pl111: Replace custom connector with panel bridgeLinus Walleij2017-09-106-168/+49Star
| | | | | | | | | | | | | | | This replaces the custom connector in the PL111 with the panel bridge helper. This works nicely for all standard panels, but since there are several PL11x-based systems that will need to use the dumb VGA connector bridge we use drm_of_find_panel_or_bridge() and make some headroom for dealing with bridges that are not panels as well, and drop a TODO in the code. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/20170908124709.4758-3-linus.walleij@linaro.org
* drm/pl111: Add all registers to debugfsLinus Walleij2017-09-101-0/+6
| | | | | | | | | | This adds all the main control registers to the debugfs register file. This was helpful for my debugging so it will likely help others as well. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/20170908124709.4758-2-linus.walleij@linaro.org
* drm/pl111: Cleanup local header fileLinus Walleij2017-09-101-4/+0Star
| | | | | | | | | The header file contains prototypes for two nonexisting functions. Get rid of them. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/20170908124709.4758-1-linus.walleij@linaro.org
* drm/pl111: Use drm_gem_fb_create() and drm_gem_fb_prepare_fb()Noralf Trønnes2017-08-162-2/+4
| | | | | | | | | | drm_fb_cma_create() and drm_fb_cma_prepare_fb() are just wrappers now, use drm_gem_fb_create() and drm_gem_fb_prepare_fb() directly. Cc: Eric Anholt <eric@anholt.net> Signed-off-by: Noralf Trønnes <noralf@tronnes.org> Reviewed-by: Eric Anholt <eric@anholt.net> Link: https://patchwork.freedesktop.org/patch/msgid/1502631125-13557-14-git-send-email-noralf@tronnes.org
* drm: make drm_mode_config_func constBhumika Goyal2017-08-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make these structures const as they are only stored in the funcs field of a drm_mode_config structure which is of type const. Done using Coccinelle: @match disable optional_qualifier@ identifier s; @@ static struct drm_mode_config_funcs s = {...}; @ref@ position p; identifier match.s; @@ s@p @good1@ identifier y; position ref.p; identifier match.s; @@ struct drm_mode_config y = {...,.funcs=&s@p,...}; @good2@ struct drm_mode_config y; identifier match.s; position ref.p; @@ y.funcs = &s@p @bad depends on !good1 && !good2@ position ref.p; identifier match.s; @@ s@p @depends on forall !bad disable optional_qualifier@ identifier match.s; @@ static + const struct drm_mode_config_funcs s; Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/1502204751-16525-1-git-send-email-bhumirks@gmail.com
* drm: Nuke drm_atomic_helper_connector_dpmsDaniel Vetter2017-08-081-1/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's dead code, the core handles all this directly now. The only special case is nouveau and tda988x which used one function for both legacy modeset code and -nv50 atomic world instead of 2 vtables. But amounts to exactly the same. v2: Rebase over the panel/brideg refactorings in stm/ltdc. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Archit Taneja <architt@codeaurora.org> Cc: Andrzej Hajda <a.hajda@samsung.com> Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com> Cc: Peter Senna Tschudin <peter.senna@collabora.com> Cc: Martin Donnelly <martin.donnelly@ge.com> Cc: Martyn Welch <martyn.welch@collabora.co.uk> Cc: Daniel Vetter <daniel.vetter@intel.com> Cc: Jani Nikula <jani.nikula@linux.intel.com> Cc: Sean Paul <seanpaul@chromium.org> Cc: David Airlie <airlied@linux.ie> Cc: Inki Dae <inki.dae@samsung.com> Cc: Joonyoung Shim <jy0922.shim@samsung.com> Cc: Seung-Woo Kim <sw0312.kim@samsung.com> Cc: Kyungmin Park <kyungmin.park@samsung.com> Cc: Kukjin Kim <kgene@kernel.org> Cc: Krzysztof Kozlowski <krzk@kernel.org> Cc: Stefan Agner <stefan@agner.ch> Cc: Alison Wang <alison.wang@freescale.com> Cc: Russell King <linux@armlinux.org.uk> Cc: Philipp Zabel <p.zabel@pengutronix.de> Cc: CK Hu <ck.hu@mediatek.com> Cc: Matthias Brugger <matthias.bgg@gmail.com> Cc: Neil Armstrong <narmstrong@baylibre.com> Cc: Carlo Caione <carlo@caione.org> Cc: Kevin Hilman <khilman@baylibre.com> Cc: Marek Vasut <marex@denx.de> Cc: Ben Skeggs <bskeggs@redhat.com> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Cc: Eric Anholt <eric@anholt.net> Cc: Mark Yao <mark.yao@rock-chips.com> Cc: Heiko Stuebner <heiko@sntech.de> Cc: Benjamin Gaignard <benjamin.gaignard@linaro.org> Cc: Vincent Abriou <vincent.abriou@st.com> Cc: Yannick Fertre <yannick.fertre@st.com> Cc: Philippe Cornu <philippe.cornu@st.com> Cc: Maxime Ripard <maxime.ripard@free-electrons.com> Cc: Chen-Yu Tsai <wens@csie.org> Cc: Thierry Reding <thierry.reding@gmail.com> Cc: Jonathan Hunter <jonathanh@nvidia.com> Cc: Jyri Sarha <jsarha@ti.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Shawn Guo <shawnguo@kernel.org> Cc: John Stultz <john.stultz@linaro.org> Cc: Lars-Peter Clausen <lars@metafoo.de> Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Cc: Jeffy Chen <jeffy.chen@rock-chips.com> Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com> Cc: Yakir Yang <kuankuan.y@gmail.com> Cc: Marek Szyprowski <m.szyprowski@samsung.com> Cc: Jose Abreu <Jose.Abreu@synopsys.com> Cc: Romain Perier <romain.perier@collabora.com> Cc: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Cc: Xinliang Liu <z.liuxinliang@hisilicon.com> Cc: Alexey Brodkin <abrodkin@synopsys.com> Cc: Alex Deucher <alexander.deucher@amd.com> Cc: Rongrong Zou <zourongrong@gmail.com> Cc: Rob Clark <robdclark@gmail.com> Cc: Hai Li <hali@codeaurora.org> Cc: "Noralf Trønnes" <noralf@tronnes.org> Cc: linux-arm-kernel@lists.infradead.org Cc: linux-samsung-soc@vger.kernel.org Cc: intel-gfx@lists.freedesktop.org Cc: linux-mediatek@lists.infradead.org Cc: linux-amlogic@lists.infradead.org Cc: nouveau@lists.freedesktop.org Cc: linux-renesas-soc@vger.kernel.org Cc: linux-rockchip@lists.infradead.org Cc: linux-tegra@vger.kernel.org Cc: virtualization@lists.linux-foundation.org Cc: zain wang <wzz@rock-chips.com> Cc: Baoyou Xie <baoyou.xie@linaro.org> Cc: Boris Brezillon <boris.brezillon@free-electrons.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20170725080122.20548-8-daniel.vetter@ffwll.ch Acked-by: Neil Armstrong <narmstrong@baylibre.com> Reviewed-by: Neil Armstrong <narmstrong@baylibre.com> Acked-by: Philipp Zabel <p.zabel@pengutronix.de> Acked-by: Archit Taneja <architt@codeaurora.org> Tested-by: Philippe Cornu <philippe.cornu@st.com> (on stm) Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Shawn Guo <shawnguo@kernel.org> Acked-by: Shawn Guo <shawnguo@kernel.org> Acked-by: Noralf Trønnes <noralf@tronnes.org> Acked-by: Vincent Abriou <vincent.abriou@st.com>
* drm: Plumb modifiers through plane initBen Widawsky2017-08-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the plumbing for supporting fb modifiers on planes. Modifiers have already been introduced to some extent, but this series will extend this to allow querying modifiers per plane. Based on this, the client to enable optimal modifications for framebuffers. This patch simply allows the DRM drivers to initialize their list of supported modifiers upon initializing the plane. v2: A minor addition from Daniel v3: * Updated commit message * s/INVALID/DRM_FORMAT_MOD_INVALID (Liviu) * Remove some excess newlines (Liviu) * Update comment for > 64 modifiers (Liviu) v4: Minor comment adjustments (Liviu) v5: Some new platforms added due to rebase v6: Add some missed plane inits (or maybe they're new - who knows at this point) (Daniel) Signed-off-by: Ben Widawsky <ben@bwidawsk.net> Reviewed-by: Daniel Stone <daniels@collabora.com> (v2) Reviewed-by: Liviu Dudau <Liviu.Dudau@arm.com> Signed-off-by: Daniel Stone <daniels@collabora.com>
* drm/pl111: Use .dumb_map_offset and .dumb_destroy defaultsNoralf Trønnes2017-07-291-2/+0Star
| | | | | | | | | | This driver can use the drm_driver.dumb_destroy and drm_driver.dumb_map_offset defaults, so no need to set them. Cc: Eric Anholt <eric@anholt.net> Signed-off-by: Noralf Trønnes <noralf@tronnes.org> Reviewed-by: Eric Anholt <eric@anholt.net> Link: https://patchwork.freedesktop.org/patch/msgid/1500837417-40580-13-git-send-email-noralf@tronnes.org
* drm/pl111: Use gem_free_object_unlockedDaniel Vetter2017-07-181-1/+1
| | | | | | | | | | CMA helpers are struct_mutex free, and so is the pl111 itself. And that's the only valid reason for using gem_free_object. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net> Link: https://patchwork.freedesktop.org/patch/msgid/20170717151045.4188-2-daniel.vetter@ffwll.ch
* drm/pl111: Fix offset calculation for the primary plane.Eric Anholt2017-06-071-13/+2Star
| | | | | | | | | | | If src_x/y were nonzero, we failed to shift them down by 16 to get the pixel offset. The recent CMA helper function gets it right. Signed-off-by: Eric Anholt <eric@anholt.net> Fixes: bed41005e617 ("drm/pl111: Initial drm/kms driver for pl111") Reported-by: Mircea Carausu <mircea.carausu@broadcom.com> Link: http://patchwork.freedesktop.org/patch/msgid/20170603015733.13266-1-eric@anholt.net Reviewed-by: Sean Paul <seanpaul@chromium.org>
* drm/pl111: fix warnings without CONFIG_ARM_AMBAArnd Bergmann2017-05-311-3/+3
| | | | | | | | | | | | | | | | | The driver is written in a way to enable compile-testing without CONFIG_ARM_AMBA, but it just causes needless warnings: drivers/gpu/drm/pl111/pl111_drv.c:149:26: error: 'pl111_drm_driver' defined but not used [-Werror=unused-variable] drivers/gpu/drm/pl111/pl111_drv.c:81:12: error: 'pl111_modeset_init' defined but not used [-Werror=unused-function] This unhides the probe/remove functions again and just leaves the driver object as unused when CONFIG_ARM_AMBA is disabled, with a __maybe_unused annotation to shut up the warning. Fixes: bed41005e617 ("drm/pl111: Initial drm/kms driver for pl111") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Eric Anholt <eric@anholt.net> Link: http://patchwork.freedesktop.org/patch/msgid/20170524155020.1777369-1-arnd@arndb.de
* drm/pl111: select DRM_PANELArnd Bergmann2017-05-311-0/+1
| | | | | | | | | | | | | | | | | | When DRM_PANEL is disabled, we get a link error for pl111: drivers/gpu/built-in.o: In function `pl111_connector_destroy': pl111_connector.c:(.text+0x3487e6): undefined reference to `drm_panel_detach' For some reason this only appears in the latest linux-next although the driver appears to have used the symbol for a few weeks already. The solution however is simple enough, we just need to add a 'select' statement. Fixes: bed41005e617 ("drm/pl111: Initial drm/kms driver for pl111") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Tested-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/20170530092224.1204037-1-arnd@arndb.de
* drm/pl111: Fix return value check in pl111_amba_probe()Wei Yongjun2017-05-221-2/+2
| | | | | | | | | | | In case of error, the function devm_ioremap_resource() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Fixes: bed41005e617 ("drm/pl111: Initial drm/kms driver for pl111") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Reviewed-by: Eric Anholt <eric@anholt.net> Link: http://patchwork.freedesktop.org/patch/msgid/20170521010152.6186-1-weiyj.lk@gmail.com
* drm/pl111: Add a debugfs node to dump our registers.Eric Anholt2017-05-194-0/+64
| | | | | | | | | | | | While debugging an X11 display failure, I wanted to see where we were actually scanning out from. This is probably generally useful to others that might be working on this device. v2: Fix uint32_t sparse warning. Signed-off-by: Eric Anholt <eric@anholt.net> Link: http://patchwork.freedesktop.org/patch/msgid/20170518005640.10310-1-eric@anholt.net Reviewed-by: Linus Walleij <linus.walleij@linaro.org> (v1)
* drm/pl111: make structure mode_config_funcs staticColin Ian King2017-05-191-1/+1
| | | | | | | | | | | structure mode_config_funcs can be made static as it does not need to be in global scope. Fixes sparse warning: warning: symbol 'mode_config_funcs' was not declared. Should it be static? Signed-off-by: Colin Ian King <colin.king@canonical.com> Reviewed-by: Eric Anholt <eric@anholt.net> Link: http://patchwork.freedesktop.org/patch/msgid/20170519111018.19641-1-colin.king@canonical.com
* drm/pl111: make structure pl111_display_funcs staticColin Ian King2017-05-191-1/+1
| | | | | | | | | | | | structure pl111_display_funcs can be made static as it does not need to be in global scope. Fixes sparse warning: "warning: symbol 'pl111_display_funcs' was not declared. Should it be static?" Signed-off-by: Colin Ian King <colin.king@canonical.com> Reviewed-by: Eric Anholt <eric@anholt.net> Link: http://patchwork.freedesktop.org/patch/msgid/20170519110203.19417-1-colin.king@canonical.com
* drm/pl111: Register the clock divider and use it.Eric Anholt2017-05-194-24/+158
| | | | | | | | | | | | | | | This is required for the panel to work on bcm911360, where CLCDCLK is the fixed 200Mhz AXI41 clock. The rate set is still passed up to the CLCDCLK, for platforms that have a settable rate on that one. v2: Set SET_RATE_PARENT (caught by Linus Walleij), depend on COMMON_CLK. v3: Mark the clk_ops static (caught by Stephen). Signed-off-by: Eric Anholt <eric@anholt.net> Link: http://patchwork.freedesktop.org/patch/msgid/20170508193348.30236-1-eric@anholt.net Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Stephen Boyd <sboyd@codeaurora.org>
* drm/pl111: Initial drm/kms driver for pl111Tom Cooksey2017-05-086-0/+816
This is a modesetting driver for the pl111 CLCD display controller found on various ARM platforms such as the Versatile Express. The driver has only been tested on the bcm911360_entphn platform so far, with PRIME-based buffer sharing between vc4 and clcd. It reuses the existing devicetree binding, while not using quite as many of its properties as the fbdev driver does (those are left for future work). v2: Nearly complete rewrite by anholt, cutting 2/3 of the code thanks to DRM core's excellent new helpers. v3: Don't match pl110 any more, don't attach if we don't have a DRM panel, use DRM_GEM_CMA_FOPS, update MAINTAINERS, use the simple display helper, use drm_gem_cma_dumb_create (same as our wrapper). v4: Change the driver's .name to not clash with fbdev in sysfs, drop platform alias, drop redundant "drm" in DRM driver name, hook up .prepare_fb to the CMA helper so that DMA fences should work. v5: Move register definitions inside the driver directory, fix build in COMPILE_TEST and !AMBA mode. v6: Drop TIM2_CLKSEL for now to be consistent with existing DT bindings, switch back to external register definitions. Signed-off-by: Tom Cooksey <tom.cooksey@arm.com> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> (v5) Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/20170413031746.12921-2-eric@anholt.net