]> Git Repo - linux.git/log
linux.git
15 months agodrm/msm/dp: tie dp_display_irq_handler() with dp driver
Kuogee Hsieh [Fri, 1 Dec 2023 23:19:43 +0000 (15:19 -0800)]
drm/msm/dp: tie dp_display_irq_handler() with dp driver

Currently the dp_display_request_irq() is executed at
msm_dp_modeset_init() which ties irq registering to the DPU device's
life cycle, while depending on resources that are released as the DP
device is torn down. Move register DP driver irq handler to
dp_display_probe() to have dp_display_irq_handler() IRQ tied with DP
device. In addition, use platform_get_irq() to retrieve irq number
from platform device directly.

Changes in v5:
-- reworded commit text as review comments at change #4
-- tear down component if failed at dp_display_request_irq()

Changes in v4:
-- delete dp->irq check at dp_display_request_irq()

Changes in v3:
-- move calling dp_display_irq_handler() to probe

Signed-off-by: Kuogee Hsieh <[email protected]>
Reviewed-by: Dmitry Baryshkov <[email protected]>
Patchwork: https://patchwork.freedesktop.org/patch/570069/
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Dmitry Baryshkov <[email protected]>
15 months agodt-bindings: display: msm: Add reg bus and rotator interconnects
Konrad Dybcio [Wed, 29 Nov 2023 14:43:59 +0000 (15:43 +0100)]
dt-bindings: display: msm: Add reg bus and rotator interconnects

Apart from the already handled data bus (MAS_MDP_Pn<->DDR), there are
other connection paths:
- a path that connects rotator block to the DDR.
- a path that needs to be handled to ensure MDSS register access
  functions properly, namely the "reg bus", a.k.a the CPU-MDSS CFG
  interconnect.

Describe these paths to allow using them in device trees and in the
driver.

[Konrad: rework for one vs two MDP paths, update examples]
Reviewed-by: Krzysztof Kozlowski <[email protected]>
Signed-off-by: Konrad Dybcio <[email protected]>
Patchwork: https://patchwork.freedesktop.org/patch/569480/
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Dmitry Baryshkov <[email protected]>
15 months agodt-bindings: display: msm: qcm2290-mdss: Use the non-deprecated DSI compat
Konrad Dybcio [Wed, 29 Nov 2023 14:43:58 +0000 (15:43 +0100)]
dt-bindings: display: msm: qcm2290-mdss: Use the non-deprecated DSI compat

The "qcom,dsi-ctrl-6g-qcm2290" has been deprecated in
commit 0c0f65c6dd44 ("dt-bindings: msm: dsi-controller-main: Add
compatible strings for every current SoC"), but the example hasn't been
updated to reflect that.

Fix that.

Fixes: 0c0f65c6dd44 ("dt-bindings: msm: dsi-controller-main: Add compatible strings for every current SoC")
Reviewed-by: Krzysztof Kozlowski <[email protected]>
Signed-off-by: Konrad Dybcio <[email protected]>
Patchwork: https://patchwork.freedesktop.org/patch/569478/
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Dmitry Baryshkov <[email protected]>
15 months agodrm/msm/mdp4: flush vblank event on disable
Dmitry Baryshkov [Mon, 27 Nov 2023 21:54:01 +0000 (00:54 +0300)]
drm/msm/mdp4: flush vblank event on disable

Flush queued events when disabling the crtc. This avoids timeouts when
we come back and wait for dependencies (like the previous frame's
flip_done).

Fixes: c8afe684c95c ("drm/msm: basic KMS driver for snapdragon")
Signed-off-by: Dmitry Baryshkov <[email protected]>
Reviewed-by: Abhinav Kumar <[email protected]>
Patchwork: https://patchwork.freedesktop.org/patch/569127/
Link: https://lore.kernel.org/r/[email protected]
15 months agodt-bindings: display/msm: qcom, sm8150-mdss: correct DSI PHY compatible
Krzysztof Kozlowski [Sat, 11 Nov 2023 14:20:17 +0000 (15:20 +0100)]
dt-bindings: display/msm: qcom, sm8150-mdss: correct DSI PHY compatible

Qualcomm SM8150 MDSS comes with a bit different 7nm DSI PHY with its own
compatible.  DTS already use it:

  sa8155p-adp.dtb: display-subsystem@ae00000: phy@ae94400:compatible:0: 'qcom,dsi-phy-7nm' was expected

Signed-off-by: Krzysztof Kozlowski <[email protected]>
Acked-by: Conor Dooley <[email protected]>
Patchwork: https://patchwork.freedesktop.org/patch/567178/
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Dmitry Baryshkov <[email protected]>
15 months agodt-bindings: display/msm: qcom, sm8250-mdss: add DisplayPort controller node
Krzysztof Kozlowski [Tue, 7 Nov 2023 10:36:00 +0000 (11:36 +0100)]
dt-bindings: display/msm: qcom, sm8250-mdss: add DisplayPort controller node

Document the DisplayPort controller node in MDSS binding, already used
in DTS:

  sm8250-xiaomi-elish-boe.dtb: display-subsystem@ae00000: Unevaluated properties are not allowed ('displayport-controller@ae90000' was unexpected)

Signed-off-by: Krzysztof Kozlowski <[email protected]>
Acked-by: Conor Dooley <[email protected]>
Patchwork: https://patchwork.freedesktop.org/patch/566297/
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Dmitry Baryshkov <[email protected]>
15 months agodrm/msm/mdp4: use drmm-managed allocation for mdp4_lcdc_encoder
Dmitry Baryshkov [Sat, 8 Jul 2023 01:04:05 +0000 (04:04 +0300)]
drm/msm/mdp4: use drmm-managed allocation for mdp4_lcdc_encoder

Change struct mdp4_lcdc_encoder allocation to use drmm_encoder_alloc().
This removes the need to perform any actions on this encoder
destruction.

Signed-off-by: Dmitry Baryshkov <[email protected]>
Reviewed-by: Abhinav Kumar <[email protected]>
Patchwork: https://patchwork.freedesktop.org/patch/546176/
Link: https://lore.kernel.org/r/[email protected]
15 months agodrm/msm/mdp4: use drmm-managed allocation for mdp4_dtv_encoder
Dmitry Baryshkov [Sat, 8 Jul 2023 01:04:04 +0000 (04:04 +0300)]
drm/msm/mdp4: use drmm-managed allocation for mdp4_dtv_encoder

Change struct mdp4_dtv_encoder allocation to use drmm_encoder_alloc().
This removes the need to perform any actions on this encoder
destruction.

Signed-off-by: Dmitry Baryshkov <[email protected]>
Reviewed-by: Abhinav Kumar <[email protected]>
Patchwork: https://patchwork.freedesktop.org/patch/546178/
Link: https://lore.kernel.org/r/[email protected]
15 months agodrm/msm/mdp4: use drmm-managed allocation for mdp4_dsi_encoder
Dmitry Baryshkov [Sat, 8 Jul 2023 01:04:03 +0000 (04:04 +0300)]
drm/msm/mdp4: use drmm-managed allocation for mdp4_dsi_encoder

Change struct mdp4_dsi_encoder allocation to use drmm_encoder_alloc().
This removes the need to perform any actions on this encoder
destruction.

Signed-off-by: Dmitry Baryshkov <[email protected]>
Reviewed-by: Abhinav Kumar <[email protected]>
Patchwork: https://patchwork.freedesktop.org/patch/546180/
Link: https://lore.kernel.org/r/[email protected]
15 months agodrm/msm/mdp4: use drmm-managed allocation for mdp4_crtc
Dmitry Baryshkov [Sat, 8 Jul 2023 01:04:02 +0000 (04:04 +0300)]
drm/msm/mdp4: use drmm-managed allocation for mdp4_crtc

Change struct mdp4_crtc allocation to use drmm_crtc_alloc(). This
removes the need to perform any actions on CRTC destruction.

Signed-off-by: Dmitry Baryshkov <[email protected]>
Reviewed-by: Abhinav Kumar <[email protected]>
Patchwork: https://patchwork.freedesktop.org/patch/546184/
Link: https://lore.kernel.org/r/[email protected]
15 months agodrm/msm/mdp4: use bulk regulators API for LCDC encoder
Dmitry Baryshkov [Sat, 8 Jul 2023 01:04:01 +0000 (04:04 +0300)]
drm/msm/mdp4: use bulk regulators API for LCDC encoder

Switch mdp4_lcdc_encoder to using regulator_bulk_* API instead of
enumerating regulators by hand.

Signed-off-by: Dmitry Baryshkov <[email protected]>
Reviewed-by: Abhinav Kumar <[email protected]>
Patchwork: https://patchwork.freedesktop.org/patch/546173/
Link: https://lore.kernel.org/r/[email protected]
15 months agodrm/msm/mdp5: use drmm-managed allocation for mdp5_encoder
Dmitry Baryshkov [Sat, 8 Jul 2023 01:03:59 +0000 (04:03 +0300)]
drm/msm/mdp5: use drmm-managed allocation for mdp5_encoder

Change struct mdp5_encoder allocation to use drmm_encoder_alloc(). This
removes the need to perform any actions on encoder destruction.

Signed-off-by: Dmitry Baryshkov <[email protected]>
Reviewed-by: Abhinav Kumar <[email protected]>
Patchwork: https://patchwork.freedesktop.org/patch/546164/
Link: https://lore.kernel.org/r/[email protected]
15 months agodrm/msm/mdp5: use drmm-managed allocation for mdp5_crtc
Dmitry Baryshkov [Sat, 8 Jul 2023 01:03:58 +0000 (04:03 +0300)]
drm/msm/mdp5: use drmm-managed allocation for mdp5_crtc

Change struct mdp5_crtc allocation to use drmm_crtc_alloc(). This
removes the need to perform any actions on CRTC destruction.

Signed-off-by: Dmitry Baryshkov <[email protected]>
Reviewed-by: Abhinav Kumar <[email protected]>
Patchwork: https://patchwork.freedesktop.org/patch/546169/
Link: https://lore.kernel.org/r/[email protected]
15 months agodrm/msm/mdp5: use devres-managed allocation for INTF data
Dmitry Baryshkov [Sat, 8 Jul 2023 01:03:57 +0000 (04:03 +0300)]
drm/msm/mdp5: use devres-managed allocation for INTF data

Use devm_kzalloc to create INTF data structure. This allows us
to remove corresponding kfree() call.

Signed-off-by: Dmitry Baryshkov <[email protected]>
Reviewed-by: Abhinav Kumar <[email protected]>
Patchwork: https://patchwork.freedesktop.org/patch/546163/
Link: https://lore.kernel.org/r/[email protected]
15 months agodrm/msm/mdp5: use devres-managed allocation for SMP data
Dmitry Baryshkov [Sat, 8 Jul 2023 01:03:56 +0000 (04:03 +0300)]
drm/msm/mdp5: use devres-managed allocation for SMP data

Use devm_kzalloc to create SMP data structure. This allows us
to remove corresponding kfree and drop mdp5_smp_destroy() function.

Signed-off-by: Dmitry Baryshkov <[email protected]>
Reviewed-by: Abhinav Kumar <[email protected]>
Patchwork: https://patchwork.freedesktop.org/patch/546172/
Link: https://lore.kernel.org/r/[email protected]
15 months agodrm/msm/mdp5: use devres-managed allocation for pipe data
Dmitry Baryshkov [Sat, 8 Jul 2023 01:03:55 +0000 (04:03 +0300)]
drm/msm/mdp5: use devres-managed allocation for pipe data

Use devm_kzalloc to create pipe data structure. This allows us
to remove corresponding kfree and drop mdp5_pipe_destroy() function.

Signed-off-by: Dmitry Baryshkov <[email protected]>
Reviewed-by: Abhinav Kumar <[email protected]>
Patchwork: https://patchwork.freedesktop.org/patch/546171/
Link: https://lore.kernel.org/r/[email protected]
15 months agodrm/msm/mdp5: use devres-managed allocation for mixer data
Dmitry Baryshkov [Sat, 8 Jul 2023 01:03:54 +0000 (04:03 +0300)]
drm/msm/mdp5: use devres-managed allocation for mixer data

Use devm_kzalloc to create mixer data structure. This allows us
to remove corresponding kfree and drop mdp5_mixer_destroy() function.

Signed-off-by: Dmitry Baryshkov <[email protected]>
Reviewed-by: Abhinav Kumar <[email protected]>
Patchwork: https://patchwork.freedesktop.org/patch/546166/
Link: https://lore.kernel.org/r/[email protected]
15 months agodrm/msm/mdp5: use devres-managed allocation for CTL manager data
Dmitry Baryshkov [Sat, 8 Jul 2023 01:03:53 +0000 (04:03 +0300)]
drm/msm/mdp5: use devres-managed allocation for CTL manager data

Use devm_kzalloc to create CTL manager data structure. This allows us
to remove corresponding kfree and drop mdp5_ctlm_destroy() function.

Signed-off-by: Dmitry Baryshkov <[email protected]>
Reviewed-by: Abhinav Kumar <[email protected]>
Patchwork: https://patchwork.freedesktop.org/patch/546159/
Link: https://lore.kernel.org/r/[email protected]
15 months agodrm/msm/mdp5: use devres-managed allocation for configuration data
Dmitry Baryshkov [Sat, 8 Jul 2023 01:03:52 +0000 (04:03 +0300)]
drm/msm/mdp5: use devres-managed allocation for configuration data

Use devm_kzalloc to create configuration data structure. This allows us
to remove corresponding kfree and drop mdp5_cfg_destroy() function.

Signed-off-by: Dmitry Baryshkov <[email protected]>
Reviewed-by: Abhinav Kumar <[email protected]>
Patchwork: https://patchwork.freedesktop.org/patch/546156/
Link: https://lore.kernel.org/r/[email protected]
15 months agodrm/msm/dp: cleanup debugfs handling
Dmitry Baryshkov [Thu, 19 Oct 2023 10:44:19 +0000 (13:44 +0300)]
drm/msm/dp: cleanup debugfs handling

Currently there are two subdirs for DP debugfs files, e.g. DP-1, created
by the drm core for the connector, and the msm_dp-DP-1, created by the
DP driver itself. Merge those two, so that there are no extraneous
connector-related subdirs.

Reviewed-by: Abhinav Kumar <[email protected]>
Patchwork: https://patchwork.freedesktop.org/patch/563523/
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Dmitry Baryshkov <[email protected]>
15 months agodt-bindings: gpu: mali-utgard: Add Rockchip RK3128 compatible
Alex Bee [Sat, 2 Dec 2023 12:51:42 +0000 (13:51 +0100)]
dt-bindings: gpu: mali-utgard: Add Rockchip RK3128 compatible

Rockchip RK312x SoC family has a Mali400 MP2.
Add a compatible for it.

Signed-off-by: Alex Bee <[email protected]>
Acked-by: Krzysztof Kozlowski <[email protected]>
Signed-off-by: Heiko Stuebner <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agodrm/atomic: Loosen FB atomic checks
Jessica Zhang [Fri, 27 Oct 2023 22:32:57 +0000 (15:32 -0700)]
drm/atomic: Loosen FB atomic checks

Loosen the requirements for atomic and legacy commit so that, in cases
where pixel_source != FB, the commit can still go through.

This includes adding framebuffer NULL checks in other areas to account for
FB being NULL when non-FB pixel sources are enabled.

To disable a plane, the pixel_source must be NONE or the FB must be NULL
if pixel_source == FB.

Signed-off-by: Jessica Zhang <[email protected]>
Reviewed-by: Dmitry Baryshkov <[email protected]>
Signed-off-by: Dmitry Baryshkov <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agodrm/atomic: Move framebuffer checks to helper
Jessica Zhang [Fri, 27 Oct 2023 22:32:56 +0000 (15:32 -0700)]
drm/atomic: Move framebuffer checks to helper

Currently framebuffer checks happen directly in
drm_atomic_plane_check(). Move these checks into their own helper
method.

Reviewed-by: Dmitry Baryshkov <[email protected]>
Acked-by: Harry Wentland <[email protected]>
Acked-by: Sebastian Wick <[email protected]>
Signed-off-by: Jessica Zhang <[email protected]>
Signed-off-by: Dmitry Baryshkov <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agodrm/atomic: Add solid fill data to plane state dump
Jessica Zhang [Fri, 27 Oct 2023 22:32:55 +0000 (15:32 -0700)]
drm/atomic: Add solid fill data to plane state dump

Add solid_fill property data to the atomic plane state dump.

Reviewed-by: Dmitry Baryshkov <[email protected]>
Acked-by: Harry Wentland <[email protected]>
Acked-by: Sebastian Wick <[email protected]>
Signed-off-by: Jessica Zhang <[email protected]>
Signed-off-by: Dmitry Baryshkov <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agodrm/atomic: Add pixel source to plane state dump
Jessica Zhang [Fri, 27 Oct 2023 22:32:54 +0000 (15:32 -0700)]
drm/atomic: Add pixel source to plane state dump

Add pixel source to the atomic plane state dump

Reviewed-by: Dmitry Baryshkov <[email protected]>
Acked-by: Harry Wentland <[email protected]>
Acked-by: Sebastian Wick <[email protected]>
Signed-off-by: Jessica Zhang <[email protected]>
Signed-off-by: Dmitry Baryshkov <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agodrm: Add solid fill pixel source
Jessica Zhang [Fri, 27 Oct 2023 22:32:53 +0000 (15:32 -0700)]
drm: Add solid fill pixel source

Add "SOLID_FILL" as a valid pixel source. If the pixel_source property is
set to "SOLID_FILL", it will display data from the drm_plane "solid_fill"
blob property.

Reviewed-by: Dmitry Baryshkov <[email protected]>
Acked-by: Pekka Paalanen <[email protected]>
Acked-by: Harry Wentland <[email protected]>
Acked-by: Sebastian Wick <[email protected]>
Signed-off-by: Jessica Zhang <[email protected]>
Signed-off-by: Dmitry Baryshkov <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agodrm: Introduce solid fill DRM plane property
Jessica Zhang [Fri, 27 Oct 2023 22:32:52 +0000 (15:32 -0700)]
drm: Introduce solid fill DRM plane property

Document and add support for solid_fill property to drm_plane. In
addition, add support for setting and getting the values for solid_fill.

To enable solid fill planes, userspace must assign a property blob to
the "solid_fill" plane property containing the following information:

struct drm_mode_solid_fill {
u32 r, g, b, pad;
};

Acked-by: Harry Wentland <[email protected]>
Acked-by: Sebastian Wick <[email protected]>
Signed-off-by: Jessica Zhang <[email protected]>
Reviewed-by: Dmitry Baryshkov <[email protected]>
Signed-off-by: Dmitry Baryshkov <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agodrm: Introduce pixel_source DRM plane property
Jessica Zhang [Fri, 27 Oct 2023 22:32:51 +0000 (15:32 -0700)]
drm: Introduce pixel_source DRM plane property

Add support for pixel_source property to drm_plane and related
documentation. In addition, force pixel_source to
DRM_PLANE_PIXEL_SOURCE_FB in DRM_IOCTL_MODE_SETPLANE as to not break
legacy userspace.

This enum property will allow user to specify a pixel source for the
plane. Possible pixel sources will be defined in the
drm_plane_pixel_source enum.

Currently, the only pixel sources are DRM_PLANE_PIXEL_SOURCE_FB (the
default value) and DRM_PLANE_PIXEL_SOURCE_NONE.

Acked-by: Dmitry Baryshkov <[email protected]>
Acked-by: Pekka Paalanen <[email protected]>
Acked-by: Harry Wentland <[email protected]>
Acked-by: Sebastian Wick <[email protected]>
Acked-by: Simon Ser <[email protected]>
Signed-off-by: Jessica Zhang <[email protected]>
Signed-off-by: Dmitry Baryshkov <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agodrm/msm/a6xx: add QMP dependency
Arnd Bergmann [Mon, 16 Oct 2023 20:04:03 +0000 (22:04 +0200)]
drm/msm/a6xx: add QMP dependency

When QMP is in a loadable module, the A6xx GPU driver fails to link
as built-in:

x86_64-linux-ld: drivers/gpu/drm/msm/adreno/a6xx_gmu.o: in function `a6xx_gmu_resume':
a6xx_gmu.c:(.text+0xd62): undefined reference to `qmp_send'

Add the usual dependency that still allows compiling without QMP but
otherwise avoids the broken combination of options.

Fixes: 88a0997f2f949 ("drm/msm/a6xx: Send ACD state to QMP at GMU resume")
Signed-off-by: Arnd Bergmann <[email protected]>
Reviewed-by: Konrad Dybcio <[email protected]>
Reviewed-by: Dmitry Baryshkov <[email protected]>
Patchwork: https://patchwork.freedesktop.org/patch/562945/
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Dmitry Baryshkov <[email protected]>
15 months agodrm/msm/dpu: enable smartdma on sm8350
Abhinav Kumar [Fri, 8 Sep 2023 19:33:13 +0000 (12:33 -0700)]
drm/msm/dpu: enable smartdma on sm8350

To support high resolutions on sm8350, enable smartdma
in its catalog.

Signed-off-by: Abhinav Kumar <[email protected]>
Tested-by: Dmitry Baryshkov <[email protected]>
Reviewed-by: Dmitry Baryshkov <[email protected]>
Patchwork: https://patchwork.freedesktop.org/patch/556561/
Link: https://lore.kernel.org/r/[email protected]
[DB: rebased on top of msm-next]
Signed-off-by: Dmitry Baryshkov <[email protected]>
15 months agodrm/msm/dpu: enable SmartDMA on SM8450
Dmitry Baryshkov [Mon, 9 Oct 2023 16:56:27 +0000 (19:56 +0300)]
drm/msm/dpu: enable SmartDMA on SM8450

Enable the SmartDMA / multirect support on the SM8450 platform to
support higher resoltion modes.

Reviewed-by: Abhinav Kumar <[email protected]>
Patchwork: https://patchwork.freedesktop.org/patch/561590/
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Dmitry Baryshkov <[email protected]>
15 months agodrm/msm/dpu: try multirect based on mdp clock limits
Abhinav Kumar [Mon, 11 Sep 2023 22:16:27 +0000 (15:16 -0700)]
drm/msm/dpu: try multirect based on mdp clock limits

It's certainly possible that for large resolutions a single DPU SSPP
cannot process the image without exceeding the MDP clock limits but
it can still process it in multirect mode because the source rectangles
will get divided and can fall within the MDP clock limits.

If the SSPP cannot process the image even in multirect mode, then it
will be rejected in dpu_plane_atomic_check_pipe().

Hence try using multirect for resolutions which cannot be processed
by a single SSPP without exceeding the MDP clock limits.

changes in v2:
- use crtc_state's adjusted_mode instead of mode
- fix the UBWC condition to check maxlinewidth

Signed-off-by: Abhinav Kumar <[email protected]>
Reviewed-by: Dmitry Baryshkov <[email protected]>
Tested-by: Dmitry Baryshkov <[email protected]>
Patchwork: https://patchwork.freedesktop.org/patch/556817/
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Dmitry Baryshkov <[email protected]>
15 months agodma-buf/sw_sync: Add fence deadline support
Rob Clark [Wed, 23 Aug 2023 21:54:56 +0000 (14:54 -0700)]
dma-buf/sw_sync: Add fence deadline support

This consists of simply storing the most recent deadline, and adding an
ioctl to retrieve the deadline.  This can be used in conjunction with
the SET_DEADLINE ioctl on a fence fd for testing.  Ie. create various
sw_sync fences, merge them into a fence-array, set deadline on the
fence-array and confirm that it is propagated properly to each fence.

v2: Switch UABI to express deadline as u64
v3: More verbose UAPI docs, show how to convert from timespec
v4: Better comments, track the soonest deadline, as a normal fence
    implementation would, return an error if no deadline set.

Signed-off-by: Rob Clark <[email protected]>
Reviewed-by: Christian König <[email protected]>
Acked-by: Pekka Paalanen <[email protected]>
Signed-off-by: Dmitry Baryshkov <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agodma-buf/sync_file: Add SET_DEADLINE ioctl
Rob Clark [Wed, 23 Aug 2023 21:54:55 +0000 (14:54 -0700)]
dma-buf/sync_file: Add SET_DEADLINE ioctl

The initial purpose is for igt tests, but this would also be useful for
compositors that wait until close to vblank deadline to make decisions
about which frame to show.

The igt tests can be found at:

https://gitlab.freedesktop.org/robclark/igt-gpu-tools/-/commits/fence-deadline

v2: Clarify the timebase, add link to igt tests
v3: Use u64 value in ns to express deadline.
v4: More doc

Signed-off-by: Rob Clark <[email protected]>
Acked-by: Pekka Paalanen <[email protected]>
Signed-off-by: Dmitry Baryshkov <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agodrm/syncobj: Add deadline support for syncobj waits
Rob Clark [Wed, 23 Aug 2023 21:54:54 +0000 (14:54 -0700)]
drm/syncobj: Add deadline support for syncobj waits

Add a new flag to let userspace provide a deadline as a hint for syncobj
and timeline waits.  This gives a hint to the driver signaling the
backing fences about how soon userspace needs it to compete work, so it
can adjust GPU frequency accordingly.  An immediate deadline can be
given to provide something equivalent to i915 "wait boost".

v2: Use absolute u64 ns value for deadline hint, drop cap and driver
    feature flag in favor of allowing count_handles==0 as a way for
    userspace to probe kernel for support of new flag
v3: More verbose comments about UAPI
v4: Fix negative zero, s/deadline_ns/deadline_nsec/ for consistency with
    existing ioctl struct fields
v5: Comment/description typo fixes

Signed-off-by: Rob Clark <[email protected]>
Reviewed-by: Tvrtko Ursulin <[email protected]>
[DB: fixed checkpatch warnings]
Signed-off-by: Dmitry Baryshkov <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agoaccel/qaic: Expand DRM device lifecycle
Carl Vanderlip [Fri, 17 Nov 2023 17:43:37 +0000 (10:43 -0700)]
accel/qaic: Expand DRM device lifecycle

Currently the QAIC DRM device registers itself when the MHI QAIC_CONTROL
channel becomes available. This is when the device is able to process
workloads. However, the DRM driver also provides the debugfs interface
bootlog for the device. If the device fails to boot to the QSM (which
brings up the MHI QAIC_CONTROL channel), the bootlog won't be available for
debugging why it failed to boot.

Change when the DRM device registers itself from when QAIC_CONTROL is
available to when the card is first probed on the PCI bus. Additionally,
make the DRM driver persist through reset/error cases so the driver
doesn't have to be reloaded to access the card again. Send
KOBJ_ONLINE/OFFLINE uevents so userspace can know when DRM device is
ready to handle requests.

Signed-off-by: Carl Vanderlip <[email protected]>
Reviewed-by: Pranjal Ramajor Asha Kanojiya <[email protected]>
Reviewed-by: Jeffrey Hugo <[email protected]>
Signed-off-by: Jeffrey Hugo <[email protected]>
Reviewed-by: Jacek Lawrynowicz <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agoaccel/qaic: Increase number of in_reset states
Carl Vanderlip [Fri, 17 Nov 2023 17:43:36 +0000 (10:43 -0700)]
accel/qaic: Increase number of in_reset states

'in_reset' holds the state of the device. As part of bringup, the device
needs to be queried to check if it's in a valid state. Add a new state
that indicates that the device is coming up, but not ready for users
yet. Rename to 'dev_state' to better describe the variable.

Signed-off-by: Carl Vanderlip <[email protected]>
Reviewed-by: Pranjal Ramajor Asha Kanojiya <[email protected]>
Reviewed-by: Jeffrey Hugo <[email protected]>
Signed-off-by: Jeffrey Hugo <[email protected]>
Reviewed-by: Jacek Lawrynowicz <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agodrm/imx/lcdc: Fix double-free of driver data
Uwe Kleine-König [Thu, 6 Jul 2023 09:27:31 +0000 (11:27 +0200)]
drm/imx/lcdc: Fix double-free of driver data

The struct imx_lcdc driver data is allocated using devm_drm_dev_alloc()
so it must not be explicitly kfree()d.

Also drm_kms_helper_poll_fini() should not be called as there is no
matching drm_kms_helper_poll_init(). So drop the release function
completely.

Fixes: c87e859cdeb5 ("drm/imx/lcdc: Implement DRM driver for imx25")
Signed-off-by: Uwe Kleine-König <[email protected]>
Reviewed-by: Philipp Zabel <[email protected]>
Signed-off-by: Philipp Zabel <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agodrm/v3d: Create a CPU job extension for the copy performance query job
MaĂ­ra Canal [Thu, 30 Nov 2023 16:40:40 +0000 (13:40 -0300)]
drm/v3d: Create a CPU job extension for the copy performance query job

A CPU job is a type of job that performs operations that requires CPU
intervention. A copy performance query job is a job that copy the complete
or partial result of a query to a buffer. In order to copy the result of
a performance query to a buffer, we need to get the values from the
performance monitors.

So, create a user extension for the CPU job that enables the creation
of a copy performance query job. This user extension will allow the creation
of a CPU job that copy the results of a performance query to a BO with the
possibility to indicate the availability with a availability bit.

Signed-off-by: MaĂ­ra Canal <[email protected]>
Reviewed-by: Iago Toral Quiroga <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agodrm/v3d: Create a CPU job extension for the reset performance query job
MaĂ­ra Canal [Thu, 30 Nov 2023 16:40:39 +0000 (13:40 -0300)]
drm/v3d: Create a CPU job extension for the reset performance query job

A CPU job is a type of job that performs operations that requires CPU
intervention. A reset performance query job is a job that resets the
performance queries by resetting the values of the perfmons. Moreover,
we also reset the syncobjs related to the availability of the query.

So, create a user extension for the CPU job that enables the creation
of a reset performance job. This user extension will allow the creation of
a CPU job that resets the perfmons values and resets the availability syncobj.

Signed-off-by: MaĂ­ra Canal <[email protected]>
Reviewed-by: Iago Toral Quiroga <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agodrm/v3d: Create a CPU job extension to copy timestamp query to a buffer
MaĂ­ra Canal [Thu, 30 Nov 2023 16:40:38 +0000 (13:40 -0300)]
drm/v3d: Create a CPU job extension to copy timestamp query to a buffer

A CPU job is a type of job that performs operations that requires CPU
intervention. A copy timestamp query job is a job that copy the complete
or partial result of a query to a buffer. As V3D doesn't provide any
mechanism to obtain a timestamp from the GPU, it is a job that needs
CPU intervention.

So, create a user extension for the CPU job that enables the creation
of a copy timestamp query job. This user extension will allow the creation
of a CPU job that copy the results of a timestamp query to a BO with the
possibility to indicate the timestamp availability with a availability bit.

Signed-off-by: MaĂ­ra Canal <[email protected]>
Reviewed-by: Iago Toral Quiroga <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agodrm/v3d: Create a CPU job extension for the reset timestamp job
MaĂ­ra Canal [Thu, 30 Nov 2023 16:40:37 +0000 (13:40 -0300)]
drm/v3d: Create a CPU job extension for the reset timestamp job

A CPU job is a type of job that performs operations that requires CPU
intervention. A reset timestamp job is a job that resets the timestamp
queries based on the value offset of the first query. As V3D doesn't
provide any mechanism to obtain a timestamp from the GPU, it is a job
that needs CPU intervention.

So, create a user extension for the CPU job that enables the creation
of a reset timestamp job. This user extension will allow the creation of
a CPU job that resets the timestamp value in the timestamp BO and resets
the availability syncobj.

Signed-off-by: MaĂ­ra Canal <[email protected]>
Reviewed-by: Iago Toral Quiroga <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agodrm/v3d: Create a CPU job extension for the timestamp query job
MaĂ­ra Canal [Thu, 30 Nov 2023 16:40:36 +0000 (13:40 -0300)]
drm/v3d: Create a CPU job extension for the timestamp query job

A CPU job is a type of job that performs operations that requires CPU
intervention. A timestamp query job is a job that calculates the
query timestamp and updates the query availability by signaling a
syncobj. As V3D doesn't provide any mechanism to obtain a timestamp
from the GPU, it is a job that needs CPU intervention.

So, create a user extension for the CPU job that enables the creation
of a timestamp query job. This user extension will allow the creation of
a CPU job that performs the timestamp query calculation and updates the
timestamp BO with the proper value.

Signed-off-by: MaĂ­ra Canal <[email protected]>
Reviewed-by: Iago Toral Quiroga <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agodrm/v3d: Create a CPU job extension for a indirect CSD job
MaĂ­ra Canal [Thu, 30 Nov 2023 16:40:35 +0000 (13:40 -0300)]
drm/v3d: Create a CPU job extension for a indirect CSD job

A CPU job is a type of job that performs operations that requires CPU
intervention. An indirect CSD job is a job that, when executed in the
queue, will map the indirect buffer, read the dispatch parameters, and
submit a regular dispatch. Therefore, it is a job that needs CPU
intervention.

So, create a user extension for the CPU job that enables the creation
of an indirect CSD. This user extension will allow the creation of a CSD
job linked to a CPU job. The CPU job will wait for the indirect CSD job
dependencies and, once they are signaled, it will update the CSD job
parameters.

Co-developed-by: Melissa Wen <[email protected]>
Signed-off-by: Melissa Wen <[email protected]>
Signed-off-by: MaĂ­ra Canal <[email protected]>
Reviewed-by: Iago Toral Quiroga <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agodrm/v3d: Enable BO mapping
MaĂ­ra Canal [Thu, 30 Nov 2023 16:40:34 +0000 (13:40 -0300)]
drm/v3d: Enable BO mapping

For the indirect CSD CPU job, we will need to access the internal
contents of the BO with the dispatch parameters. Therefore, create
methods to allow the mapping and unmapping of the BO.

Signed-off-by: MaĂ­ra Canal <[email protected]>
Reviewed-by: Iago Toral Quiroga <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agodrm/v3d: Detach the CSD job BO setup
Melissa Wen [Thu, 30 Nov 2023 16:40:33 +0000 (13:40 -0300)]
drm/v3d: Detach the CSD job BO setup

Detach CSD job setup from CSD submission ioctl to reuse it in CPU
submission ioctl for indirect CSD job.

Signed-off-by: Melissa Wen <[email protected]>
Co-developed-by: MaĂ­ra Canal <[email protected]>
Signed-off-by: MaĂ­ra Canal <[email protected]>
Reviewed-by: Iago Toral Quiroga <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agodrm/v3d: Create tracepoints to track the CPU job
MaĂ­ra Canal [Thu, 30 Nov 2023 16:40:32 +0000 (13:40 -0300)]
drm/v3d: Create tracepoints to track the CPU job

Create tracepoints to track the three major events of a CPU job
lifetime:
1. Submission of a `v3d_submit_cpu` IOCTL
2. Beginning of the execution of a CPU job
3. Ending of the execution of a CPU job

Signed-off-by: MaĂ­ra Canal <[email protected]>
Reviewed-by: Iago Toral Quiroga <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agodrm/v3d: Use v3d_get_extensions() to parse CPU job data
MaĂ­ra Canal [Thu, 30 Nov 2023 16:40:31 +0000 (13:40 -0300)]
drm/v3d: Use v3d_get_extensions() to parse CPU job data

Currently, v3d_get_extensions() only parses multisync data and assigns
it to the `struct v3d_submit_ext`. But, to implement the CPU job with
user extensions, we want v3d_get_extensions() to be able to parse CPU
job data and assign it to the `struct v3d_cpu_job`.

Therefore, allow the function v3d_get_extensions() to use `struct v3d_cpu_job *`
as a parameter. If the `struct v3d_cpu_job *` is assigned to NULL, it means
that the job is a GPU job and CPU job extensions should be rejected.

Signed-off-by: MaĂ­ra Canal <[email protected]>
Reviewed-by: Iago Toral Quiroga <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agodrm/v3d: Add a CPU job submission
Melissa Wen [Thu, 30 Nov 2023 16:40:30 +0000 (13:40 -0300)]
drm/v3d: Add a CPU job submission

Create a new type of job, a CPU job. A CPU job is a type of job that
performs operations that requires CPU intervention. The overall idea is
to use user extensions to enable different types of CPU job, allowing the
CPU job to perform different operations according to the type of user
extension. The user extension ID identify the type of CPU job that must
be dealt.

Having a CPU job is interesting for synchronization purposes as a CPU
job has a queue like any other V3D job and can be synchoronized by the
multisync extension.

Signed-off-by: Melissa Wen <[email protected]>
Co-developed-by: MaĂ­ra Canal <[email protected]>
Signed-off-by: MaĂ­ra Canal <[email protected]>
Reviewed-by: Iago Toral Quiroga <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agodrm/v3d: Decouple job allocation from job initiation
MaĂ­ra Canal [Thu, 30 Nov 2023 16:40:29 +0000 (13:40 -0300)]
drm/v3d: Decouple job allocation from job initiation

We want to allow the IOCTLs to allocate the job without initiating it.
This will be useful for the CPU job submission IOCTL, as the CPU job has
the need to use information from the user extensions. Currently, the
user extensions are parsed before the job allocation, making it
impossible to fill the CPU job when parsing the user extensions.
Therefore, decouple the job allocation from the job initiation.

Signed-off-by: MaĂ­ra Canal <[email protected]>
Reviewed-by: Iago Toral Quiroga <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agodrm/v3d: Don't allow two multisync extensions in the same job
MaĂ­ra Canal [Thu, 30 Nov 2023 16:40:28 +0000 (13:40 -0300)]
drm/v3d: Don't allow two multisync extensions in the same job

Currently, two multisync extensions can be added to the same job and
only the last multisync extension will be used. To avoid this
vulnerability, don't allow two multisync extensions in the same job.

Signed-off-by: MaĂ­ra Canal <[email protected]>
Reviewed-by: Iago Toral Quiroga <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agodrm/v3d: Simplify job refcount handling
Melissa Wen [Thu, 30 Nov 2023 16:40:27 +0000 (13:40 -0300)]
drm/v3d: Simplify job refcount handling

Instead of checking if the job is NULL every time we call the function,
check it inside the function.

Signed-off-by: Melissa Wen <[email protected]>
Signed-off-by: MaĂ­ra Canal <[email protected]>
Reviewed-by: Iago Toral Quiroga <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agodrm/v3d: Detach job submissions IOCTLs to a new specific file
Melissa Wen [Thu, 30 Nov 2023 16:40:26 +0000 (13:40 -0300)]
drm/v3d: Detach job submissions IOCTLs to a new specific file

We will include a new job submission type, the CPU job submission. For
readability and maintability, separate the job submission IOCTLs and
related operations from v3d_gem.c.

Minor fix in the CSD submission kernel doc:
CSD (texture formatting) -> CSD (compute shader).

Signed-off-by: Melissa Wen <[email protected]>
Signed-off-by: MaĂ­ra Canal <[email protected]>
Reviewed-by: Iago Toral Quiroga <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agodrm/v3d: Move wait BO ioctl to the v3d_bo file
Melissa Wen [Thu, 30 Nov 2023 16:40:25 +0000 (13:40 -0300)]
drm/v3d: Move wait BO ioctl to the v3d_bo file

IOCTLs related to BO operations reside on the file v3d_bo.c. The wait BO
ioctl is the only IOCTL regarding BOs that is placed in a different file.
So, move it to the v3d_bo.c file.

Signed-off-by: Melissa Wen <[email protected]>
Signed-off-by: MaĂ­ra Canal <[email protected]>
Reviewed-by: Iago Toral Quiroga <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agodrm/v3d: Remove unused function header
Melissa Wen [Thu, 30 Nov 2023 16:40:24 +0000 (13:40 -0300)]
drm/v3d: Remove unused function header

v3d_mmu_get_offset header was added but the function was never defined.
Just remove it.

Signed-off-by: Melissa Wen <[email protected]>
Signed-off-by: MaĂ­ra Canal <[email protected]>
Reviewed-by: Iago Toral Quiroga <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agodrm/tidss: Use DRM_PLANE_COMMIT_ACTIVE_ONLY
Tomi Valkeinen [Thu, 9 Nov 2023 07:38:04 +0000 (09:38 +0200)]
drm/tidss: Use DRM_PLANE_COMMIT_ACTIVE_ONLY

At the moment the driver does not use DRM_PLANE_COMMIT_ACTIVE_ONLY, but
still checks for crtc->state->active in tidss_crtc_atomic_flush(), and
skips the flush if the crtc is not active.

The exact reason why DRM_PLANE_COMMIT_ACTIVE_ONLY is not used has been
lost in history. DRM_PLANE_COMMIT_ACTIVE_ONLY does also affect the plane
updates, and I think the issue was related to multi-display systems and
moving planes between the displays. However, it is possible the issue
was only present on the older DSS hardware, handled by the omapdrm
driver (on which the tidss driver is loosely based).

Reviewing the code related to DRM_PLANE_COMMIT_ACTIVE_ONLY does not show
any issues, and testing on J7 EVM with two displays works fine.

Change the driver to use DRM_PLANE_COMMIT_ACTIVE_ONLY.

Reviewed-by: Aradhya Bhatia <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Tomi Valkeinen <[email protected]>
15 months agodrm/tidss: Fix atomic_flush check
Tomi Valkeinen [Thu, 9 Nov 2023 07:38:03 +0000 (09:38 +0200)]
drm/tidss: Fix atomic_flush check

tidss_crtc_atomic_flush() checks if the crtc is enabled, and if not,
returns immediately as there's no reason to do any register changes.

However, the code checks for 'crtc->state->enable', which does not
reflect the actual HW state. We should instead look at the
'crtc->state->active' flag.

This causes the tidss_crtc_atomic_flush() to proceed with the flush even
if the active state is false, which then causes us to hit the
WARN_ON(!crtc->state->event) check.

Fix this by checking the active flag, and while at it, fix the related
debug print which had "active" and "needs modeset" wrong way.

Cc: <[email protected]>
Fixes: 32a1795f57ee ("drm/tidss: New driver for TI Keystone platform Display SubSystem")
Reviewed-by: Aradhya Bhatia <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Tomi Valkeinen <[email protected]>
15 months agodrm/tidss: IRQ code cleanup
Tomi Valkeinen [Thu, 9 Nov 2023 07:38:02 +0000 (09:38 +0200)]
drm/tidss: IRQ code cleanup

The IRQ setup code is overly complex. All we really need to do is
initialize the related fields in struct tidss_device, and request the
IRQ.

We can drop all the HW accesses, as they are pointless: the driver will
set the IRQs correctly when it needs any of the IRQs, and at probe time
we have done a reset, so we know that all the IRQs are masked by default
in the hardware.

Thus we can combine the tidss_irq_preinstall() and
tidss_irq_postinstall() into the tidss_irq_install() function, drop the
HW accesses, and drop the use of spinlock, as this is done at init time
and there can be no races.

We can also drop the HW access from the tidss_irq_uninstall(), as the
driver will anyway disable and suspend the hardware at remove time.

Reviewed-by: Aradhya Bhatia <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Tomi Valkeinen <[email protected]>
15 months agodrm/tidss: Fix dss reset
Tomi Valkeinen [Thu, 9 Nov 2023 07:38:01 +0000 (09:38 +0200)]
drm/tidss: Fix dss reset

The probe function calls dispc_softreset() before runtime PM is enabled
and without enabling any of the DSS clocks. This happens to work by
luck, and we need to make sure the DSS HW is active and the fclk is
enabled.

To fix the above, add a new function, dispc_init_hw(), which does:

- pm_runtime_set_active()
- clk_prepare_enable(fclk)
- dispc_softreset().

This ensures that the reset can be successfully accomplished.

Note that we use pm_runtime_set_active(), not the normal
pm_runtime_get(). The reason for this is that at this point we haven't
enabled the runtime PM yet and also we don't want the normal resume
callback to be called: the dispc resume callback does some initial HW
setup, and it expects that the HW was off (no video ports are
streaming). If the bootloader has enabled the DSS and has set up a
boot time splash-screen, the DSS would be enabled and streaming which
might lead to issues with the normal resume callback.

Fixes: c9b2d923befd ("drm/tidss: Soft Reset DISPC on startup")
Reviewed-by: Aradhya Bhatia <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Tomi Valkeinen <[email protected]>
15 months agodrm/tidss: Add simple K2G manual reset
Tomi Valkeinen [Thu, 9 Nov 2023 07:38:00 +0000 (09:38 +0200)]
drm/tidss: Add simple K2G manual reset

K2G display controller does not support soft reset, but we can do the
most important steps manually: mask the IRQs and disable the VPs.

Reviewed-by: Aradhya Bhatia <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Tomi Valkeinen <[email protected]>
15 months agodrm/tidss: Check for K2G in in dispc_softreset()
Tomi Valkeinen [Thu, 9 Nov 2023 07:37:59 +0000 (09:37 +0200)]
drm/tidss: Check for K2G in in dispc_softreset()

K2G doesn't have softreset feature. Instead of having every caller of
dispc_softreset() check for K2G, move the check into dispc_softreset(),
and make dispc_softreset() return 0 in case of K2G.

Reviewed-by: Laurent Pinchart <[email protected]>
Reviewed-by: Aradhya Bhatia <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Tomi Valkeinen <[email protected]>
15 months agodrm/tidss: Return error value from from softreset
Tomi Valkeinen [Thu, 9 Nov 2023 07:37:58 +0000 (09:37 +0200)]
drm/tidss: Return error value from from softreset

Return an error value from dispc_softreset() so that the caller can
handle the errors.

Reviewed-by: Aradhya Bhatia <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Tomi Valkeinen <[email protected]>
15 months agodrm/tidss: Move reset to the end of dispc_init()
Tomi Valkeinen [Thu, 9 Nov 2023 07:37:57 +0000 (09:37 +0200)]
drm/tidss: Move reset to the end of dispc_init()

We do a DSS reset in the middle of the dispc_init(). While that happens
to work now, we should really make sure that e..g the fclk, which is
acquired only later in the function, is enabled when doing a reset. This
will be handled in a later patch, but for now, let's move the
dispc_softreset() call to the end of dispc_init(), which is a sensible
place for it anyway.

Reviewed-by: Laurent Pinchart <[email protected]>
Reviewed-by: Aradhya Bhatia <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Tomi Valkeinen <[email protected]>
15 months agodrm/tidss: Drop useless variable init
Tomi Valkeinen [Thu, 9 Nov 2023 07:37:56 +0000 (09:37 +0200)]
drm/tidss: Drop useless variable init

No need to initialize the ret to 0 in dispc_softreset().

Reviewed-by: Laurent Pinchart <[email protected]>
Reviewed-by: Aradhya Bhatia <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Tomi Valkeinen <[email protected]>
15 months agodrm/tidss: Use PM autosuspend
Tomi Valkeinen [Thu, 9 Nov 2023 07:37:55 +0000 (09:37 +0200)]
drm/tidss: Use PM autosuspend

Use runtime PM autosuspend feature, with 1s timeout, to avoid
unnecessary suspend-resume cycles when, e.g. the userspace temporarily
turns off the crtcs when configuring the outputs.

Reviewed-by: Aradhya Bhatia <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Tomi Valkeinen <[email protected]>
15 months agodrm/tidss: Use pm_runtime_resume_and_get()
Tomi Valkeinen [Thu, 9 Nov 2023 07:37:54 +0000 (09:37 +0200)]
drm/tidss: Use pm_runtime_resume_and_get()

Use pm_runtime_resume_and_get() instead of pm_runtime_get_sync(), which
will handle error situations better. Also fix the return, as there
should be no reason for the current complex return.

Reviewed-by: Laurent Pinchart <[email protected]>
Reviewed-by: Aradhya Bhatia <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Tomi Valkeinen <[email protected]>
15 months agodrm/tidss: Add support for AM62A7 DSS
Aradhya Bhatia [Wed, 8 Nov 2023 17:16:19 +0000 (22:46 +0530)]
drm/tidss: Add support for AM62A7 DSS

Add support for the DSS controller on TI's AM62A7 SoC in the tidss
driver.

This controller has 2 video pipelines that can render 2 video planes on
over a screen, using the overlay managers. The output of the DSS comes
from video port 2 (VP2) in the form of RGB88 DPI signals, while the VP1
is tied off inside the SoC.

Also add and use a new type of VP, DISPC_VP_TIED_OFF, for the tied-off
VP1 of AM62A DSS.

Signed-off-by: Aradhya Bhatia <[email protected]>
Reviewed-by: Tomi Valkeinen <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Tomi Valkeinen <[email protected]>
15 months agodt-bindings: display: ti: Add support for am62a7 dss
Aradhya Bhatia [Wed, 8 Nov 2023 17:16:18 +0000 (22:46 +0530)]
dt-bindings: display: ti: Add support for am62a7 dss

The DSS controller on TI's AM62A7 SoC is an update from that on TI's
AM625 SoC. Like the DSS in AM625, the DSS in this SoC has 2 video
pipelines, but unlike the former, the latter only has one output port on
VP2 to service DPI display sinks.

Add the new controller's compatible.

Signed-off-by: Aradhya Bhatia <[email protected]>
Reviewed-by: Krzysztof Kozlowski <[email protected]>
Reviewed-by: Tomi Valkeinen <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Tomi Valkeinen <[email protected]>
15 months agodrm/omapdrm: Improve check for contiguous buffers
Andrew Davis [Mon, 13 Nov 2023 20:55:01 +0000 (14:55 -0600)]
drm/omapdrm: Improve check for contiguous buffers

While a scatter-gather table having only 1 entry does imply it is
contiguous, it is a logic error to assume the inverse. Tables can have
more than 1 entry and still be contiguous. Use a proper check here.

Signed-off-by: Andrew Davis <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agodma-buf: Correct the documentation of name and exp_name symbols
Ramesh Errabolu [Wed, 22 Nov 2023 16:05:56 +0000 (10:05 -0600)]
dma-buf: Correct the documentation of name and exp_name symbols

Fix the documentation of struct dma_buf members name and exp_name
as to how these members are to be used and accessed.

Signed-off-by: Ramesh Errabolu <[email protected]>
Reviewed-by: Christian König <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Christian König <[email protected]>
15 months agodrm/imagination: fix off by one in pvr_vm_mips_init() error handling
Dan Carpenter [Thu, 30 Nov 2023 07:27:15 +0000 (10:27 +0300)]
drm/imagination: fix off by one in pvr_vm_mips_init() error handling

If the call to vmap() fails the "page_nr" is one element beyond the end
of the mips_data->pt_dma_addr[] and mips_data->pt_pages[] arrays.

The way that this is traditionally written is that we clean up the
partial loop iteration before the goto and then we can say
while (--i >= 0).  At that point we know that all the elements thus
far are initialized so we don't need to have NULL checks.

Fixes: 927f3e0253c1 ("drm/imagination: Implement MIPS firmware processor and MMU support")
Signed-off-by: Dan Carpenter <[email protected]>
Reviewed-by: Frank Binns <[email protected]>
Signed-off-by: Maxime Ripard <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agodrm/imagination: Fix IS_ERR() vs NULL bug in pvr_request_firmware()
Dan Carpenter [Thu, 30 Nov 2023 07:27:01 +0000 (10:27 +0300)]
drm/imagination: Fix IS_ERR() vs NULL bug in pvr_request_firmware()

The pvr_build_firmware_filename() function returns NULL on error.  It
doesn't return error pointers.

Fixes: f99f5f3ea7ef ("drm/imagination: Add GPU ID parsing and firmware loading")
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Maxime Ripard <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agodrm/imagination: Fix error codes in pvr_device_clk_init()
Dan Carpenter [Thu, 30 Nov 2023 07:26:29 +0000 (10:26 +0300)]
drm/imagination: Fix error codes in pvr_device_clk_init()

There is a cut and paste error so this code returns the wrong variable.

Fixes: 1f88f017e649 ("drm/imagination: Get GPU resources")
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Maxime Ripard <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agodrm/nouveau: Removes unnecessary args check in nouveau_uvmm_sm_prepare
Yuran Pereira [Thu, 16 Nov 2023 20:52:00 +0000 (02:22 +0530)]
drm/nouveau: Removes unnecessary args check in nouveau_uvmm_sm_prepare

Checking `args` after calling `op_map_prepare` is unnecessary since
if `op_map_prepare` was to be called with  NULL args, it would lead
to a NULL pointer dereference, thus never hitting that check.

Hence remove the check and add a note to remind users of this function
to ensure that args != NULL when calling this function for a map
operation as it was suggested by Danilo [1].

[1] https://lore.kernel.org/lkml/6a1ebcef-bade-45a0-9bd9-c05f0226eb88@redhat.com

Suggested-by: Danilo Krummrich <[email protected]>
Signed-off-by: Yuran Pereira <[email protected]>
Signed-off-by: Danilo Krummrich <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/GV1PR10MB65637F4BAABFE2D8E261E1DCE8B0A@GV1PR10MB6563.EURPRD10.PROD.OUTLOOK.COM
15 months agoDocumentation/gpu: VM_BIND locking document
Thomas Hellström [Wed, 29 Nov 2023 09:06:37 +0000 (10:06 +0100)]
Documentation/gpu: VM_BIND locking document

Add the first version of the VM_BIND locking document which is
intended to be part of the xe driver upstreaming agreement.

The document describes and discuss the locking used during exec-
functions, evicton and for userptr gpu-vmas. Intention is to be using the
same nomenclature as the drm-vm-bind-async.rst.

v2:
- s/gvm/gpu_vm/g (Rodrigo Vivi)
- Clarify the userptr seqlock with a pointer to mm/mmu_notifier.c
  (Rodrigo Vivi)
- Adjust commit message accordingly.
- Add SPDX license header.

v3:
- Large update to align with the drm_gpuvm manager locking
- Add "Efficient userptr gpu_vma exec function iteration" section
- Add "Locking at bind- and unbind time" section.

v4:
- Fix tabs vs space errors by untabifying (Rodrigo Vivi)
- Minor style fixes and typos (Rodrigo Vivi)
- Clarify situations where stale GPU mappings are occurring and how
  access through these mappings are blocked. (Rodrigo Vivi)
- Insert into the toctree in implementation_guidelines.rst

v5:
- Add a section about recoverable page-faults.
- Use local references to other documentation where possible
  (Bagas Sanjaya)
- General documentation fixes and typos (Danilo Krummrich and
  Boris Brezillon)
- Improve the documentation around locks that need to be grabbed from the
  dm-fence critical section (Boris Brezillon)
- Add more references to the DRM GPUVM helpers (Danilo Krummrich and
  Boriz Brezillon)
- Update the rfc/xe.rst document.

v6:
- Rework wording to improve readability (Boris Brezillon, Rodrigo Vivi,
  Bagas Sanjaya)
- Various minor fixes across the document (Boris Brezillon)

Cc: Rodrigo Vivi <[email protected]>
Signed-off-by: Thomas Hellström <[email protected]>
Reviewed-by: Boris Brezillon <[email protected]>
Reviewed-by: Rodrigo Vivi <[email protected]>
Reviewed-by: Danilo Krummrich <[email protected]>
Acked-by: John Hubbard <[email protected]> # Documentation/core-api/pin_user_pages.rst changes
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agofbdev: Remove default file-I/O implementations
Thomas Zimmermann [Mon, 27 Nov 2023 13:16:01 +0000 (14:16 +0100)]
fbdev: Remove default file-I/O implementations

Drop the default implementations for file read, write and mmap
operations. Each fbdev driver must now provide an implementation
and select any necessary helpers. If no implementation has been
set, fbdev returns an errno code to user space. The code is the
same as if the operation had not been set in the file_operations
struct.

This change makes the fbdev helpers for I/O memory optional. Most
systems only use system-memory framebuffers via DRM's fbdev emulation.

v2:
* warn once if I/O callbacks are missing (Javier)

Signed-off-by: Thomas Zimmermann <[email protected]>
Reviewed-by: Javier Martinez Canillas <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agofbdev: Warn on incorrect framebuffer access
Thomas Zimmermann [Mon, 27 Nov 2023 13:16:00 +0000 (14:16 +0100)]
fbdev: Warn on incorrect framebuffer access

Test in framebuffer read, write and drawing helpers if FBINFO_VIRTFB
has been set correctly. Framebuffers in I/O memory should only be
accessed with the architecture's respective helpers. Framebuffers
in system memory should be accessed with the regular load and
store operations. Presumably not all drivers get this right, so we
now warn about it.

Signed-off-by: Thomas Zimmermann <[email protected]>
Reviewed-by: Javier Martinez Canillas <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agofbdev: Move default fb_mmap code into helper function
Thomas Zimmermann [Mon, 27 Nov 2023 13:15:59 +0000 (14:15 +0100)]
fbdev: Move default fb_mmap code into helper function

Move the default fb_mmap code for I/O address spaces into the helper
function fb_io_mmap(). The helper can either be called via struct
fb_ops.fb_mmap or as the default if no fb_mmap has been set. Also
set the new helper in __FB_DEFAULT_IOMEM_OPS_MMAP.

In the mid-term, fb_io_mmap() is supposed to become optional. Fbdev
drivers will initialize their struct fb_ops.fb_mmap to the helper
and select a corresponding Kconfig token. The helper can then be made
optional at compile time.

Signed-off-by: Thomas Zimmermann <[email protected]>
Reviewed-by: Javier Martinez Canillas <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agofbdev: Push pgprot_decrypted() into mmap implementations
Thomas Zimmermann [Mon, 27 Nov 2023 13:15:58 +0000 (14:15 +0100)]
fbdev: Push pgprot_decrypted() into mmap implementations

If a driver sets struct fb_ops.fb_mmap, the fbdev core automatically
calls pgprot_decrypted(). But the default fb_mmap code doesn't handle
pgprot_decrypted().

Move the call to pgprot_decrypted() into each drivers' fb_mmap function.
This only concerns fb_mmap functions for system and DMA memory. For
I/O memory, which is the default case, nothing changes. The fb_mmap
for I/O-memory can later be moved into a helper as well.

DRM's fbdev emulation handles pgprot_decrypted() internally via the
Prime helpers. Fbdev doesn't have to do anything in this case. In
cases where DRM uses deferred I/O, this patch updates fb_mmap correctly.

Signed-off-by: Thomas Zimmermann <[email protected]>
Reviewed-by: Javier Martinez Canillas <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agofbdev: Remove trailing whitespaces
Thomas Zimmermann [Mon, 27 Nov 2023 13:15:57 +0000 (14:15 +0100)]
fbdev: Remove trailing whitespaces

Fix coding style. No functional changes.

Signed-off-by: Thomas Zimmermann <[email protected]>
Reviewed-by: Javier Martinez Canillas <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agofbdev: Rename FB_SYS_FOPS token to FB_SYSMEM_FOPS
Thomas Zimmermann [Mon, 27 Nov 2023 13:15:56 +0000 (14:15 +0100)]
fbdev: Rename FB_SYS_FOPS token to FB_SYSMEM_FOPS

Rename the token to harmonize naming among various helpers. For
example, I/O-memory helpers use FB_IOMEM_FOPS.

Signed-off-by: Thomas Zimmermann <[email protected]>
Reviewed-by: Javier Martinez Canillas <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agostaging/sm750fb: Initialize fb_ops with fbdev macros
Thomas Zimmermann [Mon, 27 Nov 2023 13:15:55 +0000 (14:15 +0100)]
staging/sm750fb: Initialize fb_ops with fbdev macros

Initialize all instances of struct fb_ops with fbdev initializer
macros for framebuffers in I/O address space. Set the read/write,
draw and mmap callbacks to the correct implementation and avoid
implicit defaults. Also select the necessary helpers in Kconfig.

Fbdev drivers sometimes rely on the callbacks being NULL for a
default I/O-memory-based implementation to be invoked; hence
requiring the I/O helpers to be built in any case. Setting all
callbacks in all drivers explicitly will allow to make the I/O
helpers optional. This benefits systems that do not use these
functions.

Signed-off-by: Thomas Zimmermann <[email protected]>
Cc: Sudip Mukherjee <[email protected]>
Cc: Teddy Wang <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: [email protected]
Reviewed-by: Javier Martinez Canillas <[email protected]>
Acked-by: Greg Kroah-Hartman <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agostaging/sm750fb: Declare fb_ops as constant
Thomas Zimmermann [Mon, 27 Nov 2023 13:15:54 +0000 (14:15 +0100)]
staging/sm750fb: Declare fb_ops as constant

Split up lynxfb_ops and declare each as constant. The fb_ops
instance used to be modified while initializing the driver. It is
now constant and the driver picks the correct instance, depending
on the settings for acceleration and cursor support.

Signed-off-by: Thomas Zimmermann <[email protected]>
Cc: Sudip Mukherjee <[email protected]>
Cc: Teddy Wang <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: [email protected]
Acked-by: Javier Martinez Canillas <[email protected]>
Acked-by: Greg Kroah-Hartman <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agofbdev/cyber2000fb: Initialize fb_ops with fbdev macros
Thomas Zimmermann [Mon, 27 Nov 2023 13:15:53 +0000 (14:15 +0100)]
fbdev/cyber2000fb: Initialize fb_ops with fbdev macros

Initialize the instance of struct fb_ops with fbdev initializer
macros for framebuffers in I/O address space. Set the read/write,
draw and mmap callbacks to the correct implementation and avoid
implicit defaults. Also select the necessary helpers in Kconfig.

Fbdev drivers sometimes rely on the callbacks being NULL for a
default I/O-memory-based implementation to be invoked; hence
requiring the I/O helpers to be built in any case. Setting all
callbacks in all drivers explicitly will allow to make the I/O
helpers optional. This benefits systems that do not use these
functions.

Signed-off-by: Thomas Zimmermann <[email protected]>
Cc: Russell King <[email protected]>
Cc: [email protected]
Reviewed-by: Javier Martinez Canillas <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agofbdev/wm8505fb: Initialize fb_ops to fbdev I/O-memory helpers
Thomas Zimmermann [Mon, 27 Nov 2023 13:15:52 +0000 (14:15 +0100)]
fbdev/wm8505fb: Initialize fb_ops to fbdev I/O-memory helpers

Initialize the instance of struct fb_ops with fbdev initializer
macros for framebuffers in DMA-able address space. This explictily
sets the read/write, draw and mmap callbacks to the correct default
implementation. Also select the necessary helpers in Kconfig.

Fbdev drivers sometimes rely on the callbacks being NULL for a
default implementation to be invoked; hence requireing the I/O
helpers to be built in any case. Setting all callbacks in all
drivers explicitly will allow to make the I/O helpers optional.
This benefits systems that do not use these functions.

Set the callbacks via macros. No functional changes.

Signed-off-by: Thomas Zimmermann <[email protected]>
Reviewed-by: Javier Martinez Canillas <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agofbdev/vt8500lcdfb: Initialize fb_ops with fbdev macros
Thomas Zimmermann [Mon, 27 Nov 2023 13:15:51 +0000 (14:15 +0100)]
fbdev/vt8500lcdfb: Initialize fb_ops with fbdev macros

Initialize the instance of struct fb_ops with fbdev initializer
macros for framebuffers in DMA-able virtual address space. Set the
read/write, draw and mmap callbacks to the correct implementation
and avoid implicit defaults. Also select the necessary helpers in
Kconfig.

Fbdev drivers sometimes rely on the callbacks being NULL for a
default I/O-memory-based implementation to be invoked; hence
requiring the I/O helpers to be built in any case. Setting all
callbacks in all drivers explicitly will allow to make the I/O
helpers optional. This benefits systems that do not use these
functions.

Signed-off-by: Thomas Zimmermann <[email protected]>
Reviewed-by: Javier Martinez Canillas <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agofbdev/clps711x-fb: Initialize fb_ops with fbdev macros
Thomas Zimmermann [Mon, 27 Nov 2023 13:15:50 +0000 (14:15 +0100)]
fbdev/clps711x-fb: Initialize fb_ops with fbdev macros

Initialize the instance of struct fb_ops with fbdev initializer
macros for framebuffers in I/O address space. Set the read/write,
draw and mmap callbacks to the correct implementation and avoid
implicit defaults. Also select the necessary helpers in Kconfig.

The driver previously selected drawing ops for system memory
although it operates on I/O memory. Fixed now.

Fbdev drivers sometimes rely on the callbacks being NULL for a
default I/O-memory-based implementation to be invoked; hence
requiring the I/O helpers to be built in any case. Setting all
callbacks in all drivers explicitly will allow to make the I/O
helpers optional. This benefits systems that do not use these
functions.

Signed-off-by: Thomas Zimmermann <[email protected]>
Reviewed-by: Javier Martinez Canillas <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agomedia/ivtvfb: Initialize fb_ops to fbdev I/O-memory helpers
Thomas Zimmermann [Mon, 27 Nov 2023 13:15:49 +0000 (14:15 +0100)]
media/ivtvfb: Initialize fb_ops to fbdev I/O-memory helpers

Initialize the instance of struct fb_ops with fbdev initializer
macros for framebuffers in I/O address space. This explictily sets
the read/write, draw and mmap callbacks to the correct default
implementation.

Fbdev drivers sometimes rely on the callbacks being NULL for a
default implementation to be invoked; hence requireing the I/O
helpers to be built in any case. Setting all callbacks in all
drivers explicitly will allow to make the I/O helpers optional.
This benefits systems that do not use these functions.

Set the callbacks via macros. No functional changes.

Signed-off-by: Thomas Zimmermann <[email protected]>
Cc: Andy Walls <[email protected]>
Cc: Mauro Carvalho Chehab <[email protected]>
Cc: [email protected]
Reviewed-by: Javier Martinez Canillas <[email protected]>
Reviewed-by: Hans Verkuil <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agofbdev/ps3fb: Initialize fb_ops with fbdev macros
Thomas Zimmermann [Mon, 27 Nov 2023 13:15:48 +0000 (14:15 +0100)]
fbdev/ps3fb: Initialize fb_ops with fbdev macros

Initialize the instance of struct fb_ops with fbdev initializer
macros for framebuffers in virtual address space. Set the read/write,
draw and mmap callbacks to the correct implementation and avoid
implicit defaults. Also select the necessary helpers in Kconfig.

Fbdev drivers sometimes rely on the callbacks being NULL for a
default I/O-memory-based implementation to be invoked; hence
requiring the I/O helpers to be built in any case. Setting all
callbacks in all drivers explicitly will allow to make the I/O
helpers optional. This benefits systems that do not use these
functions.

Signed-off-by: Thomas Zimmermann <[email protected]>
Cc: Michael Ellerman <[email protected]>
Cc: Nicholas Piggin <[email protected]>
Cc: Christophe Leroy <[email protected]>
Cc: [email protected]
Reviewed-by: Javier Martinez Canillas <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agofbdev/ps3fb: Set FBINFO_VIRTFB flag
Thomas Zimmermann [Mon, 27 Nov 2023 13:15:47 +0000 (14:15 +0100)]
fbdev/ps3fb: Set FBINFO_VIRTFB flag

The ps3fb driver operates on system memory. Mark the framebuffer
accordingly. Helpers operating on the framebuffer memory will test
for the presence of this flag.

Signed-off-by: Thomas Zimmermann <[email protected]>
Cc: Michael Ellerman <[email protected]>
Cc: Nicholas Piggin <[email protected]>
Cc: Christophe Leroy <[email protected]>
Cc: [email protected]
Reviewed-by: Javier Martinez Canillas <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agofbdev/au1200fb: Initialize fb_ops with fbdev macros
Thomas Zimmermann [Mon, 27 Nov 2023 13:15:46 +0000 (14:15 +0100)]
fbdev/au1200fb: Initialize fb_ops with fbdev macros

Initialize the instance of struct fb_ops with fbdev initializer
macros for framebuffers in DMA-able virtual address space. Set the
read/write, draw and mmap callbacks to the correct implementation
and avoid implicit defaults. Also select the necessary helpers in
Kconfig.

Fbdev drivers sometimes rely on the callbacks being NULL for a
default I/O-memory-based implementation to be invoked; hence
requiring the I/O helpers to be built in any case. Setting all
callbacks in all drivers explicitly will allow to make the I/O
helpers optional. This benefits systems that do not use these
functions.

Signed-off-by: Thomas Zimmermann <[email protected]>
Reviewed-by: Javier Martinez Canillas <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agofbdev/au1200fb: Set FBINFO_VIRTFB flag
Thomas Zimmermann [Mon, 27 Nov 2023 13:15:45 +0000 (14:15 +0100)]
fbdev/au1200fb: Set FBINFO_VIRTFB flag

The au1200fb driver operates on DMA-able system memory. Mark the
framebuffer accordingly. Helpers operating on the framebuffer memory
will test for the presence of this flag.

Signed-off-by: Thomas Zimmermann <[email protected]>
Reviewed-by: Javier Martinez Canillas <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agofbdev/udlfb: Select correct helpers
Thomas Zimmermann [Mon, 27 Nov 2023 13:15:44 +0000 (14:15 +0100)]
fbdev/udlfb: Select correct helpers

The driver uses deferred I/O. Select the correct helpers via
FB_SYSMEM_HELPERS_DEFERRED in the Kconfig file.

Signed-off-by: Thomas Zimmermann <[email protected]>
Reviewed-by: Javier Martinez Canillas <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agofbdev/smscufx: Select correct helpers
Thomas Zimmermann [Mon, 27 Nov 2023 13:15:43 +0000 (14:15 +0100)]
fbdev/smscufx: Select correct helpers

The driver uses deferred I/O. Select the correct helpers via
FB_SYSMEM_HELPERS_DEFERRED in the Kconfig file.

Signed-off-by: Thomas Zimmermann <[email protected]>
Reviewed-by: Javier Martinez Canillas <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agofbdev/sh_mobile_lcdcfb: Initialize fb_ops with fbdev macros
Thomas Zimmermann [Mon, 27 Nov 2023 13:15:42 +0000 (14:15 +0100)]
fbdev/sh_mobile_lcdcfb: Initialize fb_ops with fbdev macros

Initialize the instance of struct fb_ops with fbdev initializer
macros for framebuffers in DMA-able virtual address space. Set the
read/write, draw and mmap callbacks to the correct implementation
and avoid implicit defaults. Also select the necessary helpers in
Kconfig.

The driver uses a mixture of DMA helpers and deferred I/O. That
probably needs fixing by a driver maintainer.

Fbdev drivers sometimes rely on the callbacks being NULL for a
default I/O-memory-based implementation to be invoked; hence
requiring the I/O helpers to be built in any case. Setting all
callbacks in all drivers explicitly will allow to make the I/O
helpers optional. This benefits systems that do not use these
functions.

Signed-off-by: Thomas Zimmermann <[email protected]>
Reviewed-by: Javier Martinez Canillas <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agofbdev/sh_mobile_lcdcfb: Set FBINFO_VIRTFB flag
Thomas Zimmermann [Mon, 27 Nov 2023 13:15:41 +0000 (14:15 +0100)]
fbdev/sh_mobile_lcdcfb: Set FBINFO_VIRTFB flag

The sh_mobile_lcdcfb driver operates on DMA-able system memory. Mark
the framebuffer accordingly. Helpers operating on the framebuffer memory
will test for the presence of this flag.

Signed-off-by: Thomas Zimmermann <[email protected]>
Reviewed-by: Javier Martinez Canillas <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agohid/picolcd_fb: Set FBINFO_VIRTFB flag
Thomas Zimmermann [Mon, 27 Nov 2023 13:15:40 +0000 (14:15 +0100)]
hid/picolcd_fb: Set FBINFO_VIRTFB flag

The picolcd_fb driver operates on system memory. Mark the framebuffer
accordingly. Helpers operating on the framebuffer memory will test
for the presence of this flag.

Signed-off-by: Thomas Zimmermann <[email protected]>
Cc: "Bruno PrĂ©mont" <[email protected]>
Cc: Jiri Kosina <[email protected]>
Cc: Benjamin Tissoires <[email protected]>
Cc: [email protected]
Reviewed-by: Javier Martinez Canillas <[email protected]>
Acked-by: Bruno PrĂ©mont <[email protected]>
Acked-by: Jiri Kosina <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agoauxdisplay/ht16k33: Initialize fb_ops with fbdev macros
Thomas Zimmermann [Mon, 27 Nov 2023 13:15:39 +0000 (14:15 +0100)]
auxdisplay/ht16k33: Initialize fb_ops with fbdev macros

Initialize the instance of struct fb_ops with fbdev initializer
macros for framebuffers in virtual address space. Set the read/write,
draw and mmap callbacks to the correct implementation and avoid
implicit defaults. Also select the necessary helpers in Kconfig.

Fbdev drivers sometimes rely on the callbacks being NULL for a
default I/O-memory-based implementation to be invoked; hence
requiring the I/O helpers to be built in any case. Setting all
callbacks in all drivers explicitly will allow to make the I/O
helpers optional. This benefits systems that do not use these
functions.

Signed-off-by: Thomas Zimmermann <[email protected]>
Cc: Miguel Ojeda <[email protected]>
Cc: Robin van der Gracht <[email protected]>
Reviewed-by: Javier Martinez Canillas <[email protected]>
Acked-by: Miguel Ojeda <[email protected]>
Reviewed-by: Robin van der Gracht <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agoauxdisplay/ht16k33: Set FBINFO_VIRTFB flag
Thomas Zimmermann [Mon, 27 Nov 2023 13:15:38 +0000 (14:15 +0100)]
auxdisplay/ht16k33: Set FBINFO_VIRTFB flag

The ht16k33 driver operates on system memory. Mark the framebuffer
accordingly. Helpers operating on the framebuffer memory will test
for the presence of this flag.

Signed-off-by: Thomas Zimmermann <[email protected]>
Cc: Miguel Ojeda <[email protected]>
Cc: Robin van der Gracht <[email protected]>
Reviewed-by: Javier Martinez Canillas <[email protected]>
Acked-by: Miguel Ojeda <[email protected]>
Acked-by: Robin van der Gracht <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
15 months agoauxdisplay/cfag12864bfb: Initialize fb_ops with fbdev macros
Thomas Zimmermann [Mon, 27 Nov 2023 13:15:37 +0000 (14:15 +0100)]
auxdisplay/cfag12864bfb: Initialize fb_ops with fbdev macros

Initialize the instance of struct fb_ops with fbdev initializer
macros for framebuffers in virtual address space. Set the read/write,
draw and mmap callbacks to the correct implementation and avoid
implicit defaults. Also select the necessary helpers in Kconfig.

Fbdev drivers sometimes rely on the callbacks being NULL for a
default I/O-memory-based implementation to be invoked; hence
requiring the I/O helpers to be built in any case. Setting all
callbacks in all drivers explicitly will allow to make the I/O
helpers optional. This benefits systems that do not use these
functions.

Signed-off-by: Thomas Zimmermann <[email protected]>
Cc: Miguel Ojeda <[email protected]>
Reviewed-by: Javier Martinez Canillas <[email protected]>
Acked-by: Miguel Ojeda <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
This page took 0.118404 seconds and 4 git commands to generate.