summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
Commit message (Collapse)AuthorAgeFilesLines
* drm/atomic: Include color encoding/range in plane state dumpVille Syrjälä2018-03-023-0/+36
| | | | | | | | | | | | | | | | | | | | Include color_enconding and color_range in the plane state dump. v2: Add kerneldoc (danvet) Cc: Harry Wentland <harry.wentland@amd.com> Cc: Daniel Vetter <daniel@ffwll.ch> Cc: Daniel Stone <daniel@fooishbar.org> Cc: Russell King - ARM Linux <linux@armlinux.org.uk> Cc: Ilia Mirkin <imirkin@alum.mit.edu> Cc: Hans Verkuil <hverkuil@xs4all.nl> Cc: Uma Shankar <uma.shankar@intel.com> Cc: Shashank Sharma <shashank.sharma@intel.com> Cc: Jyri Sarha <jsarha@ti.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20180219202846.10628-1-ville.syrjala@linux.intel.com Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Acked-by: Harry Wentland <harry.wentland@amd.com>
* drm: Add optional COLOR_ENCODING and COLOR_RANGE properties to drm_planeJyri Sarha2018-03-022-0/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add a standard optional properties to support different non RGB color encodings in DRM planes. COLOR_ENCODING select the supported non RGB color encoding, for instance ITU-R BT.709 YCbCr. COLOR_RANGE selects the value ranges within the selected color encoding. The properties are stored to drm_plane object to allow different set of supported encoding for different planes on the device. v2: Add/fix kerneldocs, verify bitmasks (danvet) Cc: Harry Wentland <harry.wentland@amd.com> Cc: Daniel Vetter <daniel@ffwll.ch> Cc: Daniel Stone <daniel@fooishbar.org> Cc: Russell King - ARM Linux <linux@armlinux.org.uk> Cc: Ilia Mirkin <imirkin@alum.mit.edu> Cc: Hans Verkuil <hverkuil@xs4all.nl> Cc: Uma Shankar <uma.shankar@intel.com> Cc: Shashank Sharma <shashank.sharma@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Jyri Sarha <jsarha@ti.com> [vsyrjala v2: Add/fix kerneldocs, verify bitmasks] Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20180219202823.10508-1-ville.syrjala@linux.intel.com Acked-by: Harry Wentland <harry.wentland@amd.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
* drm/sun4i: Allow building on arm64Jernej Skrabec2018-03-021-1/+1
| | | | | | | | | | 64-bit ARM SoCs from Allwinner have DE2/TCON/HDMI periphery which is compatible to 32-bit SoCs, so allow building DRM driver for arm64 architecture. Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com> Link: https://patchwork.freedesktop.org/patch/msgid/20180301213442.16677-14-jernej.skrabec@siol.net
* drm/sun4i: Add support for H3 HDMI PHY variantJernej Skrabec2018-03-024-3/+400
| | | | | | | | | | | | | | | | | | | | While A83T HDMI PHY seems to be just customized Synopsys HDMI PHY, H3 HDMI PHY is completely custom PHY. However, they still have many things in common like clock and reset setup, setting sync polarity and more. Add support for H3 HDMI PHY variant. While documentation exists for this PHY variant, it doesn't go in great details. Because of that, almost all settings are copied from BSP linux 4.4. Interestingly, those settings are slightly different to those found in a older BSP with Linux 3.4. For now, no user visible difference was found between them. Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com> Link: https://patchwork.freedesktop.org/patch/msgid/20180301213442.16677-13-jernej.skrabec@siol.net
* drm/sun4i: Move and expand DW HDMI PHY register macrosJernej Skrabec2018-03-022-17/+131
| | | | | | | | | DW HDMI PHY macros are moved to header file and expanded with the registers present on newer SoCs like H3 and H5. Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com> Link: https://patchwork.freedesktop.org/patch/msgid/20180301213442.16677-12-jernej.skrabec@siol.net
* drm/sun4i: Add support for variants to DW HDMI PHYJernej Skrabec2018-03-022-33/+76
| | | | | | | | | | | | | There are multiple variants of DW HDMI PHYs in Allwinner SoCs. While some things like clock and reset setup are the same, PHY configuration differs a lot. Split out code which is PHY specific to separate functions and create a structure which holds pointers to those functions. Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com> Link: https://patchwork.freedesktop.org/patch/msgid/20180301213442.16677-11-jernej.skrabec@siol.net
* drm/sun4i: Fix polarity configuration for DW HDMI PHYJernej Skrabec2018-03-021-7/+8
| | | | | | | | | | | | | | | | | Current polarity configuration code is cleary wrong since it compares same flag two times. However, even if flag name is fixed, it won't work well for resolutions which have one polarity positive and another negative. Fix that by properly set each bit according to each polarity. Since those two bits are not described in any documentation, relationships were obtained by experimentation. Fixes: b7c7436a5ff0 ("drm/sun4i: Implement A83T HDMI driver") Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com> Link: https://patchwork.freedesktop.org/patch/msgid/20180301213442.16677-10-jernej.skrabec@siol.net
* drm/sun4i: Add support for H3 mixer 0Jernej Skrabec2018-03-021-0/+12
| | | | | | | | This mixer supports 1 VI plane, 3 UI plane and HW scaling on all planes. Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com> Link: https://patchwork.freedesktop.org/patch/msgid/20180301213442.16677-9-jernej.skrabec@siol.net
* drm/sun4i: Add support for H3 display engineJernej Skrabec2018-03-021-0/+1
| | | | | | | | | H3 display engine has two mixers which are connected to HDMI and TV output. Signed-off-by: Jernej Skrabec <jernej.skrabec@siol.net> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com> Link: https://patchwork.freedesktop.org/patch/msgid/20180301213442.16677-8-jernej.skrabec@siol.net
* drm/rockchip: analogix_dp: reorder psr_unregister call in unbindJeffy Chen2018-03-011-1/+1
| | | | | | | | | | | | In bind the psr handler gets registered first before the core analogix_dp_bind() gets called. So it should be the other way around in unbind, first unbind the analogix_dp and then unregister the psr. Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com> Signed-off-by: Thierry Escande <thierry.escande@collabora.com> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patchwork.freedesktop.org/patch/msgid/76025075.yWNtk1v57f@phil
* drm/rockchip: analogix_dp: Add a sanity check for rockchip_drm_psr_register()Jeffy Chen2018-03-011-3/+10
| | | | | | | | | | The rockchip_drm_psr_register() can fail, so add a sanity check for that. Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com> Signed-off-by: Thierry Escande <thierry.escande@collabora.com> [moved psr_unregister reordering in unbind to separate patch] Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patchwork.freedesktop.org/patch/msgid/20180110162348.22765-4-thierry.escande@collabora.com
* drm/bridge: analogix_dp: Fix connector and encoder cleanupJeffy Chen2018-03-013-11/+10
| | | | | | | | | | | Since we are initing connector in the core driver and encoder in the plat driver, let's clean them up in the right places. Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com> Signed-off-by: Thierry Escande <thierry.escande@collabora.com> Reviewed-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patchwork.freedesktop.org/patch/msgid/20180110162348.22765-3-thierry.escande@collabora.com
* drm/bridge: analogix: Do not use device's drvdataJeffy Chen2018-03-013-61/+63
| | | | | | | | | | | | | | | | | | | | | | The driver that instantiates the bridge should own the drvdata, as all driver model callbacks (probe, remove, shutdown, PM ops, etc.) are also owned by its driver struct. Moreover, storing two different pointer types in driver data depending on driver initialization status is barely a good practice and in fact has led to many bugs in this driver. Let's clean up this mess and change Analogix entry points to simply accept some opaque struct pointer, adjusting their users at the same time to avoid breaking the compilation. Signed-off-by: Tomasz Figa <tfiga@chromium.org> Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com> Signed-off-by: Thierry Escande <thierry.escande@collabora.com> Reviewed-by: Andrzej Hajda <a.hajda@samsung.com> Reviewed-by: Sean Paul <seanpaul@chromium.org> Acked-by: Jingoo Han <jingoohan1@gmail.com> Acked-by: Archit Taneja <architt@codeaurora.org> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patchwork.freedesktop.org/patch/msgid/20180110162348.22765-2-thierry.escande@collabora.com
* drm/rockchip: vop: Init vskiplines in scl_vop_cal_scale()Jeffy Chen2018-03-011-1/+4
| | | | | | | | | | | | | Currently we are calling scl_vop_cal_scale() to get vskiplines for yrgb and cbcr. So the cbcr's vskiplines might be an unexpected value if the second scl_vop_cal_scale() didn't update it. Init vskiplines in scl_vop_cal_scale() to avoid that. Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com> Reviewed-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patchwork.freedesktop.org/patch/msgid/20180223062250.10470-1-jeffy.chen@rock-chips.com
* drm/rockchip: Add device links for master and componentsJeffy Chen2018-03-011-1/+22
| | | | | | | | | | | Since we are trying to access components' resources in the master's suspend/resume PM callbacks(e.g. panel), add device links to correct the suspend/resume and shutdown ordering. Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patchwork.freedesktop.org/patch/msgid/20180207175309.21095-1-enric.balletbo@collabora.com
* tinydrm: add backlight dependencyArnd Bergmann2018-02-281-0/+2
| | | | | | | | | | | | | | | | | Calling devm_of_find_backlight directly means we get a link failure without CONFIG_BACKLIGHT_CLASS_DEVICE: drivers/gpu/drm/tinydrm/mi0283qt.o: In function `mi0283qt_probe': mi0283qt.c:(.text+0x684): undefined reference to `devm_of_find_backlight' This adds an explicit Kconfig dependency for it. While I did not observe that failure for st7735r, I assume the same change is needed there for the same reason. Fixes: d1a2e7004b5e ("drm/tinydrm: Replace tinydrm_of_find_backlight with of_find_backlight") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Sean Paul <seanpaul@chromium.org> Link: https://patchwork.freedesktop.org/patch/msgid/20180228134111.2042877-1-arnd@arndb.de
* drm/virtio: Add spaces around operatorsRodrigo Siqueira2018-02-272-12/+12
| | | | | | | | | | | | | This patch fixes the checkpatch.pl check: virtgpu_ioctl.c:535: CHECK: spaces preferred around that '|' (ctx:VxV) virtgpu_vq.c:277: CHECK: spaces preferred around that '+' (ctx:VxV) ... Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com> Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org> Link: http://patchwork.freedesktop.org/patch/msgid/8402b55696b44483ba2e1f6aaeb53bf709ffbfe7.1519343668.git.rodrigosiqueiramelo@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* drm/virtio: Remove multiple blank linesRodrigo Siqueira2018-02-273-3/+0
| | | | | | | | | | | | | This patch fixes the checkpatch.pl check: virtgpu_drv.c:116: CHECK: Please don't use multiple blank lines virtgpu_vq.c:599: CHECK: Please don't use multiple blank lines virtgpu_prime.c:42: CHECK: Please don't use multiple blank lines Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com> Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org> Link: http://patchwork.freedesktop.org/patch/msgid/c43a006f2ed93a16fe824b4a2686a2d5e2ef56f5.1519343668.git.rodrigosiqueiramelo@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* drm/virtio: Replace 'unsigned' for 'unsigned int'Rodrigo Siqueira2018-02-274-5/+5
| | | | | | | | | | | | | This patch fixes the checkpatch.pl warning: drivers/gpu/drm/virtio/virtgpu_display.c:64: WARNING: Prefer 'unsigned int' to bare use of 'unsigned' ... Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com> Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org> Link: http://patchwork.freedesktop.org/patch/msgid/ac9c4110785e6519801d44c57d4f05c3e0cdad53.1519343668.git.rodrigosiqueiramelo@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* drm/virtio: Remove return from void functionRodrigo Siqueira2018-02-271-2/+0
| | | | | | | | | | | | | This patch fixes the checkpatch.pl warning: virtgpu_ttm.c:181: WARNING: void function return statements are not generally useful ... Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com> Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org> Link: http://patchwork.freedesktop.org/patch/msgid/fd8dc6599c81c7aec6753c8552c1cabb7baa7577.1519343668.git.rodrigosiqueiramelo@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* drm/virtio: Add */ in block comments to separate lineRodrigo Siqueira2018-02-273-3/+6
| | | | | | | | | | | | | This patch fixes the checkpatch.pl warning: virtgpu_ioctl.c:551: WARNING: Block comments use a trailing */ on a separate line ... Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com> Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org> Link: http://patchwork.freedesktop.org/patch/msgid/f0bd4104a7d26bf7561c3a2b4632041c5411f1f2.1519343668.git.rodrigosiqueiramelo@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* drm/virtio: Add blank line after variable declarationsRodrigo Siqueira2018-02-276-0/+12
| | | | | | | | | | | | | This patch fixes the checkpatch.pl warnings: virtgpu_drv.c:57: WARNING: Missing a blank line after declarations virtgpu_display.c:99: WARNING: Missing a blank line after declarations ... Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com> Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org> Link: http://patchwork.freedesktop.org/patch/msgid/41767852ff9dc584c825e32db6222b9a311603b9.1519343668.git.rodrigosiqueiramelo@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* drm/virtio: Add tabs at the start of a lineRodrigo Siqueira2018-02-272-4/+4
| | | | | | | | | | | | | This patch fixes the checkpatch.pl errors: drivers/gpu/drm/virtio/virtgpu_drv.h:371: ERROR: code indent should use tabs where possible ... Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com> Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org> Link: http://patchwork.freedesktop.org/patch/msgid/1c77c233d4454ee2bdb85beaf17d413e310fac0a.1519343668.git.rodrigosiqueiramelo@gmail.com Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
* drm: Include the header with the prototype for drm_get_panel_orientation_quirk()Ville Syrjälä2018-02-261-0/+1
| | | | | | | | | | | sparse complains: drivers/gpu/drm/drm_panel_orientation_quirks.c:133:5: warning: symbol 'drm_get_panel_orientation_quirk' was not declared. Should it be static? Cc: Hans de Goede <hdegoede@redhat.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20180226142423.26439-1-ville.syrjala@linux.intel.com Reviewed-by: Hans de Goede <hdegoede@redhat.com>
* drm/i915: Remove the pipe/plane ID checks from skl_check_ccs_aux_surface()Ville Syrjälä2018-02-261-8/+0
| | | | | | | | | | | | | | The core now checks that the plane supports the fb's format+modifier combination, so we can drop the related checks from skl_check_ccs_aux_surface(). These checks were specific to SKL/KBL/BXT anyway. Cc: Ben Widawsky <ben@bwidawsk.net> Cc: Jason Ekstrand <jason@jlekstrand.net> Cc: Daniel Stone <daniels@collabora.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20171222192231.17981-9-ville.syrjala@linux.intel.com Reviewed-by: Mika Kahola <mika.kahola@intel.com>
* drm: Check that the plane supports the request format+modifier comboVille Syrjälä2018-02-264-17/+40
| | | | | | | | | | | | | | | Currently we only check that the plane supports the pixel format of the fb we're about to feed to it. Extend it to check also the modifier, and more specifically that the combination of the format and modifier is supported. Cc: dri-devel@lists.freedesktop.org Cc: Ben Widawsky <ben@bwidawsk.net> Cc: Jason Ekstrand <jason@jlekstrand.net> Cc: Daniel Stone <daniels@collabora.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20171222192231.17981-8-ville.syrjala@linux.intel.com Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
* drm/pl111: Remove reverse dependency on DRM_DUMB_VGA_DACThierry Reding2018-02-261-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DRM_DUMB_VGA_DAC is a user-visible symbol. Selecting it can cause unmet direct dependencies such as this (on i386, randconfig): warning: (DRM_PL111) selects DRM_DUMB_VGA_DAC which has unmet direct dependencies (HAS_IOMEM && DRM && DRM_BRIDGE && OF) This is because DRM_DUMB_VGA_DAC depends on OF while DRM_PL111 does not. It does indirectly depend on OF via the ARM and ARM64 dependencies, but since it can also be enabled under COMPILE_TEST, randconfig can find a case where DRM_PL111 is selected without pulling in OF and not meeting the dependency for DRM_DUMB_VGA_DAC. Since select is "heavy handed", DRM_DUMB_VGA_DAC is going to be enabled regardless of the above warning and causes the following build error: ../drivers/gpu/drm/bridge/dumb-vga-dac.c: In function 'dumb_vga_probe': ../drivers/gpu/drm/bridge/dumb-vga-dac.c:207:13: error: 'struct drm_bridge' has no member named 'of_node' vga->bridge.of_node = pdev->dev.of_node; See Documentation/kbuild/kconfig-language.txt, "reverse dependencies". Fixes: 49f81d80ab84 ("drm/pl111: Support handling bridge timings") Reported-by: Randy Dunlap <rdunlap@infradead.org> Reviewed-by: Eric Anholt <eric@anholt.net> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Archit Taneja <architt@codeaurora.org> Cc: Eric Anholt <eric@anholt.net> Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Archit Taneja <archit@cradlewise.com> Link: https://patchwork.freedesktop.org/patch/msgid/20180220102903.27787-1-thierry.reding@gmail.com
* drm/stm: check pitch and size calculations even if !CONFIG_MMUBenjamin Gaignard2018-02-231-2/+0
| | | | | | | | | | | | In all cases we have to check pitch and size calculations to speed up data transfer. Fixes: 21f815bf773c ("drm/stm: drv: Improve data transfers") Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org> Tested-by: Philippe Cornu <philippe.cornu@st.com> Reviewed-by: Philippe Cornu <philippe.cornu@st.com> Link: https://patchwork.freedesktop.org/patch/msgid/20180131080508.14356-1-benjamin.gaignard@linaro.org
* drm/panel: Fix ARM Versatile panel clocksLinus Walleij2018-02-231-4/+4
| | | | | | | | | | These clocks are in kHz not in Hz, oops. Fix it so my new bandwidth calculations patch starts working with these panels. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/20180211103840.18764-1-linus.walleij@linaro.org
* drm/pl111: Do not use deprecated drm_driver.{enable|disable)_vblankOleksandr Andrushchenko2018-02-223-10/+12
| | | | | | | | | | | | Do not use deprecated drm_driver.{enable|disable)_vblank callbacks, but use drm_simple_kms_helpe's pipe callbacks instead. Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com> Cc: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net> Tested-by: Eric Anholt <eric@anholt.net> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/1518425574-32671-5-git-send-email-andr2000@gmail.com
* drm/tve200: Do not use deprecated drm_driver.{enable|disable)_vblankOleksandr Andrushchenko2018-02-223-7/+8
| | | | | | | | | | | Do not use deprecated drm_driver.{enable|disable)_vblank callbacks, but use drm_simple_kms_helpe's pipe callbacks instead. Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com> Cc: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/1518425574-32671-4-git-send-email-andr2000@gmail.com
* drm/mxsfb: Do not use deprecated drm_driver.{enable|disable)_vblankOleksandr Andrushchenko2018-02-221-26/+28
| | | | | | | | | | | Do not use deprecated drm_driver.{enable|disable)_vblank callbacks, but use drm_simple_kms_helpe's pipe callbacks instead. Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com> Cc: Marek Vasut <marex@denx.de> Reviewed-by: Marek Vasut <marex@denx.de> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/1518425574-32671-3-git-send-email-andr2000@gmail.com
* drm/simple_kms_helper: Add {enable|disable}_vblank callback supportOleksandr Andrushchenko2018-02-221-0/+24
| | | | | | | | | | | | | | | If simple_kms_helper based driver needs to work with vblanks, then it has to provide drm_driver.{enable|disable}_vblank callbacks, because drm_simple_kms_helper.drm_crtc_funcs does not provide any. At the same time drm_driver.{enable|disable}_vblank callbacks are marked as deprecated and shouldn't be used by new drivers. Fix this by extending drm_simple_kms_helper.drm_crtc_funcs to provide the missing callbacks. Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/1518425574-32671-2-git-send-email-andr2000@gmail.com
* drm: fix drm_get_max_iomem type mismatchArnd Bergmann2018-02-221-1/+1
| | | | | | | | | | | | | | | | When comparing two variables with min()/max(), they should be the same type: drivers/gpu/drm/drm_memory.c: In function 'drm_get_max_iomem': include/linux/kernel.h:821:16: error: comparison of distinct pointer types lacks a cast [-Werror] (void) (&max1 == &max2); This makes the local variable in drm_get_max_iomem make the type from resource->end. Fixes: 82626363a217 ("drm: add func to get max iomem address v2") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Sean Paul <seanpaul@chromium.org> Link: https://patchwork.freedesktop.org/patch/msgid/20180222114804.1394300-1-arnd@arndb.de
* drm/simple_kms_helper: Fix NULL pointer dereference with no active CRTCOleksandr Andrushchenko2018-02-221-7/+3
| | | | | | | | | | | | | It is possible that drm_simple_kms_plane_atomic_check called with no CRTC set, e.g. when user-space application sets CRTC_ID/FB_ID to 0 before doing any actual drawing. This leads to NULL pointer dereference because in this case new CRTC state is NULL and must be checked before accessing. Signed-off-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/1519279759-7803-1-git-send-email-andr2000@gmail.com
* drm/sun4i: backend: Remove ARGB spoofingMaxime Ripard2018-02-221-9/+3
| | | | | | | | | | We've had some code for quite some time to prevent the alpha bug from happening on the lowest primary plane. Since we now check for this in our atomic_check, we can simply remove it. Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com> Link: https://patchwork.freedesktop.org/patch/msgid/965180afd8169ccaa848f061d16a2c1a9ec4d289.1518802627.git-series.maxime.ripard@bootlin.com
* drm/sun4i: backend: Make zpos configurableMaxime Ripard2018-02-221-2/+3
| | | | | | | | | Now that we have everything in place, we can make zpos configurable now. Change the zpos property from an immutable one to a regular. Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com> Link: https://patchwork.freedesktop.org/patch/msgid/0ab187956855db86972d936e6751181649e0d035.1518802627.git-series.maxime.ripard@bootlin.com
* drm/sun4i: Remove the plane description structureMaxime Ripard2018-02-221-36/+8
| | | | | | | | | | | The plane description structure was mostly needed to differentiate the formats usable on the primary plane (because of its lowest position), and assign the pipes. Now that both are dynamically checked and assigned, we can remove the static definition. Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com> Link: https://patchwork.freedesktop.org/patch/msgid/6b09e3698e692c3338f70a5ae1e5a580f9dd08ee.1518802627.git-series.maxime.ripard@bootlin.com
* drm/sun4i: backend: Assign the pipes automaticallyMaxime Ripard2018-02-223-8/+39
| | | | | | | | | | | | | | | | | | | | Since we now have a way to enforce the zpos, check for the number of alpha planes, the only missing part is to assign our pipe automatically instead of hardcoding it. The algorithm is quite simple, but requires two iterations over the list of planes. In the first one (which is the same one that we've had to check for alpha, the frontend usage, and so on), we order the planes by their zpos. We can then do a second iteration over that array by ascending zpos starting with the pipe 0. When and if we encounter our alpha plane, we put it and all the other subsequent planes in the second pipe. Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com> Link: https://patchwork.freedesktop.org/patch/msgid/e9caf21d831438d36a3ccc7cef229c9a7ea7f69f.1518802627.git-series.maxime.ripard@bootlin.com
* drm/mm: Fix caching of leftmost node in the interval treeChris Wilson2018-02-201-4/+5
| | | | | | | | | | | | | | When we descend the tree to find our slot, if we step to the right, we are no longer the leftmost node. Fixes: f808c13fd373 ("lib/interval_tree: fast overlap detection") Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Davidlohr Bueso <dbueso@suse.de> Cc: Jérôme Glisse <jglisse@redhat.com> Cc: Christian König <christian.koenig@amd.com> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Acked-by: Christian König <christian.koenig@amd.com> for now. Link: https://patchwork.freedesktop.org/patch/msgid/20180220093738.1461-1-chris@chris-wilson.co.uk
* drm/omapdrm: Use of_find_backlight helperMeghana Madhyastha2018-02-201-20/+5
| | | | | | | | | | Replace of_find_backlight_by_node and of the code around it with of_find_backlight helper to avoid repetition of code. Reviewed-by: Noralf Trønnes <noralf@tronnes.org> Signed-off-by: Meghana Madhyastha <meghana.madhyastha@gmail.com> Signed-off-by: Sean Paul <seanpaul@chromium.org> Link: https://patchwork.freedesktop.org/patch/msgid/eb914313f9d0e58d81572ccd3c718a573a891bd7.1516810726.git.meghana.madhyastha@gmail.com
* drm/panel: Use of_find_backlight helperMeghana Madhyastha2018-02-203-66/+13
| | | | | | | | | | | | Replace of_find_backlight_by_node and of the code around it with of_find_backlight helper to avoid repetition of code. Reviewed-by: Noralf Trønnes <noralf@tronnes.org> Reviewed-by: Sean Paul <seanpaul@chromium.org> Acked-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Meghana Madhyastha <meghana.madhyastha@gmail.com> Signed-off-by: Sean Paul <seanpaul@chromium.org> Link: https://patchwork.freedesktop.org/patch/msgid/140d01afb138d687680b2d1776a4c101c9fa9a0a.1516810725.git.meghana.madhyastha@gmail.com
* drm/omapdrm: Use backlight_enable/disable helpersMeghana Madhyastha2018-02-201-9/+2
| | | | | | | | | | | | Use backlight_enable/disable helpers instead of changing the property and calling backlight_update_status for cleaner and simpler code and also to avoid repetitions. Reviewed-by: Noralf Trønnes <noralf@tronnes.org> Reviewed-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Meghana Madhyastha <meghana.madhyastha@gmail.com> Signed-off-by: Sean Paul <seanpaul@chromium.org> Link: https://patchwork.freedesktop.org/patch/msgid/30d5b26c3c7d75de3d2ab3cff9dee67084fc3caf.1516810725.git.meghana.madhyastha@gmail.com
* drm/panel: Use backlight_enable/disable helpersMeghana Madhyastha2018-02-204-24/+8
| | | | | | | | | | | | | Use backlight_enable/disable helpers instead of changing the property and calling backlight_update_status for cleaner and simpler code and also to avoid repetitions. Reviewed-by: Noralf Trønnes <noralf@tronnes.org> Reviewed-by: Sean Paul <seanpaul@chromium.org> Acked-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Meghana Madhyastha <meghana.madhyastha@gmail.com> Signed-off-by: Sean Paul <seanpaul@chromium.org> Link: https://patchwork.freedesktop.org/patch/msgid/bc80cdb5cf1a6638dce9fb9f8da674e361e3b749.1516810725.git.meghana.madhyastha@gmail.com
* drm/tinydrm: Call devres version of of_find_backlightMeghana Madhyastha2018-02-202-2/+2
| | | | | | | | | | | Call devm_of_find_backlight (the devres version) instead of of_find_backlight. Reviewed-by: Noralf Trønnes <noralf@tronnes.org> Reviewed-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Meghana Madhyastha <meghana.madhyastha@gmail.com> Signed-off-by: Sean Paul <seanpaul@chromium.org> Link: https://patchwork.freedesktop.org/patch/msgid/244cd4d567cb3944a8cb7633715ffc8ac4e1ce83.1516810725.git.meghana.madhyastha@gmail.com
* drm/tinydrm: Replace tinydrm_of_find_backlight with of_find_backlightMeghana Madhyastha2018-02-204-44/+4
| | | | | | | | | | | | | | Remove tinydrm_of_find_backlight from tinydrm-helpers.c. We now have a generic of_find_backlight defined in backlight.c. Let the callers of tinydrm_of_find_backlight call of_find_backlight. Also, remove select BACKLIGHT_LCD_SUPPORT and select BACKLIGHT_CLASS_DEVICE from tinydrm/Kconfig as it is a hack that is no longer needed. Reviewed-by: Noralf Trønnes <noralf@tronnes.org> Reviewed-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Meghana Madhyastha <meghana.madhyastha@gmail.com> Signed-off-by: Sean Paul <seanpaul@chromium.org> Link: https://patchwork.freedesktop.org/patch/msgid/11dd1cabd098a730d07ab04c5987b139d14d8b21.1516810725.git.meghana.madhyastha@gmail.com
* drm/tinydrm: Convert tinydrm_enable/disable_backlight to ↵Meghana Madhyastha2018-02-202-57/+2
| | | | | | | | | | | | | backlight_enable/disable Remove tinydrm_enable/disable_backlight and let the callers call the more generic backlight_enable/disable helpers Reviewed-by: Noralf Trønnes <noralf@tronnes.org> Reviewed-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Meghana Madhyastha <meghana.madhyastha@gmail.com> Signed-off-by: Sean Paul <seanpaul@chromium.org> Link: https://patchwork.freedesktop.org/patch/msgid/ec700724e47814e6426966e093bd32b2364ba147.1516810725.git.meghana.madhyastha@gmail.com
* drm/doc: Polish for drm_mode_parse_command_line_for_connectorDaniel Vetter2018-02-201-2/+2
| | | | | | | | | | | Quoting the module option format looks soo much nicer, and avoids sphinx spewing errors about markup issues. v2: Fix typo in commit message (Thierry). Reviewed-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20180219225356.24996-4-daniel.vetter@ffwll.ch
* drm/docs: Document "scaling mode" property betterDaniel Vetter2018-02-201-4/+28
| | | | | | | | | | | | | | | | | Move it out of the csv dungeon. While at it add the missing link to the helper functions for setting up the "panel rotation" property. Also OCD how we list enum property values and their corresponding docs. Going for a nest definition list seams cleanest, no need for also making it an uordered list. Cc: Sean Paul <seanpaul@chromium.org> Cc: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20180219225356.24996-3-daniel.vetter@ffwll.ch
* drm/docs: Align layout of optional plane blending propertiesDaniel Vetter2018-02-201-8/+10
| | | | | | | | | | Just a bit of drive-by OCD. All the other property docs use enumerations, for some nice visual consistency. It also neatly highlights the property name. Reviewed-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20180219225356.24996-2-daniel.vetter@ffwll.ch