summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/rcar-du/rcar_du_encoder.c
Commit message (Collapse)AuthorAgeFilesLines
* drm: rcar-du: Fix DSI enable & disable sequenceTomi Valkeinen2022-09-071-0/+4
| | | | | | | | | | | | | | | | | | | | | | The rcar crtc depends on the clock provided from the rcar DSI bridge. When the DSI bridge is disabled, the clock is stopped, which causes the crtc disable to timeout. Also, while I have no issue with the enable, the documentation suggests to enable the DSI before the crtc so that the crtc has its clock enabled at enable time. This is also not done by the current driver. To fix this, we need to keep the DSI bridge enabled until the crtc has disabled itself, and enable the DSI bridge before crtc enables itself. Add functions rcar_mipi_dsi_pclk_enable and rcar_mipi_dsi_pclk_disable to the rcar DSI bridge driver which the rcar driver can use to enable/disable the DSI clock when needed. This is similar to what is already done with the rcar LVDS bridge. Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
* drm: rcar-du: Drop unused encoder header filesBiju Das2022-09-071-5/+0
| | | | | | | | Drop unused header files from rcar_du_encoder.c Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
* Merge tag 'du-next-20220707' of git://linuxtv.org/pinchartl/media into drm-nextDave Airlie2022-07-221-1/+1
|\ | | | | | | | | | | | | | | | | Miscellaneous R-Car DU fixes and enhancements Signed-off-by: Dave Airlie <airlied@redhat.com> From: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Link: https://patchwork.freedesktop.org/patch/msgid/YtIEWkE0nk/8nhUc@pendragon.ideasonboard.com
| * drm: rcar-du: Drop file name from comment header blocksLaurent Pinchart2022-07-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The comment blocks at the beginning of each file have a one-line summary description of the file that includes the file name. While the description is useful, the file name only creates opportunities for mistakes (as seen in rcar_du_vsp.c) without any added value. Drop it. Reported-by: Biju Das <biju.das.jz@bp.renesas.com> Suggested-by: Geert Uytterhoeven <geert@linux-m68k.org> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
* | drm: Remove linux/fb.h from drm_crtc.hVille Syrjälä2022-07-051-0/+1
|/ | | | | | | | | | | | | | | | | drm_crtc.h has no need for linux/fb.h, so don't include it. Avoids useless rebuilds of the entire universe when touching linux/fb.h. Quite a few placs do currently depend on linux/fb.h or other headers pulled in by it without actually including any of it directly. All of those need to be fixed up. v2: Split the vmwgfx change out Acked-by: Sam Ravnborg <sam@ravnborg.org> Acked-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20220630195114.17407-3-ville.syrjala@linux.intel.com
* drm: rcar-du: Improve kernel log messages when initializing encodersLaurent Pinchart2021-10-071-5/+7
| | | | | | | | | | | Improve the debugging and error messages printing when initializing encoders by replacing the output number by the output name, printing the bridge OF node name, and the error code of failed operations. While at it, move the related rcar_du_output enumeration from rcar_du_crtc.h to rcar_du_drv.h as it's not specific to the CRTC. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
* drm: rcar-du: Don't create encoder for unconnected LVDS outputsLaurent Pinchart2021-10-071-4/+12
| | | | | | | | | | | | | | | | | | | On R-Car D3 and E3, the LVDS encoders provide the pixel clock to the DU, even when LVDS outputs are not used. For this reason, the rcar-lvds driver probes successfully on those platforms even if no further bridge or panel is connected to the LVDS output, in order to provide the rcar_lvds_clk_enable() and rcar_lvds_clk_disable() functions to the DU driver. If an LVDS output isn't connected, trying to create a DRM connector for the output will fail. Fix this by skipping connector creation in that case, and also skip creation of the DRM encoder as there's no point in an encoder without a connector. Fixes: e9e056949c92 ("drm: rcar-du: lvds: Convert to DRM panel bridge helper") Reported-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
* drm: rcar-du: Use drm_bridge_connector_init() helperLaurent Pinchart2021-07-281-5/+21
| | | | | | | | | | | | Use the drm_bridge_connector_init() helper to create a drm_connector for each output, instead of relying on the bridge drivers doing so. Attach the bridges with the DRM_BRIDGE_ATTACH_NO_CONNECTOR flag to instruct them not to create a connector. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org> Tested-by: Kieran Bingham <kieran.bingham@ideasonboard.com> # On V3U Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
* drm: rcar-du: Use drmm_encoder_alloc() to manage encoderKieran Bingham2021-03-161-25/+6
| | | | | | | | | | | | | | | | | | The encoder allocation was converted to a DRM managed resource at the same time as the addition of a new helper drmm_encoder_alloc() which simplifies the same process. Convert the custom drm managed resource allocation of the encoder with the helper to simplify the implementation, and prevent hitting a WARN_ON() due to the handling the drm_encoder_init() call directly without registering a .destroy() function op. Fixes: f5f16725edbc ("drm: rcar-du: Use DRM-managed allocation for encoders") Reported-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Tested-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
* drm: rcar-du: Drop local encoder variableLaurent Pinchart2021-01-051-4/+2
| | | | | | | | | | The local encoder variable is an alias for &renc->base, and is only use twice. It doesn't help much, drop it, along with the rcar_encoder_to_drm_encoder() macro that is then unused. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
* drm: rcar-du: Skip encoder allocation for LVDS1 in dual-link modeLaurent Pinchart2021-01-051-34/+25
| | | | | | | | | | | | The rcar-du driver skips registration of the encoder for the LVDS1 output when LVDS is used in dual-link mode, as the LVDS0 and LVDS1 links are bundled and handled through the LVDS0 output. It however still allocates the encoder and immediately destroys it, which is pointless. Skip allocation of the encoder altogether in that case. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
* drm: rcar-du: Embed drm_device in rcar_du_deviceLaurent Pinchart2021-01-051-2/+2
| | | | | | | | | Embedding drm_device in rcar_du_device allows usage of the DRM managed API to allocate both structures in one go, simplifying error handling. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
* drm: rcar-du: Use DRM-managed allocation for encodersLaurent Pinchart2021-01-051-18/+29
| | | | | | | | | | | | | devm_kzalloc() is the wrong API to allocate encoders, as the lifetime of the encoders is tied to the DRM device, not the device to driver binding. drmm_kzalloc() isn't a good option either, as it would result in the encoder being freed before being unregistered during the managed cleanup of the DRM objects. Use a plain kzalloc(), and register a drmm action to cleanup the encoder. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
* drm: rcar-du: Drop unneeded encoder cleanup in error pathLaurent Pinchart2021-01-051-4/+1
| | | | | | | | | | The encoder->name field can never be non-null in the error path, as that can only be possible after a successful call to drm_simple_encoder_init(). Drop the cleanup. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
* drm: rcar-du: Fix crash when using LVDS1 clock for CRTCLaurent Pinchart2021-01-051-1/+4
| | | | | | | | | | | | | | | | | | On D3 and E3 platforms, the LVDS encoder includes a PLL that can generate a clock for the corresponding CRTC, used even when the CRTC output to a non-LVDS port. This mechanism is supported by the driver, but the implementation is broken in dual-link LVDS mode. In that case, the LVDS1 drm_encoder is skipped, which causes a crash when trying to access its bridge later on. Fix this by storing bridge pointers internally instead of retrieving them from the encoder. The rcar_du_device encoders field isn't used anymore and can be dropped. Fixes: 8e8fddab0d0a ("drm: rcar-du: Skip LVDS1 output on Gen3 when using dual-link LVDS mode") Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
* drm/rcar-du: Use simple encoderThomas Zimmermann2020-04-021-11/+3
| | | | | | | | | | The rcar-du driver uses an empty implementation for its encoder. Replace the code with the generic simple encoder. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20200305155950.2705-12-tzimmermann@suse.de
* drm/bridge: Extend bridge API to disable connector creationLaurent Pinchart2020-02-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most bridge drivers create a DRM connector to model the connector at the output of the bridge. This model is historical and has worked pretty well so far, but causes several issues: - It prevents supporting more complex display pipelines where DRM connector operations are split over multiple components. For instance a pipeline with a bridge connected to the DDC signals to read EDID data, and another one connected to the HPD signal to detect connection and disconnection, will not be possible to support through this model. - It requires every bridge driver to implement similar connector handling code, resulting in code duplication. - It assumes that a bridge will either be wired to a connector or to another bridge, but doesn't support bridges that can be used in both positions very well (although there is some ad-hoc support for this in the analogix_dp bridge driver). In order to solve these issues, ownership of the connector should be moved to the display controller driver (where it can be implemented using helpers provided by the core). Extend the bridge API to allow disabling connector creation in bridge drivers as a first step towards the new model. The new flags argument to the bridge .attach() operation allows instructing the bridge driver to skip creating a connector. Unconditionally set the new flags argument to 0 for now to keep the existing behaviour, and modify all existing bridge drivers to return an error when connector creation is not requested as they don't support this feature yet. The change is based on the following semantic patch, with manual review and edits. @ rule1 @ identifier funcs; identifier fn; @@ struct drm_bridge_funcs funcs = { ..., .attach = fn }; @ depends on rule1 @ identifier rule1.fn; identifier bridge; statement S, S1; @@ int fn( struct drm_bridge *bridge + , enum drm_bridge_attach_flags flags ) { ... when != S + if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) { + DRM_ERROR("Fix bridge driver to make connector optional!"); + return -EINVAL; + } + S1 ... } @ depends on rule1 @ identifier rule1.fn; identifier bridge, flags; expression E1, E2, E3; @@ int fn( struct drm_bridge *bridge, enum drm_bridge_attach_flags flags ) { <... drm_bridge_attach(E1, E2, E3 + , flags ) ...> } @@ expression E1, E2, E3; @@ drm_bridge_attach(E1, E2, E3 + , 0 ) Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Acked-by: Sam Ravnborg <sam@ravnborg.org> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Tested-by: Sebastian Reichel <sebastian.reichel@collabora.com> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Link: https://patchwork.freedesktop.org/patch/msgid/20200226112514.12455-10-laurent.pinchart@ideasonboard.com
* drm/bridge: panel: Infer connector type from panel by defaultLaurent Pinchart2019-09-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The drm panel bridge creates a connector using a connector type explicitly passed by the display controller or bridge driver that instantiates the panel bridge. Now that drm_panel reports its connector type, we can use it to avoid passing an explicit (and often incorrect) connector type to drm_panel_bridge_add() and devm_drm_panel_bridge_add(). Several drivers report incorrect or unknown connector types to userspace. Reporting a different type may result in a breakage. For that reason, rename (devm_)drm_panel_bridge_add() to (devm_)drm_panel_bridge_add_typed(), and add new (devm_)drm_panel_bridge_add() functions that use the panel connector type. Update all callers of (devm_)drm_panel_bridge_add() to the _typed function, they will be converted one by one after testing. The panel drivers have been updated with the following Coccinelle semantic patch, with manual inspection and fixes to indentation. @@ expression bridge; expression dev; expression panel; identifier type; @@ ( -bridge = drm_panel_bridge_add(panel, type); +bridge = drm_panel_bridge_add_typed(panel, type); | -bridge = devm_drm_panel_bridge_add(dev, panel, type); +bridge = devm_drm_panel_bridge_add_typed(dev, panel, type); ) Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20190904132804.29680-3-laurent.pinchart@ideasonboard.com
* drm: Stop including drm_bridge.h from drm_crtc.hBoris Brezillon2019-08-281-0/+1
| | | | | | | | | | | | | | We are about to add a drm_bridge_state that inherits from drm_private_state which is defined in drm_atomic.h. Problem is, drm_atomic.h includes drm_crtc.h which in turn includes drm_bridge.h, leading to "drm_private_state has incomplete type" error. Let's force all users of the drm_bridge API to explicitly include drm_bridge.h. Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20190826152649.13820-2-boris.brezillon@collabora.com
* drm: rcar-du: Skip LVDS1 output on Gen3 when using dual-link LVDS modeLaurent Pinchart2019-06-081-0/+12
| | | | | | | | | | | | | In dual-link LVDS mode, the LVDS1 encoder is used as a companion for LVDS0, and both encoders transmit data from DU0. The LVDS1 output of DU1 can't be used in that case, don't create an encoder and connector for it. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org> Tested-by: Jacopo Mondi <jacopo+renesas@jmondi.org> Acked-by: Sam Ravnborg <sam@ravnborg.org> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
* drm: rcar-du: Support panels connected directly to the DPAD outputsLaurent Pinchart2019-03-281-6/+48
| | | | | | | | | | | | | | | | | The R-Car DU driver assumes that a bridge is always connected to the DU output. This is valid for the LVDS and HDMI outputs, but the DPAD outputs can be connected directly to a panel, in which case no bridge is available. To support this use case, detect whether the entities connected to the DU DPAD outputs are encoders or panels based on the number of ports of their DT node, and retrieve the corresponding type of DRM objects. For panels, additionally create panel bridge instances. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Tested-by: Kevin Key <kevin.key@gentex.com> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
* drm: rcar-du: Turn LVDS clock output on/off for DPAD0 output on D3/E3Laurent Pinchart2019-02-081-0/+1
| | | | | | | | | On the D3 and E3 SoCs the LVDS PLL clock output provides the dot clock to the DU channels, even when the LVDS outputs are not in use. Enable and disable the LVDS clock output when enabling or disabling a CRTC connected to the DPAD0 output. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
* drm: rcar-du: Simplify encoder registrationLaurent Pinchart2019-02-081-2/+1
| | | | | | | | | | Before the driver fully moved to drm_bridge and drm_panel, it was necessary to parse DT and locate encoder and connector nodes. The connector node is now unused and can be removed as a parameter to rcar_du_encoder_init(). As a consequence rcar_du_encoders_init_one() can be greatly simplified, removing most of the DT parsing. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
* drm: Split out drm_probe_helper.hDaniel Vetter2019-01-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Having the probe helper stuff (which pretty much everyone needs) in the drm_crtc_helper.h file (which atomic drivers should never need) is confusing. Split them out. To make sure I actually achieved the goal here I went through all drivers. And indeed, all atomic drivers are now free of drm_crtc_helper.h includes. v2: Make it compile. There was so much compile fail on arm drivers that I figured I'll better not include any of the acks on v1. v3: Massive rebase because i915 has lost a lot of drmP.h includes, but not all: Through drm_crtc_helper.h > drm_modeset_helper.h -> drmP.h there was still one, which this patch largely removes. Which means rolling out lots more includes all over. This will also conflict with ongoing drmP.h cleanup by others I expect. v3: Rebase on top of atomic bochs. v4: Review from Laurent for bridge/rcar/omap/shmob/core bits: - (re)move some of the added includes, use the better include files in other places (all suggested from Laurent adopted unchanged). - sort alphabetically v5: Actually try to sort them, and while at it, sort all the ones I touch. v6: Rebase onto i915 changes. v7: Rebase once more. Acked-by: Harry Wentland <harry.wentland@amd.com> Acked-by: Sam Ravnborg <sam@ravnborg.org> Cc: Sam Ravnborg <sam@ravnborg.org> Cc: Jani Nikula <jani.nikula@linux.intel.com> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Acked-by: Benjamin Gaignard <benjamin.gaignard@linaro.org> Acked-by: Jani Nikula <jani.nikula@intel.com> Acked-by: Neil Armstrong <narmstrong@baylibre.com> Acked-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com> Acked-by: CK Hu <ck.hu@mediatek.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Acked-by: Sam Ravnborg <sam@ravnborg.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Liviu Dudau <liviu.dudau@arm.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Cc: linux-arm-kernel@lists.infradead.org Cc: virtualization@lists.linux-foundation.org Cc: etnaviv@lists.freedesktop.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: linux-arm-msm@vger.kernel.org Cc: freedreno@lists.freedesktop.org Cc: nouveau@lists.freedesktop.org Cc: spice-devel@lists.freedesktop.org Cc: amd-gfx@lists.freedesktop.org Cc: linux-renesas-soc@vger.kernel.org Cc: linux-rockchip@lists.infradead.org Cc: linux-stm32@st-md-mailman.stormreply.com Cc: linux-tegra@vger.kernel.org Cc: xen-devel@lists.xen.org Link: https://patchwork.freedesktop.org/patch/msgid/20190117210334.13234-1-daniel.vetter@ffwll.ch
* drm: rcar-du: Remove inclusion of drmP.hLaurent Pinchart2019-01-141-1/+0
| | | | | | | | | | | | | | | | | | | The DRM kernel API used to be defined in a handful of headers, pulled in through drmP.h. It has since been split in multiple headers for the different DRM components, and drmP.h turned into a legacy header that just pulls in most of the DRM kernel API (and a large number of other miscellaneous kernel headers). In order to speed up compilation, replace inclusion of drmP.h with only the required headers. It turns out that the rcar-du-drm driver already includes most of the necessary headers, so the change is simple. While at it, remove unneeded inclusion of other headers, and unneeded forward declarations of structures. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
* drm: rcar-du: Move CRTC outputs bitmask to private CRTC stateLaurent Pinchart2019-01-141-10/+0
| | | | | | | | | | | | | | | | | | The rcar_du_crtc outputs field stores a bitmask of the outputs driven by the CRTC. This changes based on the configuration requested by userspace, and is used for the sole purpose of configuring the hardware. The field thus belongs to the CRTC state. Move it to the rcar_du_crtc_state structure. As a result the rcar_du_crtc_route_output() function loses most of its purpose. In order to remove it, move dpad0_source calculation to rcar_du_atomic_commit_tail(), until the field gets moved to a state structure. In order to simplify the rcar_du_group_set_routing() implementation, we also store the DPAD1 source in a new dpad1_source field which will move to a state structure with dpad0_source. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
* drm: rcar-du: Convert to SPDX identifiersKuninori Morimoto2018-09-141-5/+1
| | | | | | | | | | | Kconfig doesn't have license line, thus, it is GPL-2.0 as default. rcar_du_regs.h, rcar_lvds_regs.h are GPL-2.0, and all other files are GPL-2.0+ as original license. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Simon Horman <horms+renesas@verge.net.au> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
* drm: rcar-du: Convert LVDS encoder code to bridge driverLaurent Pinchart2018-03-071-160/+15
| | | | | | | | | | | The LVDS encoders used to be described in DT as part of the DU. They now have their own DT node, linked to the DU using the OF graph bindings. This allows moving internal LVDS encoder support to a separate driver modelled as a DRM bridge. Backward compatibility is retained as legacy DT is patched live to move to the new bindings. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
* drm: Convert to using %pOF instead of full_nameRob Herring2017-07-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that we have a custom printf format specifier, convert users of full_name to use %pOF instead. This is preparation to remove storing of the full path string for each node. Signed-off-by: Rob Herring <robh@kernel.org> Cc: Russell King <linux@armlinux.org.uk> Cc: David Airlie <airlied@linux.ie> Cc: Daniel Vetter <daniel.vetter@intel.com> Cc: Jani Nikula <jani.nikula@linux.intel.com> Cc: Sean Paul <seanpaul@chromium.org> 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: Javier Martinez Canillas <javier@osg.samsung.com> Cc: Xinliang Liu <z.liuxinliang@hisilicon.com> Cc: Rongrong Zou <zourongrong@gmail.com> Cc: Xinwei Kong <kong.kongxinwei@hisilicon.com> Cc: Chen Feng <puck.chen@hisilicon.com> Cc: CK Hu <ck.hu@mediatek.com> Cc: Philipp Zabel <p.zabel@pengutronix.de> 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: Thierry Reding <thierry.reding@gmail.com> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Mark Yao <mark.yao@rock-chips.com> Cc: Heiko Stuebner <heiko@sntech.de> Cc: Maxime Ripard <maxime.ripard@free-electrons.com> Cc: Chen-Yu Tsai <wens@csie.org> Cc: Jyri Sarha <jsarha@ti.com> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Cc: dri-devel@lists.freedesktop.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-samsung-soc@vger.kernel.org Cc: linux-mediatek@lists.infradead.org Cc: linux-amlogic@lists.infradead.org Cc: linux-renesas-soc@vger.kernel.org Cc: linux-rockchip@lists.infradead.org Partially-Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com> [seanpaul changed subject prefix and fixed conflict in stm/ltdc.c] Signed-off-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
* drm: rcar-du: Hardcode encoders types to DRM_MODE_ENCODER_NONELaurent Pinchart2017-04-041-21/+9
| | | | | | | | | | Unlike the connector type, the encoder type is unused by userspace. As it is equally unused in the driver, except in a single location where the connector type can be used instead, hardcode it to DRM_MODE_ENCODER_NONE. This allow removing all code that tries to determine (unsuccessfully in case a bridge is used) the encoder type. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
* drm: rcar-du: Replace manual bridge implementation with DRM bridgeLaurent Pinchart2017-04-041-45/+59
| | | | | | | The rcar-du driver contains a manual implementation of HDMI and VGA bridges. Use DRM bridges to replace it. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
* drm: rcar-du: Add support for LVDS mode selectionLaurent Pinchart2017-04-041-0/+27
| | | | | | | | | Retrieve the LVDS mode from the panel and configure the LVDS encoder accordingly. LVDS mode selection is static as LVDS panels can't be hot-plugged on any of the device supported by the driver. Support for dynamic mode selection can be implemented in the future when needed. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
* drm: rcar-du: Use the DRM panel APILaurent Pinchart2017-04-041-0/+22
| | | | | | | Instead of parsing the panel device tree node manually, use the panel API to delegate panel handling to a panel driver. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
* drm: rcar-du: Switch to encoder .atomic_mode_set() helper functionLaurent Pinchart2017-04-041-4/+4
| | | | | | | The native encoder mode set helper function for atomic drivers is .atomic_mode_set(). Replace the legacy .mode_set() implementation. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
* drm: rcar-du: Remove i2c slave encoder interface for hdmi encoderArchit Taneja2016-07-181-2/+1
| | | | | | | | | | | | | | | | | | The hdmi output in rcar-du uses the i2c slave encoder interface to link to the adv7511 encoder chip. The kms driver creates encoder and connector entities that internally uses the drm_encoder_slave_funcs ops provided by the slave encoder driver. Change the driver such that it expects a bridge entity instead of a slave encoder. The hdmi connector code isn't needed anymore as we expect the adv7511 bridge driver to create/manage the connector. Note that the kms driver still expects a connector node for hdmi to be present in DT. This node has no connection to the connector created by the bridge driver. Tested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Archit Taneja <architt@codeaurora.org>
* drm: rcar-du: Rely on the default ->best_encoder() behaviorBoris Brezillon2016-06-101-12/+0
| | | | | | | | | | | | 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> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1465300095-16971-10-git-send-email-boris.brezillon@free-electrons.com
* drm: rcar-du: lvds: Avoid duplication of clock clamp codeLaurent Pinchart2016-02-231-5/+1
| | | | | | Replace the duplicate code by a single central function. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
* drm: Pass 'name' to drm_encoder_init()Ville Syrjälä2015-12-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Done with coccinelle for the most part. However, it thinks '...' is part of the semantic patch, so I put an 'int DOTDOTDOT' placeholder in its place and got rid of it with sed afterwards. @@ identifier dev, encoder, funcs; @@ int drm_encoder_init(struct drm_device *dev, struct drm_encoder *encoder, const struct drm_encoder_funcs *funcs, int encoder_type + ,const char *name, int DOTDOTDOT ) { ... } @@ identifier dev, encoder, funcs; @@ int drm_encoder_init(struct drm_device *dev, struct drm_encoder *encoder, const struct drm_encoder_funcs *funcs, int encoder_type + ,const char *name, int DOTDOTDOT ); @@ expression E1, E2, E3, E4; @@ drm_encoder_init(E1, E2, E3, E4 + ,NULL ) v2: Add ', or NULL...' to @name kernel doc (Jani) Annotate the function with __printf() attribute (Jani) Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1449670818-2966-1-git-send-email-ville.syrjala@linux.intel.com
* drm: rcar-du: Replace encoder mode_fixup with atomic_checkLaurent Pinchart2015-03-031-23/+12
| | | | | | | The encoder .mode_fixup() operation is legacy, atomic updates uses the new .atomic_check() operation. Convert the encoders drivers. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
* drm: rcar-du: Switch connector DPMS to atomic helpersLaurent Pinchart2015-03-031-9/+0
| | | | | | | | The atomic connector DPMS helper implements the connector DPMS operation using atomic commit, removing the need for DPMS helper operations on CRTCs and encoders. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
* drm: rcar-du: Switch mode config to atomic helpersLaurent Pinchart2015-03-031-12/+0
| | | | | | | This removes the legacy mode config code. The CRTC and encoder prepare and commit operations are not used anymore, remove them. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
* drm: rcar-du: Rework encoder enable/disable for atomic updatesLaurent Pinchart2015-03-031-11/+22
| | | | | | | | | | When using atomic updates the encoder .enable() and .disable() helper operations are preferred over the (then legacy) .prepare() and .commit() operations. Implement .enable() and .disable() and rework .prepare(), .commit() and .dpms() as wrappers around .enable() and .disable(), easing their future removal. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
* drm: rcar-du: Replace LVDS encoder DPMS by enable/disableLaurent Pinchart2015-03-031-8/+4
| | | | | | | | The LVDS encoder doesn't support DPMS states, replace the DPMS operation by enable/disable to avoid propagating DPMS states down to the encoder code. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
* drm: rcar-du: Clamp DPMS states to on and offLaurent Pinchart2014-12-231-0/+3
| | | | | | | | | | | The intermediate DPMS standby and suspend states are a thing from the past. They only matter in practice for VGA CRT monitors, and are just a power saving vs. resume time optimization. Given that they have never been implemented properly in the rcar-du driver and that the Intel driver has dropped them on the vga port years ago, it's safe to only care about the on and off states. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
* drm: rcar-du: Remove LVDS and HDMI encoders chaining restrictionLaurent Pinchart2014-12-231-7/+0
| | | | | | | The rcar-du driver refuses connecting an LVDS output to an HDMI encoder. There is not technical reason for that restriction, remove it. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
* drm: rcar-du: Don't fail probe in case of partial encoder init errorLaurent Pinchart2014-12-231-7/+21
| | | | | | | | | | | | If an encoder fails to initialize the device can still be used without the failed encoder. Don't propagate the error out of the probe function but just skip the failed encoder. As a special case a deferred probe request from the encoder is still propagated out of the probe function in order not to break the deferred probing mechanism. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
* drm: rcar-du: Add HDMI encoder and connector supportLaurent Pinchart2014-11-261-5/+25
| | | | | | | SoCs that integrate the DU have no internal HDMI encoder, support external encoders only. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
* drm: rcar-du: Replace direct DRM encoder access with cast macroLaurent Pinchart2014-11-261-3/+5
| | | | | | | | Add a new macro to downcast an rcar_du_encoder pointer to a drm_encoder pointer and use it. This prepares for the replacement of the rcar_drm_encoder encoder field with a drm_slave_encoder. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
* drm: rcar-du: Pass the encoder DT node to rcar_du_encoder_init()Laurent Pinchart2014-11-261-2/+3
| | | | | | | | The encoder DT node will be needed to register an external HDMI encoder. Pass it to the rcar_du_encoder_init() function to prepare for HDMI support. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
* drm: rcar-du: Remove platform data supportLaurent Pinchart2014-11-261-6/+2
| | | | | | | All platforms now instantiate the DU through DT, platform data support isn't needed anymore. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>