summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/sun4i
AgeCommit message (Collapse)Author
2016-08-12drm/fb-helper: Add a dummy remove_conflicting_framebuffersDaniel Vetter
Lots of drivers don't properly compile without this when CONFIG_FB=n. It's kinda a hack, but since CONFIG_FB doesn't stub any fucntions when it's disabled I think it makes sense to add it to drm_fb_helper.h. Long term we probably need to rethink all the logic to unload firmware framebuffer drivers, at least if we want to be able to move away from CONFIG_FB and fbcon. v2: Unfortunately just stubbing out remove_conflicting_framebuffers in drm_fb_helper.h upset gcc about static vs. non-static declarations, so a new wrapper it needs to be. Means more churn :( Cc: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Cc: Noralf Trønnes <noralf@tronnes.org> Cc: tomi.valkeinen@ti.com Cc: dh.herrmann@gmail.com Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1470847958-28465-2-git-send-email-daniel.vetter@ffwll.ch
2016-07-27Merge tag 'topic/drm-misc-2016-07-22' of ↵Dave Airlie
git://anongit.freedesktop.org/drm-intel into drm-next Suddenly everyone shows up with their trivial patch series! - piles of if (!ptr) check removals from Markus Elfring - more of_node_put fixes from Peter Chen - make fbdev support really optional in all drivers (except vmwgfx), somehow this fell through the cracks when we did all the hard prep work a while ago. Patches from Tobias Jakobi. - leftover patches for the connector reg/unreg cleanup (required that I backmerged drm-next) from Chris - last vgem fence patch from Chris - fix up warnings in the new sphinx gpu docs build - misc other small bits * tag 'topic/drm-misc-2016-07-22' of git://anongit.freedesktop.org/drm-intel: (57 commits) GPU-DRM-Exynos: Delete an unnecessary check before the function call "vunmap" GPU-DRM-sun4i: Delete an unnecessary check before drm_fbdev_cma_hotplug_event() drm/atomic: Delete an unnecessary check before drm_property_unreference_blob() drm/rockchip: analogix_dp: add missing clk_disable_unprepare() on error drm: drm_connector->s/connector_id/index/ for consistency drm/virtio: Fix non static symbol warning drm/arc: Remove redundant dev_err call in arcpgu_load() drm/arc: Fix some sparse warnings drm/vgem: Fix non static symbol warning drm/doc: Spinx leftovers drm/dp-mst: Missing kernel doc drm/dp-mst: Remove tx_down_in_progress drm/doc: Fix missing kerneldoc for drm_dp_helper.c drm: Extract&Document drm_irq.h drm/doc: document all the properties in drm_mode_config drm/drm-kms.rst: Remove unused drm_fourcc.h include directive drm/doc: Add kerneldoc for @index drm: Unexport drm_connector_unregister_all() drm/sun4i: Remove redundant call to drm_connector_unregister_all() drm/ttm: Delete an unnecessary check before the function call "ttm_tt_destroy" ...
2016-07-26Backmerge tag 'v4.7' into drm-nextDave Airlie
Linux 4.7 As requested by Daniel Vetter as the conflicts were getting messy.
2016-07-20GPU-DRM-sun4i: Delete an unnecessary check before drm_fbdev_cma_hotplug_event()Markus Elfring
The drm_fbdev_cma_hotplug_event() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/cd959d92-f7d9-598c-421f-d3f40bedee10@users.sourceforge.net
2016-07-19drm/sun4i: Remove redundant call to drm_connector_unregister_all()Chris Wilson
drm_connector_unregister_all() is automatically called by drm_dev_unregister() and so the manual call can be dropped. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Maxime Ripard <maxime.ripard@free-electrons.com> Cc: David Airlie <airlied@linux.ie> Cc: Chen-Yu Tsai <wens@csie.org> Cc: dri-devel@lists.freedesktop.org Cc: linux-arm-kernel@lists.infradead.org Reviewed-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1468427947-28037-1-git-send-email-chris@chris-wilson.co.uk
2016-07-05gpu: drm: sun4i_drv: add missing of_node_put after calling of_parse_phandlePeter Chen
of_node_put needs to be called when the device node which is got from of_parse_phandle has finished using. Cc: Maxime Ripard <maxime.ripard@free-electrons.com> Cc: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2016-07-02Back-merge tag 'v4.7-rc5' into drm-nextDave Airlie
Linux 4.7-rc5 The fsl-dcu pull needs -rc3 so go to -rc5 for now.
2016-06-30drm/sun4i: Send vblank event when the CRTC is disabledMaxime Ripard
So far, we were missing to send the vblank event when disabling the CRTC, making us never report the last vblank event. This was causing a time out on the page flip, which should be solved now. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2016-06-30drm/sun4i: Report proper vblankMaxime Ripard
The sun4i display engine doesn't have any vblank counter. Use the proper helper for that. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2016-06-22drm/sun4i: Remove open-coded drm_connector_register_all()Chris Wilson
drm_dev_register() will now register all known connectors, so we no longer have to do so manually. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Maxime Ripard <maxime.ripard@free-electrons.com> Cc: David Airlie <airlied@linux.ie> Cc: Chen-Yu Tsai <wens@csie.org> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: dri-devel@lists.freedesktop.org Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1466501283-19976-4-git-send-email-chris@chris-wilson.co.uk
2016-06-21drm: Don't call drm_dev_set_unique from platform driversDaniel Vetter
Since commit e112e593b215c394c0303dbf0534db0928e87967 Author: Nicolas Iooss <nicolas.iooss_linux@m4x.org> Date: Fri Dec 11 11:20:28 2015 +0100 drm: use dev_name as default unique name in drm_dev_alloc() we're using a reasonable default which should work for everyone. Only mtk, rcar-du and sun4i are affected, and as kms-only drivers without any rendering support no one should ever care about the unique name v2: Rebase on top of mediatek. Cc: Philipp Zabel <p.zabel@pengutronix.de> Cc: Maxime Ripard <maxime.ripard@free-electrons.com> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> Acked-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1466499262-18717-5-git-send-email-daniel.vetter@ffwll.ch
2016-06-10drm: sun4i: Rely on the default ->best_encoder() behaviorBoris Brezillon
All outputs have a 1:1 relationship between connectors and encoders and the driver is relying on the atomic helpers: we can drop the custom ->best_encoder() implementations and let the core call drm_atomic_helper_best_encoder() for us. Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1465300095-16971-13-git-send-email-boris.brezillon@free-electrons.com
2016-06-10drm/sun4i: Implement some semblance of vblank event handlingDaniel Vetter
atomic_flush seems to be the right place, right after we commit the plane updates. Again use the fullproof version, since the pipe might be off. Cc: Boris Brezillon <boris.brezillon@free-electrons.com> Cc: Maxime Ripard <maxime.ripard@free-electrons.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1465388359-8070-6-git-send-email-daniel.vetter@ffwll.ch
2016-06-01drm/sun4i: Use lockless gem BO free callbackDaniel Vetter
No dev->struct_mutex anywhere to be seen. Cc: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1464630800-30786-24-git-send-email-daniel.vetter@ffwll.ch
2016-05-30drm: sun4i: do cleanup if RGB output init failsChen-Yu Tsai
sun4i_rgb_init() can fail, which results in TCON failing to bind. In this case we need to do cleanup, specificly unregistering the dotclock, which is regmap based, and the regmap is registered as part of the sun4i_tcon_bind(). Failing to do so results in a NULL pointer reference when the CCF tries to turn off unused clocks. Fixes: 29e57fab97fc ("drm: sun4i: Add RGB output") Signed-off-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2016-05-30drm/sun4i: Convert to connector register helpersMaxime Ripard
Now that connector register helpers have been created, switch to them. Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2016-05-30drm/sun4i: remove simplefb at probeMaxime Ripard
If simplefb was setup by our bootloader and enabled in the DT, we will have a first framebuffer loaded in our system. However, as soon as our DRM driver will load, it will reset the controller, initialise it and, if the framebuffer emulation is enabled, register a second framebuffer device. This is obviously pretty bad, since the first framebuffer will be some kind of a black hole, with memory still reserved that we can write to safely, but not displayed anywhere. Make sure we remove that framebuffer when we probe so we don't end up in that situation. Fixes: 9026e0d122ac ("drm: Add Allwinner A10 Display Engine support") Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2016-05-30drm/sun4i: rgb: panel is an error pointerMaxime Ripard
In case of an error, our pointer to the drm_panel structure attached to our encoder will hold an error pointer, not a NULL pointer. Make sure we check the right thing. Fixes: 29e57fab97fc ("drm: sun4i: Add RGB output") Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2016-05-30drm/sun4i: defer only if we didn't find our panelMaxime Ripard
Our code currently defers our probe on any error, even if we were not expecting to have one at all. Make sure we return -EPROBE_DEFER only when we were supposed to have a panel, but it's not probed yet. Also fix a typo while we're at it. Fixes: 29e57fab97fc ("drm: sun4i: Add RGB output") Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2016-05-30drm/sun4i: rgb: Validate the clock rateMaxime Ripard
Our pixel clock cannot reach a high enough rate for some rather high while common resolutions (like 1080p60). Make sure we filter the resolutions we cannot reach in our mode_valid function. Fixes: 29e57fab97fc ("drm: sun4i: Add RGB output") Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2016-05-30drm/sun4i: request exact rates to our parentsMaxime Ripard
Our pixel clock currently only tries to deal with the current parent rate. While that works when the resolution is the same than the one already program, or when we can compute directly the rate from the current parent rate, it cannot work in most situation when we want to change the frequency, and we end up with an improper pixel clock rate, which obviously doesn't work as expected. Ask our parent for all the possible dividers if it can reach that frequency, and return the best parent rate to the clock framework so that we can use it. Fixes: 9026e0d122ac ("drm: Add Allwinner A10 Display Engine support") Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2016-05-30drm: sun4i: fix probe error handlingArnd Bergmann
gcc points out a possible uninitialized variable use in sun4i_dclk_create(): drivers/gpu/drm/sun4i/sun4i_dotclock.c: In function 'sun4i_dclk_create': drivers/gpu/drm/sun4i/sun4i_dotclock.c:139:12: error: 'clk_name' may be used uninitialized in this function [-Werror=maybe-uninitialized] init.name = clk_name; The warning only shows up when CONFIG_OF is disabled, and the property is never filled, but the same bug can show up even when CONFIG_OF is enabled but of_property_read_string_index returns another error. To fix it, this ensures that sun4i_dclk_create propagates any error from of_property_read_string_index. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Fixes: 9026e0d122ac ("drm: Add Allwinner A10 Display Engine support") Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2016-05-30drm: sun4i: print DMA address correctlyArnd Bergmann
The newly added sun4i drm driver prints a dma address using the %x format string, which cannot work when dma_addr_t is 64 bit, and gcc warns about this configuration: drm/sun4i/sun4i_backend.c: In function 'sun4i_backend_update_layer_buffer': drm/sun4i/sun4i_backend.c:193:84: error: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'dma_addr_t {aka long long unsigned int}' [-Werror=format=] DRM_DEBUG_DRIVER("Using GEM @ 0x%x\n", gem->paddr); drm/sun4i/sun4i_backend.c:201:84: error: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'dma_addr_t {aka long long unsigned int}' [-Werror=format=] DRM_DEBUG_DRIVER("Setting buffer address to 0x%x\n", paddr); This changes the code to use the explicit %pad format string, which always prints the right length. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2016-05-30drm/sun4i: add COMMON_CLK dependencyArnd Bergmann
The sun4i drm driver uses the clk-provider interfaces, which are not available when CONFIG_COMMON_CLK is disabled: drivers/gpu/drm/sun4i/sun4i_dotclock.c:19:16: error: field 'hw' has incomplete type struct clk_hw hw; In file included from ../include/asm-generic/bug.h:13:0, from ../arch/arm/include/asm/bug.h:59, from ../include/linux/bug.h:4, from ../include/linux/io.h:23, from ../include/linux/clk-provider.h:14, from ../drivers/gpu/drm/sun4i/sun4i_dotclock.c:13: drivers/gpu/drm/sun4i/sun4i_dotclock.c: In function 'hw_to_dclk': include/linux/kernel.h:831:48: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types] ... This adds a Kconfig dependency to prevent the driver from being enabled in this case. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Fixes: 9026e0d122ac ("drm: Add Allwinner A10 Display Engine support") Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2016-04-28drm: sun4i: tv: Add NTSC output standardMaxime Ripard
Add the settings to support the NTSC standard. Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2016-04-28drm: sun4i: tv: Add PAL output standardMaxime Ripard
Now that we have support for the composite output, we can start adding new supported standards. Start with PAL, and we will add other eventually. Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2016-04-28drm: sun4i: Add composite outputMaxime Ripard
Some Allwinner SoCs have an IP called the TV encoder that is used to output composite and VGA signals. In such a case, we need to use the second TCON channel. Add support for that TV encoder. Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2016-04-28drm: sun4i: Add RGB outputMaxime Ripard
One of the A10 display pipeline possible output is an RGB interface to drive LCD panels directly. This is done through the first channel of the TCON that will output our video signals directly. Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2016-04-28drm: Add Allwinner A10 Display Engine supportMaxime Ripard
The Allwinner A10 and subsequent SoCs share the same display pipeline, with variations in the number of controllers (1 or 2), or the presence or not of some output (HDMI, TV, VGA) or not. Add a driver with a limited set of features for now, and we will hopefully support all of them eventually Reviewed-by: Boris Brezillon <boris.brezillon@free-electrons.com> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>