summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/xlnx
AgeCommit message (Collapse)AuthorFilesLines
2024-02-09drm: xlnx: zynqmp_dpsub: switch to ->edid_read callbackJani Nikula1-4/+4
Prefer using the struct drm_edid based callback and functions. Signed-off-by: Jani Nikula <jani.nikula@intel.com> Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/549694273b57e7275de01daf8ce60579121998d4.1706038510.git.jani.nikula@intel.com
2024-02-07drm: xlnx: zynqmp_dpsub: Filter interrupts against maskAnatoliy Klymenko1-1/+8
Filter out status register against the interrupts' mask. Some events are being reported via DP status register, even if corresponding interrupts have been disabled. One instance of such event leads to generation of VBLANK when the driver is in DRM bridge mode, which in turn results in NULL pointer dereferencing. We should avoid processing such events in an interrupt handler context. This problem is less noticeable when the driver operates in DMA mode, as in this case we have DRM CRTC object instantiated and DRM framework simply discards unwanted VBLANKs in drm_handle_vblank(). Signed-off-by: Anatoliy Klymenko <anatoliy.klymenko@amd.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240124025402.373620-5-anatoliy.klymenko@amd.com
2024-02-07drm: xlnx: zynqmp_dpsub: Clear status register ASAPAnatoliy Klymenko1-2/+2
Clear status register as soon as we read it. Addressing comments from https://lore.kernel.org/dri-devel/beb551c7-bb7e-4cd0-b166-e9aad90c4620@ideasonboard.com/ Signed-off-by: Anatoliy Klymenko <anatoliy.klymenko@amd.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240124025402.373620-4-anatoliy.klymenko@amd.com
2024-02-07drm: xlnx: zynqmp_dpsub: Fix timing for live modeAnatoliy Klymenko1-1/+1
Expect external video timing in live video input mode, program DPSUB acordingly. Signed-off-by: Anatoliy Klymenko <anatoliy.klymenko@amd.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240124025402.373620-3-anatoliy.klymenko@amd.com
2024-02-07drm: xlnx: zynqmp_dpsub: Make drm bridge discoverableAnatoliy Klymenko1-0/+1
ZynqMP DPSUB supports 2 input modes: DMA based and live video. In the first mode, the driver implements CRTC and DP encoder DRM bridge to model the complete display pipeline. In this case, DRM bridge is being directly instantiated within the driver, not using any bridge discovery mechanisms. In the live video input mode video signal is generated by FPGA fabric and passed into DPSUB over the connected bus. In this mode driver exposes the DP encoder as a DRM bridge, expecting external CRTC to discover it via drm_of_find_panel_or_bridge() or a similar call. This discovery relies on drm_bridge.of_node being properly set. Assign device OF node to the bridge prior to registering it. This will make said bridge discoverable by an external CRTC driver. Signed-off-by: Anatoliy Klymenko <anatoliy.klymenko@amd.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240124025402.373620-2-anatoliy.klymenko@amd.com
2023-12-06drm/xlnx: Do not include <drm/drm_plane_helper.h>Thomas Zimmermann1-1/+0
Remove unnecessary include statements for <drm/drm_plane_helper.h>. The file contains helpers for non-atomic code and should not be required by most drivers. No functional changes. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Link: https://patchwork.freedesktop.org/patch/msgid/20231204090852.1650-9-tzimmermann@suse.de
2023-08-02drm: xlnx: zynqmp_dpsub: Use devm_platform_ioremap_resource_byname()Li Zetao1-7/+3
Convert platform_get_resource_byname() + devm_ioremap_resource() to a single call to devm_platform_ioremap_resource_byname(), as this is exactly what this function does. Signed-off-by: Li Zetao <lizetao1@huawei.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2023-08-02drm: xlnx: zynqmp_dpsub: Use dev_err_probe instead of dev_errWang Ming1-2/+2
It is possible that dma_request_chan() returns EPROBE_DEFER, in which case the driver defers probing without printing any message. Use dev_err_probe() to record the probe deferral cause and ease debugging. Signed-off-by: Wang Ming <machel@vivo.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2023-08-02drm: xlnx: zynqmp_dpsub: Add missing check for dma_set_maskJiasheng Jiang1-1/+3
Add check for dma_set_mask() and return the error if it fails. Fixes: d76271d22694 ("drm: xlnx: DRM/KMS driver for Xilinx ZynqMP DisplayPort Subsystem") Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2023-08-02drm/xlnx/zynqmp_dp: Fix function name zynqmp_dp_link_train() -> ↵Lee Jones1-1/+1
zynqmp_dp_train() Fixes the following W=1 kernel build warning(s): drivers/gpu/drm/xlnx/zynqmp_dp.c:793: warning: expecting prototype for zynqmp_dp_link_train(). Prototype was for zynqmp_dp_train() instead Signed-off-by: Lee Jones <lee@kernel.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2023-06-08drm/xlnx/zynqmp_dpsub: Convert to platform remove callback returning voidUwe Kleine-König1-4/+2
The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is (mostly) ignored and this typically results in resource leaks. To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new() which already returns void. Trivially convert this driver from always returning zero in the remove callback to the void returning variant. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Douglas Anderson <dianders@chromium.org> Link: https://patchwork.freedesktop.org/patch/msgid/20230507162616.1368908-54-u.kleine-koenig@pengutronix.de
2023-03-14drm/xlnx: Use GEM DMA fbdev emulationThomas Zimmermann1-2/+2
Use the fbdev emulation that is optimized for DMA helpers. Avoids possible shadow buffering and makes the code simpler. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230313155138.20584-23-tzimmermann@suse.de
2022-11-16Merge tag 'drm-misc-next-2022-11-10-1' of ↵Dave Airlie1-1/+1
git://anongit.freedesktop.org/drm/drm-misc into drm-next drm-misc-next for 6.2: UAPI Changes: Cross-subsystem Changes: Core Changes: - atomic-helper: Add begin_fb_access and end_fb_access hooks - fb-helper: Rework to move fb emulation into helpers - scheduler: rework entity flush, kill and fini - ttm: Optimize pool allocations Driver Changes: - amdgpu: scheduler rework - hdlcd: Switch to DRM-managed resources - ingenic: Fix registration error path - lcdif: FIFO threshold tuning - meson: Fix return type of cvbs' mode_valid - ofdrm: multiple fixes (kconfig, types, endianness) - sun4i: A100 and D1 support - panel: - New Panel: Jadard JD9365DA-H3 Signed-off-by: Dave Airlie <airlied@redhat.com> From: Maxime Ripard <maxime@cerno.tech> Link: https://patchwork.freedesktop.org/patch/msgid/20221110083612.g63eaocoaa554soh@houat
2022-11-09drm: xlnx: Fix return type of zynqmp_dp_bridge_mode_validNathan Huckleberry1-3/+4
The mode_valid field in drm_bridge_helper_funcs is expected to be of type enum drm_mode_status (* mode_valid) (struct drm_bridge *bridge, struct drm_display_mode *mode); The mismatched return type breaks forward edge kCFI since the underlying function definition does not match the function hook definition. A new warning in clang will catch this at compile time: drivers/gpu/drm/xlnx/zynqmp_dp.c:1573:16: error: incompatible function pointer types initializing 'enum drm_mode_status (*)(struct drm_bridge *, const struct drm_display_info *, const struct drm_display_mode *)' with an expression of type 'int (struct drm_bridge *, const struct drm_display_info *, const struct drm_display_mode *)' [-Werror,-Wincompatible-function-pointer-types-strict] .mode_valid = zynqmp_dp_bridge_mode_valid, ^~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. The return type of zynqmp_dp_bridge_mode_valid should be changed from int to enum drm_mode_status. Reported-by: Dan Carpenter <error27@gmail.com> Link: https://github.com/ClangBuiltLinux/linux/issues/1703 Link: https://github.com/ClangBuiltLinux/linux/issues/1750 Signed-off-by: Nathan Huckleberry <nhuck@google.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> [nathan: Rebase on drm-misc-next and fix conflicts Add note about new clang warning] Signed-off-by: Nathan Chancellor <nathan@kernel.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-11-05drm/fb-helper: Move generic fbdev emulation into separate source fileThomas Zimmermann1-1/+1
Move the generic fbdev implementation into its own source and header file. Adapt drivers. No functional changes, but some of the internal helpers have been renamed to fit into the drm_fbdev_ naming scheme. v3: * rename drm_fbdev.{c,h} to drm_fbdev_generic.{c,h} * rebase onto vmwgfx changes * rebase onto xlnx changes * fix include statements in amdgpu Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20221103151446.2638-22-tzimmermann@suse.de
2022-10-19drm: xlnx: zynqmp_dpsub: Add support for live video inputLaurent Pinchart2-7/+80
Add partial live video support, with a single video input that bypasses blending. Skip registration of the DRM device in that case, but register the DRM bridge instead. The DRM device will be created by the driver for the display controller in the PL. Full live video mode with concurrent usage of the video and gfx inputs, and blending in the DPSUB video pipeline, is currently unsupported. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-10-19drm: xlnx: zynqmp_dpsub: Support operation without DMA engineLaurent Pinchart3-6/+26
To prepare for usage of the DPSUB as a DisplayPort bridge without creating a DRM device, make initialization and usage of the DMA engine optional. The flag that controls this feature is currently hardcoded to operating with the DMA engine, this will be made dynamic based on the device tree configuration in a subsequent change. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-10-19drm: xlnx: zynqmp_dpsub: Allow configuration of layer modeLaurent Pinchart3-23/+22
Add a mode parameter to the zynqmp_disp_layer_enable() to set the layer mode, to prepare for live mode support. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-10-19drm: xlnx: zynqmp_dpsub: Parse DT to find connected portsLaurent Pinchart2-0/+67
To prepare for live video input support, parse the device tree to find the connected ports. Warn about unsupported configurations, and error out when invalid. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-10-19drm: xlnx: zynqmp_dpsub: Rename zynqmp_dpsub_handle_vblank with DRM prefixLaurent Pinchart3-4/+4
The better convey its purpose, rename the zynqmp_dpsub_handle_vblank() function that belongs to the DRM layer to zynqmp_dpsub_drm_handle_vblank(). Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-10-19drm: xlnx: zynqmp_dpsub: Decouple DRM device from zynqmp_dpsubLaurent Pinchart4-50/+99
To complete the decoupling of the DRM device from the zynqmp_dpsub, group all DRM-related structures in a zynqmp_dpsub_drm structure and allocate it separately from the zynqmp_dpsub. The DRM managed allocation of the drm_device now doesn't cover the zynqmp_dpsub anymore, so we need to register a cleanup action to release the zynqmp_dpsub when the drm_device is released. The will allow usage of the DisplayPort encoder as a standalone bridge, without registering a DRM device in this driver. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-10-19drm: xlnx: zynqmp_dpsub: Move all DRM init and cleanup to zynqmp_kms.cLaurent Pinchart4-123/+127
Continue the isolation of DRM/KMS code by moving all DRM init and cleanup from zynqmp_dpsub.c to zynqmp_kms.c. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-10-19drm: xlnx: zynqmp_dpsub: Manage DP and DISP allocations manuallyLaurent Pinchart5-30/+57
The zynqmp_disp and zynqmp_dp structures are allocated with drmm_kzalloc(). While this simplifies management of memory, it requires a DRM device, which will not be available at probe time when the DP bridge will be used standalone, with a DRM device in the PL. To prepare for this, switch to manual allocation for zynqmp_disp and zynqmp_dp. The cleanup still uses the DRM managed infrastructure, but one level up, at the top level. This will be addressed separately. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-10-19drm: xlnx: zynqmp_dpsub: Move DP bridge init to zynqmp_dp_probe()Laurent Pinchart3-24/+13
There's no need to delay bridge initialization, move it to zynqmp_dp_probe() and drop the zynqmp_dp_drm_init() function. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-10-19drm: xlnx: zynqmp_dpsub: Register AUX bus at bridge attach timeLaurent Pinchart1-17/+24
To prepare for operating as a standalone DP bridge with the DRM device implemented in the PL, move registration of the AUX bus to bridge attach time, as that's the earliest point when a DRM device is available. The DRM device pointer stored in zynqmp_dp isn't used anymore, drop it. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-10-19drm: xlnx: zynqmp_dpsub: Move planes handling to zynqmp_kms.cLaurent Pinchart4-168/+167
Decouple the planes handling from the display controller programming by moving the corresponding code from zynqmp_disp.c to zynqmp_kms.c. This prepares for using the DPSUB with a live video input, without creating DRM planes in the DPSUB driver. While at it, fix a typo in a comment. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-10-19drm: xlnx: zynqmp_dpsub: Move CRTC handling to zynqmp_kms.cLaurent Pinchart5-235/+232
Decouple the CRTC handling from the display controller programming by moving the corresponding code from zynqmp_disp.c to zynqmp_kms.c. This prepares for using the DPSUB with a live video input, without creating a DRM CRTC in the DPSUB driver. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-10-19drm: xlnx: zynqmp_dpsub: Move DRM/KMS initialization to separate fileLaurent Pinchart4-41/+93
Start preparation for using the DPSUB as a standalone DisplayPort encoder without a display controller by moving the DRM/KMS initialization to a new zynqmp_kms.c file. No functional change intended. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-10-19drm: xlnx: zynqmp_dpsub: Move planes to zynqmp_dpsub structureLaurent Pinchart2-19/+18
Decouple the zynqmp_disp, which handles the hardware configuration, from the DRM planes by moving the planes to the zynqmp_dpsub structure. The planes handling code will be moved to a separate file in a subsequent step. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-10-19drm: xlnx: zynqmp_dpsub: Move CRTC to zynqmp_dpsub structureLaurent Pinchart2-11/+12
Decouple the zynqmp_disp, which handles the hardware configuration, from the DRM CRTC by moving the CRTC to the zynqmp_dpsub structure. The CRTC handling code will be moved to a separate file in a subsequent step. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-10-19drm: xlnx: zynqmp_dpsub: Move audio clk from zynqmp_disp to zynqmp_dpsubLaurent Pinchart5-60/+65
The audio clock is an external resource from the DPSUB point of view, not a resource internal to the display controller. Move it to the zynqmp_dpsub structure, to allow accessing it from outside the disp code. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-10-19drm: xlnx: zynqmp_dpsub: Move pclk from zynqmp_disp to zynqmp_dpsubLaurent Pinchart3-29/+28
The video clock is an external resource from the DPSUB point of view, not a resource internal to the display controller. Move it to the zynqmp_dpsub structure, to allow accessing it from outside the disp code. While at it, rename the fields from pclk and pclk_from_ps to vid_clk and vid_clk_from_ps, to better reflect their purpose and match the documentation. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-10-19drm: xlnx: zynqmp_dpsub: Don't use drmm_kcalloc() for temporary dataLaurent Pinchart1-11/+34
The array of formats passed to drm_universal_plane_init() doesn't need to outlive the function call, as it's copied internally. Use kcalloc() instead of drmm_kcalloc() to allocate it, and free it right after usage. While at it, move the allocation and initialization of the formats array to a separate function, to prepare for splitting the DRM plane handling to a separate file. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-10-19drm: xlnx: zynqmp_dpsub: Remplace hardcoded values with ARRAY_SIZE()Laurent Pinchart1-4/+4
Use the ARRAY_SIZE() macro to iterate over arrays, instead of hardcoding their size. This makes the code less error-prone should the array size change. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-10-19drm: xlnx: zynqmp_dpsub: Pass format info to zynqmp_disp_layer_set_format()Laurent Pinchart1-6/+4
The zynqmp_disp_layer_set_format() function only needs format information, not a full plane state. Get the necessary info from the plane state in the caller and pass it to zynqmp_disp_layer_set_format(). This prepares for calling the function from non-DRM code. This doesn't introduce any functional change. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-10-19drm: xlnx: zynqmp_dpsub: Use local variable in zynqmp_disp_layer_update()Laurent Pinchart1-1/+1
Reuse the local info variable instead of going through the layer pointer in zynqmp_disp_layer_update(). This doesn't introduce any functional change. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-10-19drm: xlnx: zynqmp_dpsub: Configure blender in zynqmp_disp_enable()Laurent Pinchart1-3/+3
To prepare for control of the blender outside of the CRTC code, move the setup of the blender to the zynqmp_disp_enable() function. This doesn't introduce any functional change. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-10-19drm: xlnx: zynqmp_dpsub: Don't pass CRTC to zynqmp_disp_setup_clock()Laurent Pinchart1-10/+8
To prepare for usage of the clock setup function outside of the CRTC code, replace the DRM-specific structures passed as parameters with a pointer to the zynqmp_disp and the requested clock rate. This doesn't introduce any functional change. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-10-19drm: xlnx: zynqmp_dpsub: Drop unused zynqmp_disp_format.bus_fmt fieldLaurent Pinchart1-2/+0
The bus_fmt field of the zynqmp_disp_format structure is unused. Drop it. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-10-19drm: xlnx: zynqmp_dpsub: Drop unused zynqmp_disp.event fieldLaurent Pinchart1-3/+0
The event field of the zynqmp_disp structure is unused. Drop it. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-10-19drm: xlnx: zynqmp_dpsub: Report HPD through the bridgeLaurent Pinchart1-6/+5
Now that the driver uses the connector bridge helper, HPD can be reported directly for the connector through the drm_bridge_hpd_notify() function. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-10-19drm: xlnx: zynqmp_dpsub: Use DRM connector bridge helperLaurent Pinchart2-90/+20
Replace the manual connector implementation and registration in the DP encoder with the DRM connector bridge helper. This removes boilerplate code and simplifies the driver. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-10-19drm: xlnx: zynqmp_dpsub: Attach to the next bridgeLaurent Pinchart1-0/+18
The next component in the display chain, after the DP encoder, is most likely a DP connector. The display connector driver registers a bridge for it. That bridge doesn't need to be controlled, but is needed in order to use the DRM connector bridge helper. Retrieve it at init time, and attach to it in the DP bridge attach handler. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-10-19drm: xlnx: zynqmp_dpsub: Move encoder to DPSUB coreLaurent Pinchart3-78/+25
As part of the transitition of the DP encoder to a DRM bridge, turn the DRM encoder into a dummy encoder and move it out of the DP code, to the DPSUB core. DP encoder operations are handled by the DP bridge, which is now attached to the encoder. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-10-19drm: xlnx: zynqmp_dpsub: Move connector registration to bridge attachLaurent Pinchart1-13/+24
Connector creation requires the DRM encoder, and it thus typically performed in the bridge attach operation. Move it there, to prepare for registration of the DRM bridge. For now the zynqmp_dp_bridge_attach() is called manually at initialization time. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-10-19drm: xlnx: zynqmp_dpsub: Don't access connector in zynqmp_dp_set_format()Laurent Pinchart1-7/+8
To prepare for the removal of the connector from the DP encoder, pass the display info pointer to the zynqmp_dp_set_format() function instead of accessing the connector internally. The display info is NULL when the function is called at initialization time, as we have no display info at that point. This doesn't change the existing behaviour, given that the zynqmp_dp_set_format() was already handling this as a special case (the display info isn't initialized at init time and is all zeroes). Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-10-19drm: xlnx: zynqmp_dpsub: Create DRM bridge to model DP encoderLaurent Pinchart1-108/+225
The DP encoder is currently modelled as a DRM encoder and DRM connector. This doesn't support system configurations where the DP encoder is driven by the FPGA programmable logic, using the live video input to the DP subsystem. To enable such use cases, we need to model the encoder as a DRM bridge. As a first step, create a DRM bridge in the DP encoder driver. Move and delegate the implementation of the DRM encoder and connector operations to the bridge to prepare for the transition. The bridge will be registered with the DRM core as a separate change. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-10-19drm: xlnx: zynqmp_dpsub: Constify mode argument to functionLaurent Pinchart1-1/+1
The zynqmp_dp_encoder_mode_set_transfer_unit() function takes a mode pointer argument that it doesn't need to modify. Make it const. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-10-19drm: xlnx: zynqmp_dpsub: Switch to atomic encoder enable/disableLaurent Pinchart1-4/+6
To prepare for the transition to the DRM bridge API, switch the encoder operations to the atomic versions of .enable() and .disable(). This doesn't cause any functional change by itself. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2022-08-03drm/gem: rename struct drm_gem_dma_object.{paddr => dma_addr}Danilo Krummrich1-3/+3
The field paddr of struct drm_gem_dma_object holds a DMA address, which might actually be a physical address. However, depending on the platform, it can also be a bus address or a virtual address managed by an IOMMU. Hence, rename the field to dma_addr, which is more applicable. In order to do this renaming the following coccinelle script was used: ``` @@ struct drm_gem_dma_object *gem; @@ - gem->paddr + gem->dma_addr @@ struct drm_gem_dma_object gem; @@ - gem.paddr + gem.dma_addr @exists@ typedef dma_addr_t; symbol paddr; @@ dma_addr_t paddr; <... - paddr + dma_addr ...> @@ symbol paddr; @@ dma_addr_t - paddr + dma_addr ; ``` This patch is compile-time tested with: ``` make ARCH={x86_64,arm,arm64} allyesconfig make ARCH={x86_64,arm,arm64} drivers/gpu/drm` ``` Acked-by: Sam Ravnborg <sam@ravnborg.org> Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Danilo Krummrich <dakr@redhat.com> Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Link: https://patchwork.freedesktop.org/patch/msgid/20220802000405.949236-5-dakr@redhat.com