linux-2.6-microblaze.git
7 months agodrm/msm/dpu: rework documentation comments
Dmitry Baryshkov [Sat, 2 Nov 2024 08:46:09 +0000 (10:46 +0200)]
drm/msm/dpu: rework documentation comments

Unfortunately the tooling doesn't check documents placed before funciton
prototypes. Such comments frequently become outdated, miss several
params, etc. Move documentation for the functions to be placed before
the actual function body, allowing 'make W=1' to actually check these
comments and report an error.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/622690/
Link: https://lore.kernel.org/r/20241102-dpu-docs-rework-v1-1-d735853fd6db@linaro.org
7 months agodrm/msm/mdss: use register definitions instead of hand-coding them
Dmitry Baryshkov [Sat, 21 Sep 2024 08:17:30 +0000 (11:17 +0300)]
drm/msm/mdss: use register definitions instead of hand-coding them

Move existing register definitions to mdss.xml and use generated defines
for registers access instead of hand-coding everything in the source
file.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/615312/
Link: https://lore.kernel.org/r/20240921-msm-mdss-ubwc-v1-2-411dcf309d05@linaro.org
7 months agodrm/msm: move MDSS registers to separate header file
Dmitry Baryshkov [Sat, 21 Sep 2024 08:17:29 +0000 (11:17 +0300)]
drm/msm: move MDSS registers to separate header file

In preparation of adding more registers, move MDSS-related headers to
the separate top-level file.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/615310/
Link: https://lore.kernel.org/r/20240921-msm-mdss-ubwc-v1-1-411dcf309d05@linaro.org
7 months agodrm/msm/dpu: move rot90 checking to dpu_plane_atomic_check_sspp()
Dmitry Baryshkov [Fri, 25 Oct 2024 00:20:13 +0000 (03:20 +0300)]
drm/msm/dpu: move rot90 checking to dpu_plane_atomic_check_sspp()

Move a call to dpu_plane_check_inline_rotation() to the
dpu_plane_atomic_check_sspp() function, so that the rot90 constraints
are checked for both SSPP blocks. Also move rotation field from struct
dpu_plane_state to struct dpu_sw_pipe_cfg.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/621485/
Link: https://lore.kernel.org/r/20241025-dpu-virtual-wide-v6-6-0310fd519765@linaro.org
7 months agodrm/msm/dpu: split dpu_plane_atomic_check()
Dmitry Baryshkov [Fri, 25 Oct 2024 00:20:12 +0000 (03:20 +0300)]
drm/msm/dpu: split dpu_plane_atomic_check()

Split dpu_plane_atomic_check() function into two pieces:

dpu_plane_atomic_check_nosspp() performing generic checks on the pstate,
without touching the associated SSPP blocks,

and

dpu_plane_atomic_check_sspp(), which takes into account used SSPPs.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/621484/
Link: https://lore.kernel.org/r/20241025-dpu-virtual-wide-v6-5-0310fd519765@linaro.org
7 months agodrm/msm/dpu: move scaling limitations out of the hw_catalog
Dmitry Baryshkov [Fri, 25 Oct 2024 00:20:11 +0000 (03:20 +0300)]
drm/msm/dpu: move scaling limitations out of the hw_catalog

Max upscale / downscale factors are constant between platforms. In
preparation to adding support for virtual planes and allocating SSPP
blocks on demand move max scaling factors out of the HW catalog and
handle them in the dpu_plane directly. If any of the scaling blocks gets
different limitations, this will have to be handled separately, after
the plane refactoring.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/621481/
Link: https://lore.kernel.org/r/20241025-dpu-virtual-wide-v6-4-0310fd519765@linaro.org
7 months agodrm/msm/dpu: drop virt_formats from SSPP subblock configuration
Dmitry Baryshkov [Fri, 25 Oct 2024 00:20:10 +0000 (03:20 +0300)]
drm/msm/dpu: drop virt_formats from SSPP subblock configuration

The virt_formats / virt_num_formats are not used by the current driver
and are not going to be used in future since formats for virtual planes
are handled in a different way, by forbidding unsupported combinations
during atomic_check. Drop those fields now.

Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/621479/
Link: https://lore.kernel.org/r/20241025-dpu-virtual-wide-v6-3-0310fd519765@linaro.org
7 months agodrm/msm/dpu: move pstate->pipe initialization to dpu_plane_atomic_check
Dmitry Baryshkov [Fri, 25 Oct 2024 00:20:09 +0000 (03:20 +0300)]
drm/msm/dpu: move pstate->pipe initialization to dpu_plane_atomic_check

In preparation for virtualized planes support, move pstate->pipe
initialization from dpu_plane_reset() to dpu_plane_atomic_check(). In
case of virtual planes the plane's pipe will not be known up to the
point of atomic_check() callback.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/621477/
Link: https://lore.kernel.org/r/20241025-dpu-virtual-wide-v6-2-0310fd519765@linaro.org
7 months agodrm/msm/dpu: use drm_rect_fp_to_int()
Dmitry Baryshkov [Fri, 25 Oct 2024 00:20:08 +0000 (03:20 +0300)]
drm/msm/dpu: use drm_rect_fp_to_int()

Use the drm_rect_fp_to_int() helper instead of using the hand-written
code.

Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/621476/
Link: https://lore.kernel.org/r/20241025-dpu-virtual-wide-v6-1-0310fd519765@linaro.org
7 months agodrm/msm: drop MAX_BRIDGES define
Dmitry Baryshkov [Thu, 31 Oct 2024 21:44:08 +0000 (23:44 +0200)]
drm/msm: drop MAX_BRIDGES define

The const MAX_BRIDGES is unused after the commit 4d1a1e4686bd ("drm/msm:
remove msm_drm_private::bridges field"), drop it now.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/622537/
Link: https://lore.kernel.org/r/20241031-dpu-move-topology-v1-3-8ffa8122d3b6@linaro.org
7 months agodrm/msm: move MAX_H_TILES_PER_DISPLAY to the DPU driver
Dmitry Baryshkov [Thu, 31 Oct 2024 21:44:07 +0000 (23:44 +0200)]
drm/msm: move MAX_H_TILES_PER_DISPLAY to the DPU driver

The MAX_H_TILES_PER_DISPLAY const is only used by the DPU driver, move
it to the corresponding header.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/622536/
Link: https://lore.kernel.org/r/20241031-dpu-move-topology-v1-2-8ffa8122d3b6@linaro.org
7 months agodrm/msm: move msm_display_topology to the DPU driver
Dmitry Baryshkov [Thu, 31 Oct 2024 21:44:06 +0000 (23:44 +0200)]
drm/msm: move msm_display_topology to the DPU driver

The struct msm_display_topology is only used by the DPU driver. Remove
it from the global header and move it to DPU-specific header.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/622534/
Link: https://lore.kernel.org/r/20241031-dpu-move-topology-v1-1-8ffa8122d3b6@linaro.org
7 months agodrm/msm/dpu: cast crtc_clk calculation to u64 in _dpu_core_perf_calc_clk()
Zichen Xie [Tue, 29 Oct 2024 19:42:10 +0000 (14:42 -0500)]
drm/msm/dpu: cast crtc_clk calculation to u64 in _dpu_core_perf_calc_clk()

There may be a potential integer overflow issue in
_dpu_core_perf_calc_clk(). crtc_clk is defined as u64, while
mode->vtotal, mode->hdisplay, and drm_mode_vrefresh(mode) are defined as
a smaller data type. The result of the calculation will be limited to
"int" in this case without correct casting. In screen with high
resolution and high refresh rate, integer overflow may happen.
So, we recommend adding an extra cast to prevent potential
integer overflow.

Fixes: c33b7c0389e1 ("drm/msm/dpu: add support for clk and bw scaling for display")
Signed-off-by: Zichen Xie <zichenxie0106@gmail.com>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/622206/
Link: https://lore.kernel.org/r/20241029194209.23684-1-zichenxie0106@gmail.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
7 months agodrm/msm/dp: tidy up platform data names
Dmitry Baryshkov [Tue, 29 Oct 2024 20:28:26 +0000 (22:28 +0200)]
drm/msm/dp: tidy up platform data names

Follow the established symbol name pattern and rename platform data
structures.

Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/622213/
Link: https://lore.kernel.org/r/20241029-msm-dp-rename-v2-3-13c5c03fad44@linaro.org
7 months agodrm/msm/dp: rename edp_ bridge functions and struct
Dmitry Baryshkov [Tue, 29 Oct 2024 20:28:25 +0000 (22:28 +0200)]
drm/msm/dp: rename edp_ bridge functions and struct

Follow the estalished prefix and rename eDP bridge symbols to use
msm_edp_ prefix, moving the edp to the end of the symbol name.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/622210/
Link: https://lore.kernel.org/r/20241029-msm-dp-rename-v2-2-13c5c03fad44@linaro.org
7 months agodrm/msm/dp: prefix all symbols with msm_dp_
Dmitry Baryshkov [Tue, 29 Oct 2024 20:28:24 +0000 (22:28 +0200)]
drm/msm/dp: prefix all symbols with msm_dp_

For historical reasons a lot of symbols in the MSM DisplayPort driver
used the generic dp_ prefix. Perform a mass-rename of those symbols to
use msm_dp prefix.

Basically this is a result of the following script:

sed drivers/gpu/drm/msm/dp/* -i -e 's/\<dp_/msm_dp_/g'
sed drivers/gpu/drm/msm/dp/* -i -e 's/"msm_dp_/"dp_/g'
sed drivers/gpu/drm/msm/dp/* -i -e 's/msm_\(dp_sdp_header\|dp_sdp\)\>/\1/g'

Yes, this also results in renaming of several struct fields in addition
to renaming the structs and functions, but I think the simple solution
is better than the more complex one.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202410250305.UHKDhtxy-lkp@intel.com/
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/622211/
Link: https://lore.kernel.org/r/20241029-msm-dp-rename-v2-1-13c5c03fad44@linaro.org
7 months agoMerge remote-tracking branch 'drm-misc/drm-misc-next' into msm-next
Rob Clark [Wed, 30 Oct 2024 16:49:12 +0000 (09:49 -0700)]
Merge remote-tracking branch 'drm-misc/drm-misc-next' into msm-next

Merging to pick up commit 785324db2d7a ("drm/msm/dp: migrate the
ycbcr_420_allowed to drm_bridge").

Signed-off-by: Rob Clark <robdclark@chromium.org>
7 months agoDocumentation/gpu: Fix Panthor documentation build warnings
Adrián Larumbe [Wed, 9 Oct 2024 21:43:30 +0000 (22:43 +0100)]
Documentation/gpu: Fix Panthor documentation build warnings

Fix Panthor documentation build errors uncovered by the makedocs target
when building with extra warnings enabled.

Signed-off-by: Adrián Larumbe <adrian.larumbe@collabora.com>
Fixes: 6a797bdfde77 ("drm/panthor: add sysfs knob for enabling job profiling")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Reviewed-by: Steven Price <steven.price@arm.com>
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241009214346.2308917-1-adrian.larumbe@collabora.com
7 months agodrm/v3d: Drop allocation of object without mountpoint
Matthias Brugger [Tue, 29 Oct 2024 11:24:29 +0000 (12:24 +0100)]
drm/v3d: Drop allocation of object without mountpoint

Function drm_gem_shmem_create_with_mnt() creates an object
without using the mountpoint if gemfs is NULL.

Drop the else branch calling drm_gem_shmem_create().

Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
Signed-off-by: Maíra Canal <mcanal@igalia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241029-v3d-v2-1-c0d3dd328d1b@gmail.com
7 months agodrm: xlnx: zynqmp_dpsub: fix hotplug detection
Steffen Dirkwinkel [Mon, 28 Oct 2024 13:42:17 +0000 (14:42 +0100)]
drm: xlnx: zynqmp_dpsub: fix hotplug detection

drm_kms_helper_poll_init needs to be called after zynqmp_dpsub_kms_init.
zynqmp_dpsub_kms_init creates the connector and without it we don't
enable hotplug detection.

Fixes: eb2d64bfcc17 ("drm: xlnx: zynqmp_dpsub: Report HPD through the bridge")
Cc: stable@vger.kernel.org
Signed-off-by: Steffen Dirkwinkel <s.dirkwinkel@beckhoff.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241028134218.54727-1-lists@steffen.cc
7 months agodrm: xlnx: zynqmp_disp: layer may be null while releasing
Steffen Dirkwinkel [Mon, 28 Oct 2024 13:39:40 +0000 (14:39 +0100)]
drm: xlnx: zynqmp_disp: layer may be null while releasing

layer->info can be null if we have an error on the first layer in
zynqmp_disp_create_layers

Fixes: 1836fd5ed98d ("drm: xlnx: zynqmp_dpsub: Minimize usage of global flag")
Signed-off-by: Steffen Dirkwinkel <s.dirkwinkel@beckhoff.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241028133941.54264-1-lists@steffen.cc
7 months agodrm: zynqmp_dp: Add debugfs interface for compliance testing
Sean Anderson [Fri, 9 Aug 2024 19:36:00 +0000 (15:36 -0400)]
drm: zynqmp_dp: Add debugfs interface for compliance testing

Add a debugfs interface for exercising the various test modes supported
by the DisplayPort controller. This allows performing compliance
testing, or performing signal integrity measurements on a failing link.
At the moment, we do not support sink-driven link quality testing,
although such support would be fairly easy to add.

Additionally, add some debugfs files for ignoring AUX errors and HPD
events, as this can allow testing with equipment that cannot emulate a
DPRX.

Signed-off-by: Sean Anderson <sean.anderson@linux.dev>
[Tomi: fixed a few minor formatting issues]
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240809193600.3360015-9-sean.anderson@linux.dev
7 months agodrm: zynqmp_dp: Take dp->lock in zynqmp_dp_hpd_work_func
Sean Anderson [Fri, 9 Aug 2024 19:35:59 +0000 (15:35 -0400)]
drm: zynqmp_dp: Take dp->lock in zynqmp_dp_hpd_work_func

Add a non-locking version of zynqmp_dp_bridge_detect and use it in
zynqmp_dp_hpd_work_func so we can take the lock explicitly. This will
make it easier to check for hpd_ignore when we add debugfs support.

Signed-off-by: Sean Anderson <sean.anderson@linux.dev>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240809193600.3360015-8-sean.anderson@linux.dev
7 months agodrm: zynqmp_dp: Split off several helper functions
Sean Anderson [Fri, 9 Aug 2024 19:35:58 +0000 (15:35 -0400)]
drm: zynqmp_dp: Split off several helper functions

In preparation for supporting compliance testing, split off several
helper functions. No functional change intended.

Signed-off-by: Sean Anderson <sean.anderson@linux.dev>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240809193600.3360015-7-sean.anderson@linux.dev
7 months agodrm: zynqmp_dp: Use AUX IRQs instead of polling
Sean Anderson [Fri, 9 Aug 2024 19:35:57 +0000 (15:35 -0400)]
drm: zynqmp_dp: Use AUX IRQs instead of polling

Instead of polling the status register for the AUX status, just enable
the IRQs and signal a completion.

Signed-off-by: Sean Anderson <sean.anderson@linux.dev>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240809193600.3360015-6-sean.anderson@linux.dev
7 months agodrm: zynqmp_dp: Convert to a hard IRQ
Sean Anderson [Fri, 9 Aug 2024 19:35:56 +0000 (15:35 -0400)]
drm: zynqmp_dp: Convert to a hard IRQ

Now that all of the sleeping work is done outside of the IRQ, we can
convert it to a hard IRQ. Shared IRQs may be triggered even after
calling disable_irq, so use free_irq instead which removes our callback
altogether.

Signed-off-by: Sean Anderson <sean.anderson@linux.dev>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240809193600.3360015-5-sean.anderson@linux.dev
7 months agodrm: zynqmp_dp: Don't retrain the link in our IRQ
Sean Anderson [Fri, 9 Aug 2024 19:35:55 +0000 (15:35 -0400)]
drm: zynqmp_dp: Don't retrain the link in our IRQ

Retraining the link can take a while, and might involve waiting for
DPCD reads/writes to complete. In preparation for unthreading the IRQ
handler, move this into its own work function.

Signed-off-by: Sean Anderson <sean.anderson@linux.dev>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240809193600.3360015-4-sean.anderson@linux.dev
7 months agodrm: zynqmp_dp: Add locking
Sean Anderson [Fri, 9 Aug 2024 19:35:54 +0000 (15:35 -0400)]
drm: zynqmp_dp: Add locking

Add some locking to prevent the IRQ/workers/bridge API calls from stepping
on each other's toes. This lock protects:

- Non-atomic registers configuring the link. That is, everything but the
  IRQ registers (since these are accessed in an atomic fashion), and the DP
  AUX registers (since these don't affect the link). We also access AUX
  while holding this lock, so it would be very tricky to support.
- Link configuration. This is effectively everything in zynqmp_dp which
  isn't read-only after probe time. So from next_bridge onward.

This lock is designed to protect configuration changes so we don't have to
do anything tricky. Configuration should never be in the hot path, so I'm
not worried about performance.

Signed-off-by: Sean Anderson <sean.anderson@linux.dev>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240809193600.3360015-3-sean.anderson@linux.dev
7 months agodrm: zynqmp_kms: Unplug DRM device before removal
Sean Anderson [Fri, 9 Aug 2024 19:35:53 +0000 (15:35 -0400)]
drm: zynqmp_kms: Unplug DRM device before removal

Prevent userspace accesses to the DRM device from causing
use-after-frees by unplugging the device before we remove it. This
causes any further userspace accesses to result in an error without
further calls into this driver's internals.

Fixes: d76271d22694 ("drm: xlnx: DRM/KMS driver for Xilinx ZynqMP DisplayPort Subsystem")
Closes: https://lore.kernel.org/dri-devel/4d8f4c9b-2efb-4774-9a37-2f257f79b2c9@linux.dev/
Signed-off-by: Sean Anderson <sean.anderson@linux.dev>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240809193600.3360015-2-sean.anderson@linux.dev
7 months agoaccel/ivpu: Move secondary preemption buffer allocation to DMA range
Karol Wachowski [Thu, 17 Oct 2024 14:58:17 +0000 (16:58 +0200)]
accel/ivpu: Move secondary preemption buffer allocation to DMA range

Secondary preemption buffer is accessible by NPU's DMA and can be
allocated with addresses above 4 GB. Move secondary preemption buffer
allocation from SHAVE range which is much smaller (2GB) to DMA range.
This allows to allocate more command queues with corresponding
preemption buffers without running out of address range.

Signed-off-by: Karol Wachowski <karol.wachowski@intel.com>
Reviewed-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241017145817.121590-12-jacek.lawrynowicz@linux.intel.com
7 months agoaccel/ivpu: Increase DMA address range
Karol Wachowski [Thu, 17 Oct 2024 14:58:16 +0000 (16:58 +0200)]
accel/ivpu: Increase DMA address range

Increase DMA address range to:
 * 128 GB on 37xx (due to MMU limitations)
 * 256 GB on other generations
Merge User and DMA ranges on 40xx and above as it is possible
to access whole 256 GBs from both FW and DMA.

Increase User range on 37xx from 255MB to 511MB
to allow loading very large models.

Do not set global_alias_pio_base/size on other generations than 37xx
as it's only used on 37xx anyway.

Signed-off-by: Karol Wachowski <karol.wachowski@intel.com>
Signed-off-by: Andrzej Kacprowski <Andrzej.Kacprowski@intel.com>
Reviewed-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241017145817.121590-11-jacek.lawrynowicz@linux.intel.com
7 months agoaccel/ivpu: Add debug Kconfig option
Maciej Falkowski [Thu, 17 Oct 2024 14:58:15 +0000 (16:58 +0200)]
accel/ivpu: Add debug Kconfig option

Add CONFIG_DRM_ACCEL_IVPU_DEBUG option that:
 - Adds -DDEBUG that enables printk regardless of the kernel config
 - Enables unsafe module params (that are now disabled by default)

Signed-off-by: Maciej Falkowski <maciej.falkowski@linux.intel.com>
Reviewed-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241017145817.121590-10-jacek.lawrynowicz@linux.intel.com
7 months agoaccel/ivpu: Don't allocate preemption buffers when MIP is disabled
Karol Wachowski [Thu, 17 Oct 2024 14:58:14 +0000 (16:58 +0200)]
accel/ivpu: Don't allocate preemption buffers when MIP is disabled

Do not allocate preemption buffers when Mid Inference Preemption (MIP)
is disabled through test mode.

Rename IVPU_TEST_MODE_PREEMPTION_DISABLE to IVPU_TEST_MODE_MIP_DISABLE
to better describe that this test mode only disables MIP - job level
preemption will still occur.

Signed-off-by: Karol Wachowski <karol.wachowski@intel.com>
Reviewed-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241017145817.121590-9-jacek.lawrynowicz@linux.intel.com
7 months agoaccel/ivpu: Make command queue ID allocated on XArray
Karol Wachowski [Thu, 17 Oct 2024 14:58:13 +0000 (16:58 +0200)]
accel/ivpu: Make command queue ID allocated on XArray

Use XArray for dynamic command queue ID allocations instead of fixed
ones. This is required by upcoming changes to UAPI that will allow to
manage command queues by user space instead of having predefined number
of queues in a context.

Signed-off-by: Karol Wachowski <karol.wachowski@intel.com>
Reviewed-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241017145817.121590-8-jacek.lawrynowicz@linux.intel.com
7 months agoaccel/ivpu: Use xa_alloc_cyclic() instead of custom function
Karol Wachowski [Thu, 17 Oct 2024 14:58:12 +0000 (16:58 +0200)]
accel/ivpu: Use xa_alloc_cyclic() instead of custom function

Remove custom ivpu_id_alloc() wrapper used for ID allocations
and replace it with standard xa_alloc_cyclic() API.

The idea behind ivpu_id_alloc() was to have monotonic IDs, so the driver
is easier to debug because same IDs are not reused all over. The same
can be achieved just by using appropriate Linux API.

Signed-off-by: Karol Wachowski <karol.wachowski@intel.com>
Reviewed-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241017145817.121590-7-jacek.lawrynowicz@linux.intel.com
7 months agoaccel/ivpu: Unmap partially mapped BOs in case of errors
Karol Wachowski [Thu, 17 Oct 2024 14:58:11 +0000 (16:58 +0200)]
accel/ivpu: Unmap partially mapped BOs in case of errors

Ensure that all buffers that were created only partially through
allocated scatter-gather table are unmapped from MMU600 in case of errors.

Signed-off-by: Karol Wachowski <karol.wachowski@intel.com>
Reviewed-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241017145817.121590-6-jacek.lawrynowicz@linux.intel.com
7 months agoaccel/ivpu: Clear CDTAB entry in case of failure
Karol Wachowski [Thu, 17 Oct 2024 14:58:10 +0000 (16:58 +0200)]
accel/ivpu: Clear CDTAB entry in case of failure

Don't leave a context descriptor in case CFGI_ALL flush fails.
Mark it as invalid (by clearing valid bit) so nothing is left in
partially-initialized state.

Signed-off-by: Karol Wachowski <karol.wachowski@intel.com>
Reviewed-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241017145817.121590-5-jacek.lawrynowicz@linux.intel.com
7 months agoaccel/ivpu: Remove copy engine support
Andrzej Kacprowski [Thu, 17 Oct 2024 14:58:09 +0000 (16:58 +0200)]
accel/ivpu: Remove copy engine support

Copy engine was deprecated by the FW and is no longer supported.
Compute engine includes all copy engine functionality and should be used
instead.

This change does not affect user space as the copy engine was never
used outside of a couple of tests.

Signed-off-by: Andrzej Kacprowski <Andrzej.Kacprowski@intel.com>
Reviewed-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241017145817.121590-4-jacek.lawrynowicz@linux.intel.com
7 months agoaccel/ivpu: Defer MMU root page table allocation
Karol Wachowski [Thu, 17 Oct 2024 14:58:08 +0000 (16:58 +0200)]
accel/ivpu: Defer MMU root page table allocation

Defer root page table allocation and unify context init/fini functions.
Move allocation of the root page table from the file_priv_open function to
perform a lazy allocation approach during ivpu_bo_pin().

By doing so, we avoid the overhead of allocating page tables for simple
operations like GET_PARAM that do not require them.
Additionally, the MMU context descriptor table initialization has been
moved to the ivpu_mmu_context_map_page function.

This change streamlines the process and ensures that the descriptor table
is only initialized when it is actually needed.
Refactor init/fini functions to remove redundant code and make the context
management more straightforward.

Overall, these changes lead to a reduction in the time taken by the file
descriptor open operation, as the costly root page table allocation is now
avoided for operations that do not require it.

Signed-off-by: Karol Wachowski <karol.wachowski@intel.com>
Reviewed-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241017145817.121590-3-jacek.lawrynowicz@linux.intel.com
7 months agoaccel/ivpu: Do not fail when more than 1 tile is fused
Karol Wachowski [Thu, 17 Oct 2024 14:58:07 +0000 (16:58 +0200)]
accel/ivpu: Do not fail when more than 1 tile is fused

Allow TILE_FUSE register to disable more than 1 tile.
The driver should not prevent such configurations from being functional.

Signed-off-by: Karol Wachowski <karol.wachowski@intel.com>
Reviewed-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241017145817.121590-2-jacek.lawrynowicz@linux.intel.com
7 months agodrm/nouveau/gr/gf100: Fix missing unlock in gf100_gr_chan_new()
Li Huafei [Sat, 26 Oct 2024 17:38:44 +0000 (01:38 +0800)]
drm/nouveau/gr/gf100: Fix missing unlock in gf100_gr_chan_new()

When the call to gf100_grctx_generate() fails, unlock gr->fecs.mutex
before returning the error.

Fixes smatch warning:

drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c:480 gf100_gr_chan_new() warn: inconsistent returns '&gr->fecs.mutex'.

Fixes: ca081fff6ecc ("drm/nouveau/gr/gf100-: generate golden context during first object alloc")
Signed-off-by: Li Huafei <lihuafei1@huawei.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Lyude Paul <lyude@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241026173844.2392679-1-lihuafei1@huawei.com
7 months agodrm/ci: add sm8350-hdk
Vignesh Raman [Tue, 22 Oct 2024 09:45:05 +0000 (15:15 +0530)]
drm/ci: add sm8350-hdk

Add job that executes the IGT test suite for sm8350-hdk.

Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Vignesh Raman <vignesh.raman@collabora.com>
Acked-by: Helen Koike <helen.koike@collabora.com>
Signed-off-by: Helen Koike <helen.koike@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241022094509.85510-3-vignesh.raman@collabora.com
7 months agodrm/ci: add dedede
Vignesh Raman [Tue, 22 Oct 2024 09:45:04 +0000 (15:15 +0530)]
drm/ci: add dedede

Add job that executes the IGT test suite for acer-cb317-1h-c3z6-dedede.
dedede boards use 64 bit Intel Jasper Lake processors.

Signed-off-by: Vignesh Raman <vignesh.raman@collabora.com>
Acked-by: Helen Koike <helen.koike@collabora.com>
Signed-off-by: Helen Koike <helen.koike@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241022094509.85510-2-vignesh.raman@collabora.com
7 months agodrm/msm/a6xx: Fix excessive stack usage
Akhil P Oommen [Sun, 27 Oct 2024 18:05:47 +0000 (23:35 +0530)]
drm/msm/a6xx: Fix excessive stack usage

Clang-19 and above sometimes end up with multiple copies of the large
a6xx_hfi_msg_bw_table structure on the stack. The problem is that
a6xx_hfi_send_bw_table() calls a number of device specific functions to
fill the structure, but these create another copy of the structure on
the stack which gets copied to the first.

If the functions get inlined, that busts the warning limit:

drivers/gpu/drm/msm/adreno/a6xx_hfi.c:631:12: error: stack frame size (1032) exceeds limit (1024) in 'a6xx_hfi_send_bw_table' [-Werror,-Wframe-larger-than]

Fix this by kmalloc-ating struct a6xx_hfi_msg_bw_table instead of using
the stack. Also, use this opportunity to skip re-initializing this table
to optimize gpu wake up latency.

Cc: Arnd Bergmann <arnd@kernel.org>
Signed-off-by: Akhil P Oommen <quic_akhilpo@quicinc.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/621814/
Signed-off-by: Rob Clark <robdclark@chromium.org>
7 months agodrm/bridge: tc358767: Fix use of unadjusted mode in the driver
Marek Vasut [Sat, 26 Oct 2024 04:10:42 +0000 (06:10 +0200)]
drm/bridge: tc358767: Fix use of unadjusted mode in the driver

The driver configures mostly Pixel PLL from the clock cached in
local copy of the mode. Make sure the driver uses adjusted mode
which contains the updated Pixel PLL settings negotiated in
tc_dpi_atomic_check()/tc_edp_atomic_check().

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Robert Foss <rfoss@kernel.org>
Signed-off-by: Robert Foss <rfoss@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20241026041057.247640-1-marex@denx.de
7 months agodrm/omap: Clean up deadcode functions
Dr. David Alan Gilbert [Sat, 26 Oct 2024 22:00:10 +0000 (23:00 +0100)]
drm/omap: Clean up deadcode functions

dispc_enable_fifomerge() last use was removed by 2012's
commit 85099f11bd03 ("Revert "OMAPDSS: APPLY: add fifo merge support
funcs"")

dispc_has_writeback(), dispc_wb_get_framedone_irq(), dispc_wb_go(),
dispc_wb_go_busy() and dispc_wb_setup() were changed from statics
to public symbols and unwired from a structure by 2020's
commit dac62bcafeaa ("drm/omap: remove dispc_ops")
but didn't have any users.

dispc_mgr_get_clock_div() got renamed from dispc_get_clock_div()
and it's last use was removed in 2011 by commit
42c9dee82129 ("OMAP: DSS2: Remove FB_OMAP_BOOTLOADER_INIT support")

Remove them.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241026220010.93773-1-linux@treblig.org
7 months agodrm/msm/gpu: Check the status of registration to PM QoS
Lukasz Luba [Fri, 18 Oct 2024 11:18:11 +0000 (12:18 +0100)]
drm/msm/gpu: Check the status of registration to PM QoS

There is a need to check the returned value of the registration function.
In case of returned error, print that and stop the init process.

Fixes: 7c0ffcd40b16 ("drm/msm/gpu: Respect PM QoS constraints")
Signed-off-by: Lukasz Luba <lukasz.luba@arm.com>
Patchwork: https://patchwork.freedesktop.org/patch/620336/
Signed-off-by: Rob Clark <robdclark@chromium.org>
7 months agodrm/msm/adreno: Use IRQF_NO_AUTOEN flag in request_irq()
Jinjie Ruan [Thu, 12 Sep 2024 08:30:20 +0000 (16:30 +0800)]
drm/msm/adreno: Use IRQF_NO_AUTOEN flag in request_irq()

disable_irq() after request_irq() still has a time gap in which
interrupts can come. request_irq() with IRQF_NO_AUTOEN flag will
disable IRQ auto-enable when request IRQ.

Fixes: 4b565ca5a2cb ("drm/msm: Add A6XX device support")
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Patchwork: https://patchwork.freedesktop.org/patch/614075/
Signed-off-by: Rob Clark <robdclark@chromium.org>
7 months agodrm/msm: Fix some typos in comment
Shen Lichuan [Thu, 12 Sep 2024 07:04:20 +0000 (15:04 +0800)]
drm/msm: Fix some typos in comment

Fixed some spelling errors, the details are as follows:

-in the code comments:
collpase->collapse
firwmare->firmware
everwhere->everywhere

Fixes: 2401a0084614 ("drm/msm: gpu: Add support for the GPMU")
Fixes: 5a903a44a984 ("drm/msm/a6xx: Introduce GMU wrapper support")
Fixes: f97decac5f4c ("drm/msm: Support multiple ringbuffers")
Signed-off-by: Shen Lichuan <shenlichuan@vivo.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/614109/
Signed-off-by: Rob Clark <robdclark@chromium.org>
7 months agodt-bindings: display/msm/gmu: Add Adreno 663 GMU
Puranam V G Tejaswi [Mon, 21 Oct 2024 21:46:04 +0000 (03:16 +0530)]
dt-bindings: display/msm/gmu: Add Adreno 663 GMU

Document Adreno 663 GMU in the dt-binding specification.

Signed-off-by: Puranam V G Tejaswi <quic_pvgtejas@quicinc.com>
Signed-off-by: Akhil P Oommen <quic_akhilpo@quicinc.com>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
Patchwork: https://patchwork.freedesktop.org/patch/620771/
Signed-off-by: Rob Clark <robdclark@chromium.org>
7 months agodrm/msm/a6xx: Add support for A663
Puranam V G Tejaswi [Mon, 21 Oct 2024 21:46:03 +0000 (03:16 +0530)]
drm/msm/a6xx: Add support for A663

Add support for Adreno 663 found on sa8775p based platforms.

Signed-off-by: Puranam V G Tejaswi <quic_pvgtejas@quicinc.com>
Signed-off-by: Akhil P Oommen <quic_akhilpo@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/620768/
Signed-off-by: Rob Clark <robdclark@chromium.org>
7 months agodrm/msm/a6xx: Remove logically deadcode in a6xx_preempt.c
Everest K.C. [Fri, 11 Oct 2024 05:23:14 +0000 (23:23 -0600)]
drm/msm/a6xx: Remove logically deadcode in a6xx_preempt.c

The ternary operator never returns -1 as `ring` will never be NULL.
Thus, the ternary operator is not needed.
Fix this by removing the ternary operation and only including the
value it will return when the `ring` is not NULL.

This was reported by Coverity Scan.
https://scan7.scan.coverity.com/#/project-view/51525/11354?selectedIssue=1600286

Fixes: 35d36dc1692f ("drm/msm/a6xx: Add traces for preemption")
Signed-off-by: Everest K.C. <everestkc@everestkc.com.np>
Patchwork: https://patchwork.freedesktop.org/patch/619349/
Signed-off-by: Rob Clark <robdclark@chromium.org>
7 months agodrm/msm: Simplify NULL checking in msm_disp_state_dump_regs()
Douglas Anderson [Mon, 14 Oct 2024 16:36:10 +0000 (09:36 -0700)]
drm/msm: Simplify NULL checking in msm_disp_state_dump_regs()

The msm_disp_state_dump_regs():

- Doesn't allocate if the caller already allocated. ...but there's one
  caller and it doesn't allocate so we don't need this check.
- Checks for allocation failure over and over even though it could
  just do it once right after the allocation.

Clean this up.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/619660/
Link: https://lore.kernel.org/r/20241014093605.3.I66049c2c17bd82767661f0ecd741b20453da02b2@changeid
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
7 months agoaccel/qaic: Add crashdump to Sahara
Jeffrey Hugo [Mon, 21 Oct 2024 20:03:55 +0000 (14:03 -0600)]
accel/qaic: Add crashdump to Sahara

The Sahara protocol has a crashdump functionality. In the hello
exchange, the device can advertise it has a memory dump available for
the host to collect. Instead of the device making requests of the host,
the host requests data from the device which can be later analyzed.

Implement this functionality and utilize the devcoredump framework for
handing the dump over to userspace.

Similar to how firmware loading in Sahara involves multiple files,
crashdump can consist of multiple files for different parts of the dump.
Structure these into a single buffer that userspace can parse and
extract the original files from.

Reviewed-by: Carl Vanderlip <quic_carlv@quicinc.com>
Signed-off-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Reviewed-by: Bjorn Andersson <bjorn.andersson@oss.qualcomm.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241021200355.544126-1-quic_jhugo@quicinc.com
7 months agodrm/sched: warn about drm_sched_job_init()'s partial init
Philipp Stanner [Wed, 23 Oct 2024 14:15:31 +0000 (16:15 +0200)]
drm/sched: warn about drm_sched_job_init()'s partial init

drm_sched_job_init()'s name suggests that after the function succeeded,
parameter "job" will be fully initialized. This is not the case; some
members are only later set, notably drm_sched_job.sched by
drm_sched_job_arm().

Document that drm_sched_job_init() does not set all struct members.

Document the lifetime of drm_sched_job.sched.

Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Philipp Stanner <pstanner@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241023141530.113370-2-pstanner@redhat.com
7 months agodrm/panfrost: Remove unused id_mask from struct panfrost_model
Steven Price [Fri, 25 Oct 2024 14:00:07 +0000 (15:00 +0100)]
drm/panfrost: Remove unused id_mask from struct panfrost_model

The id_mask field of struct panfrost_model has never been used.

Fixes: f3ba91228e8e ("drm/panfrost: Add initial panfrost driver")
Signed-off-by: Steven Price <steven.price@arm.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241025140008.385081-1-steven.price@arm.com
7 months agodrm/meson: Allow build with COMPILE_TEST=y
Ville Syrjälä [Thu, 3 Oct 2024 11:18:51 +0000 (14:18 +0300)]
drm/meson: Allow build with COMPILE_TEST=y

Allow meson to be built with COMPILE_TEST=y for greater
coverage. Builds fine on x86/x86_64 at least.

Cc: Neil Armstrong <neil.armstrong@linaro.org>
Cc: linux-amlogic@lists.infradead.org
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241003111851.10453-11-ville.syrjala@linux.intel.com
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
7 months agodrm/mediatek: Allow build with COMPILE_TEST=y
Ville Syrjälä [Thu, 3 Oct 2024 11:18:50 +0000 (14:18 +0300)]
drm/mediatek: Allow build with COMPILE_TEST=y

Allow mediatek to be built with COMPILE_TEST=y for greater
coverage. Builds fine on x86/x86_64 at least.

Cc: Chun-Kuang Hu <chunkuang.hu@kernel.org>
Cc: Philipp Zabel <p.zabel@pengutronix.de>
Cc: linux-mediatek@lists.infradead.org
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241003111851.10453-10-ville.syrjala@linux.intel.com
Reviewed-by: CK Hu <ck.hu@mediatek.com>
7 months agodrm/imx/dcss: Allow build with COMPILE_TEST=y
Ville Syrjälä [Thu, 3 Oct 2024 11:18:48 +0000 (14:18 +0300)]
drm/imx/dcss: Allow build with COMPILE_TEST=y

Allow imx/dcss to be built with COMPILE_TEST=y for greater
coverage. Builds fine on x86/x86_64 at least.

Cc: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241003111851.10453-8-ville.syrjala@linux.intel.com
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
7 months agodrm/imx/dcss: Fix 64bit divisions
Ville Syrjälä [Thu, 3 Oct 2024 11:18:47 +0000 (14:18 +0300)]
drm/imx/dcss: Fix 64bit divisions

Use the appropriate 64bit division helpers to make the code
build on 32bit architectures.

Cc: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241003111851.10453-7-ville.syrjala@linux.intel.com
Reviewed-by: Laurentiu Palcu <laurentiu.palcu@oss.nxp.com>
7 months agodrm/bridge: dw-hdmi: set bridge's ycbcr_420_allowed flag
Dmitry Baryshkov [Fri, 18 Oct 2024 21:49:17 +0000 (00:49 +0300)]
drm/bridge: dw-hdmi: set bridge's ycbcr_420_allowed flag

Set the drm_bridge's ycbcr_420_allowed flag if the YCbCr 420 output is
supported by the hardware.

Cc: Alexander Stein <alexander.stein@ew.tq-group.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Maxime Ripard <mripard@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20241019-bridge-yuv420-v1-6-d74efac9e4e6@linaro.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
7 months agodrm/msm/dp: migrate the ycbcr_420_allowed to drm_bridge
Dmitry Baryshkov [Fri, 18 Oct 2024 21:49:16 +0000 (00:49 +0300)]
drm/msm/dp: migrate the ycbcr_420_allowed to drm_bridge

Instead of forcing the ycbcr_420_allowed flag to be set on the created
drm_connector, set it on the drm_bridge instance and allow
drm_bridge_connecgtor to propagate it to the drm_connector.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Acked-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Reviewed-by: Maxime Ripard <mripard@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20241019-bridge-yuv420-v1-5-d74efac9e4e6@linaro.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
7 months agodrm/bridge: aux: allow interlaced and YCbCr 420 output
Dmitry Baryshkov [Fri, 18 Oct 2024 21:49:15 +0000 (00:49 +0300)]
drm/bridge: aux: allow interlaced and YCbCr 420 output

As both aux bridges are merely passthrough bridges, mark them as
supporting interlaced and YCbCr 420 data. Other bridges in the chain
still might limit interlaced and YCbCr 420 data support on the
corresponding connector.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Maxime Ripard <mripard@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20241019-bridge-yuv420-v1-4-d74efac9e4e6@linaro.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
7 months agodrm/bridge: display-connector: allow YCbCr 420 for HDMI and DP
Dmitry Baryshkov [Fri, 18 Oct 2024 21:49:14 +0000 (00:49 +0300)]
drm/bridge: display-connector: allow YCbCr 420 for HDMI and DP

Allow YCbCr 420 output for HDMI and DisplayPort connectors. Other
bridges in the chain still might limit YCbCr 420 support on the
corresponding connector.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Maxime Ripard <mripard@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20241019-bridge-yuv420-v1-3-d74efac9e4e6@linaro.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
7 months agodrm/atomic: add interlaced and ycbcr_420 flags to connector's state dump
Dmitry Baryshkov [Fri, 18 Oct 2024 21:49:13 +0000 (00:49 +0300)]
drm/atomic: add interlaced and ycbcr_420 flags to connector's state dump

Although the interlace_allowed and ycbcr_420_allowed flags are a part of
the struct drm_connector rather than struct drm_connector_state, still
include them into state dump in order to ease debugging of the setup
issues.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Maxime Ripard <mripard@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20241019-bridge-yuv420-v1-2-d74efac9e4e6@linaro.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
7 months agodrm/display: bridge_connector: handle ycbcr_420_allowed
Dmitry Baryshkov [Fri, 18 Oct 2024 21:49:12 +0000 (00:49 +0300)]
drm/display: bridge_connector: handle ycbcr_420_allowed

Follow the interlace_allowed example and calculate drm_connector's
ycbcr_420_allowed flag as AND of all drm_bridge's ycbcr_420_allowed
flags in a chain. This is one of the gaps between several
bridge-specific connector implementations and drm_bridge_connector.

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Maxime Ripard <mripard@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20241019-bridge-yuv420-v1-1-d74efac9e4e6@linaro.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
7 months agodrm/panel: s6e3ha8: add static modifier to supply list
Dzmitry Sankouski [Mon, 21 Oct 2024 13:52:36 +0000 (16:52 +0300)]
drm/panel: s6e3ha8: add static modifier to supply list

Add 'static' modifier to panel supply list.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202410160810.0jaNgxB2-lkp@intel.com/
Fixes: 779679d3c164 ("drm/panel: Add support for S6E3HA8 panel driver")
Signed-off-by: Dzmitry Sankouski <dsankouski@gmail.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20241021-starqltechn_upstream_integration_panel_fix-v1-1-81776e89052a@gmail.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20241021-starqltechn_upstream_integration_panel_fix-v1-1-81776e89052a@gmail.com
7 months agodrm/sched: memset() 'job' in drm_sched_job_init()
Philipp Stanner [Mon, 21 Oct 2024 10:50:28 +0000 (12:50 +0200)]
drm/sched: memset() 'job' in drm_sched_job_init()

drm_sched_job_init() has no control over how users allocate struct
drm_sched_job. Unfortunately, the function can also not set some struct
members such as job->sched.

This could theoretically lead to UB by users dereferencing the struct's
pointer members too early.

It is easier to debug such issues if these pointers are initialized to
NULL, so dereferencing them causes a NULL pointer exception.
Accordingly, drm_sched_entity_init() does precisely that and initializes
its struct with memset().

Initialize parameter "job" to 0 in drm_sched_job_init().

Signed-off-by: Philipp Stanner <pstanner@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241021105028.19794-2-pstanner@redhat.com
Reviewed-by: Christian König <christian.koenig@amd.com>
7 months agodrm/imx: legacy-bridge: add MODULE_DESCRIPTION
Arnd Bergmann [Tue, 15 Oct 2024 07:29:58 +0000 (07:29 +0000)]
drm/imx: legacy-bridge: add MODULE_DESCRIPTION

Every module should have a description, without this we get a
build time warning.

Fixes: cc3e8a216d6b ("drm/imx: add internal bridge handling display-timings DT node")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Robert Foss <rfoss@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20241015073004.4066457-2-arnd@kernel.org
7 months agodrm/imx: parallel-display: add legacy bridge Kconfig dependency
Arnd Bergmann [Tue, 15 Oct 2024 07:29:57 +0000 (07:29 +0000)]
drm/imx: parallel-display: add legacy bridge Kconfig dependency

The driver now uses the legacy bridge helper code but can be configured
to get built without it:

ERROR: modpost: "devm_imx_drm_legacy_bridge" [drivers/gpu/drm/imx/ipuv3/parallel-display.ko] undefined!

Add the required dependency, same as in the ldb driver.

Fixes: f94b9707a1c9 ("drm/imx: parallel-display: switch to imx_legacy_bridge / drm_bridge_connector")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Robert Foss <rfoss@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20241015073004.4066457-1-arnd@kernel.org
7 months agodrm/fbdev: fix drm_fb_helper_deferred_io() build failure
Dmitry Baryshkov [Mon, 21 Oct 2024 13:37:46 +0000 (16:37 +0300)]
drm/fbdev: fix drm_fb_helper_deferred_io() build failure

The drm_fb_helper_deferred_io() uses struct fb_deferred_io_pageref,
which isn't available without CONFIG_FB_DEFERRED_IO. Put the function
under corresponding #ifdef to fix build failure if deferred I/O isn't
enabled.

Fixes: 8058944f5226 ("drm/fbdev: Select fbdev I/O helpers from modules that require them")
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20241021-fix-drm-deferred-v2-1-db1de4c6b042@linaro.org
7 months agodrm/bridge: sii902x: Set input bus format based on bus-width
Wadim Egorov [Thu, 17 Oct 2024 08:55:56 +0000 (10:55 +0200)]
drm/bridge: sii902x: Set input bus format based on bus-width

Introduce a bus-width property to define the number of parallel RGB
input pins connected to the transmitter. The input bus formats are updated
accordingly. If the property is not specified, default to 24-bit bus-width.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20241017085556.3045686-3-w.egorov@phytec.de
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20241017085556.3045686-3-w.egorov@phytec.de
7 months agodt-bindings: display: bridge: sil,sii9022: Add bus-width
Wadim Egorov [Thu, 17 Oct 2024 08:55:55 +0000 (10:55 +0200)]
dt-bindings: display: bridge: sil,sii9022: Add bus-width

The SI9022 HDMI transmitter can be configured with a bus-width of 16,
18, or 24 bits. Introduce a bus-width property to the input endpoint,
specifying the number of parallel RGB input bits connected to the
transmitter.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20241017085556.3045686-2-w.egorov@phytec.de
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20241017085556.3045686-2-w.egorov@phytec.de
7 months agodrm/bridge: ite-it66121: Drop hdmi_avi_infoframe_init() function call
Liu Ying [Thu, 10 Oct 2024 09:26:43 +0000 (17:26 +0800)]
drm/bridge: ite-it66121: Drop hdmi_avi_infoframe_init() function call

drm_hdmi_avi_infoframe_from_display_mode() called from
it66121_bridge_mode_set() already calls hdmi_avi_infoframe_init() to
initialize an HDMI AVI infoframe.  So, drop the redundant
hdmi_avi_infoframe_init() function call from it66121_bridge_mode_set().

Signed-off-by: Liu Ying <victor.liu@nxp.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20241010092643.1048116-1-victor.liu@nxp.com
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20241010092643.1048116-1-victor.liu@nxp.com
7 months agodrm/bridge: tc358768: switch to bus-width
Krzysztof Kozlowski [Thu, 3 Oct 2024 13:39:04 +0000 (15:39 +0200)]
drm/bridge: tc358768: switch to bus-width

"data-lines" property is way too similar to "data-lanes".  It is also
duplicating "bus-width" from video-interfaces.yaml schema.  "data-lines"
was deprecated in the bindings and "bus-width" is preferred, so parse it
instead while keeping things backwards compatible.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20241003133904.69244-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20241003133904.69244-2-krzysztof.kozlowski@linaro.org
7 months agodt-bindings: display: bridge: tc358768: switch to bus-width
Krzysztof Kozlowski [Thu, 3 Oct 2024 13:39:03 +0000 (15:39 +0200)]
dt-bindings: display: bridge: tc358768: switch to bus-width

"data-lines" property is way too similar to "data-lanes".  It is also
duplicating "bus-width" from video-interfaces.yaml schema.  Deprecate
"data-lines" and use the common property.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20241003133904.69244-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20241003133904.69244-1-krzysztof.kozlowski@linaro.org
7 months agodrm/meson: drop unused static dw_hdmi_dwc_write_bits
Krzysztof Kozlowski [Sun, 8 Sep 2024 14:21:31 +0000 (16:21 +0200)]
drm/meson: drop unused static dw_hdmi_dwc_write_bits

static inline dw_hdmi_dwc_write_bits() function is not used at all:

  drivers/gpu/drm/meson/meson_dw_hdmi.c:276:20: error: unused function 'dw_hdmi_dwc_write_bits' [-Werror,-Wunused-function]

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20240908-regmap-config-const-v1-1-28f349004811@linaro.org
[narmstrong: s/staitc/static/]
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240908-regmap-config-const-v1-1-28f349004811@linaro.org
Link: https://patchwork.freedesktop.org/patch/msgid/20240902113320.903147-2-liaochen4@huawei.com
7 months agodrm/msm/dpu: sync mode_config limits to the FB limits in dpu_plane.c
Dmitry Baryshkov [Tue, 3 Sep 2024 03:22:58 +0000 (06:22 +0300)]
drm/msm/dpu: sync mode_config limits to the FB limits in dpu_plane.c

Lift mode_config limits set by the DPU driver to the actual FB limits as
handled by the dpu_plane.c. Move 2*max_lm_width check where it belongs,
to the drm_crtc_helper_funcs::mode_valid() callback.

Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Tested-by: Abhinav Kumar <quic_abhinavk@quicinc.com> # sc7280
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/612259/
Link: https://lore.kernel.org/r/20240903-dpu-mode-config-width-v6-15-617e1ecc4b7a@linaro.org
7 months agodrm/msm/dpu: merge MAX_IMG_WIDTH/HEIGHT with DPU_MAX_IMG_WIDTH/HEIGHT
Dmitry Baryshkov [Tue, 3 Sep 2024 03:22:57 +0000 (06:22 +0300)]
drm/msm/dpu: merge MAX_IMG_WIDTH/HEIGHT with DPU_MAX_IMG_WIDTH/HEIGHT

dpu_formats.c defines DPU_MAX_IMG_WIDTH and _HEIGHT, while
dpu_hw_catalog.h defines just MAX_IMG_WIDTH and _HEIGHT. Merge these
constants to remove duplication.

Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Tested-by: Abhinav Kumar <quic_abhinavk@quicinc.com> # sc7280
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/612255/
Link: https://lore.kernel.org/r/20240903-dpu-mode-config-width-v6-14-617e1ecc4b7a@linaro.org
7 months agodrm/msm/dpu: check for the plane pitch overflow
Dmitry Baryshkov [Tue, 3 Sep 2024 03:22:56 +0000 (06:22 +0300)]
drm/msm/dpu: check for the plane pitch overflow

Check that the plane pitch doesn't overflow the maximum pitch size
allowed by the hardware.

Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Tested-by: Abhinav Kumar <quic_abhinavk@quicinc.com> # sc7280
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/612253/
Link: https://lore.kernel.org/r/20240903-dpu-mode-config-width-v6-13-617e1ecc4b7a@linaro.org
7 months agodrm/msm/dpu: move layout setup population out of dpu_plane_prepare_fb()
Dmitry Baryshkov [Tue, 3 Sep 2024 03:22:55 +0000 (06:22 +0300)]
drm/msm/dpu: move layout setup population out of dpu_plane_prepare_fb()

Move the call to dpu_format_populate_plane_sizes() to the atomic_check
step, so that any issues with the FB layout can be reported as early as
possible.

At the same time move the call to dpu_format_populate_addrs() to
dpu_plane_sspp_atomic_update(). This way the all layout management is
performed only for the visible planes: the .prepare_fb callback is
called for not visible planes too, so keeping dpu_format_populate_addrs
in dpu_plane_prepare_fb() will require dpu_format_populate_plane_sizes()
to be called for !visible planes too.

Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/612251/
Link: https://lore.kernel.org/r/20240903-dpu-mode-config-width-v6-12-617e1ecc4b7a@linaro.org
7 months agodrm/msm/dpu: make dpu_format_populate_addrs return void
Dmitry Baryshkov [Tue, 3 Sep 2024 03:22:54 +0000 (06:22 +0300)]
drm/msm/dpu: make dpu_format_populate_addrs return void

The function msm_framebuffer_iova() can not fail, it always returns a
valid address. Drop the useless checks (that were already performed at
the time) and make dpu_format_populate_addrs() return void.

Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/612247/
Link: https://lore.kernel.org/r/20240903-dpu-mode-config-width-v6-11-617e1ecc4b7a@linaro.org
7 months agodrm/msm/dpu: split dpu_format_populate_layout
Dmitry Baryshkov [Tue, 3 Sep 2024 03:22:53 +0000 (06:22 +0300)]
drm/msm/dpu: split dpu_format_populate_layout

Split dpu_format_populate_layout() into addess-related and
pitch/format-related parts.

Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Tested-by: Abhinav Kumar <quic_abhinavk@quicinc.com> # sc7280
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/612244/
Link: https://lore.kernel.org/r/20240903-dpu-mode-config-width-v6-10-617e1ecc4b7a@linaro.org
7 months agodrm/msm/dpu: move pitch check to _dpu_format_get_plane_sizes_linear()
Dmitry Baryshkov [Tue, 3 Sep 2024 03:22:52 +0000 (06:22 +0300)]
drm/msm/dpu: move pitch check to _dpu_format_get_plane_sizes_linear()

The _dpu_format_get_plane_sizes_linear() already compares pitches of
the framebuffer with the calculated pitches. Move the check to the same
place, demoting DPU_ERROR to DPU_DEBUG to prevent user from spamming the
kernel log.

Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/612245/
Link: https://lore.kernel.org/r/20240903-dpu-mode-config-width-v6-9-617e1ecc4b7a@linaro.org
7 months agodrm/msm/dpu: pass drm_framebuffer to _dpu_format_get_plane_sizes()
Dmitry Baryshkov [Tue, 3 Sep 2024 03:22:51 +0000 (06:22 +0300)]
drm/msm/dpu: pass drm_framebuffer to _dpu_format_get_plane_sizes()

Instead of passing width / height / pitches, pass drm_framebuffer
directly. This allows us to drop the useless check for !pitches, since
an array can not be NULL.

Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/612248/
Link: https://lore.kernel.org/r/20240903-dpu-mode-config-width-v6-8-617e1ecc4b7a@linaro.org
7 months agodrm/msm/dpu: drop msm_format from struct dpu_hw_fmt_layout
Dmitry Baryshkov [Tue, 3 Sep 2024 03:22:50 +0000 (06:22 +0300)]
drm/msm/dpu: drop msm_format from struct dpu_hw_fmt_layout

The struct dpu_hw_fmt_layout defines hardware data layout (addresses,
sizes and pitches. Drop format field from this structure as it's not a
part of the data layout.

Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/612242/
Link: https://lore.kernel.org/r/20240903-dpu-mode-config-width-v6-7-617e1ecc4b7a@linaro.org
7 months agodrm/msm/dpu: drop extra aspace checks in dpu_formats
Dmitry Baryshkov [Tue, 3 Sep 2024 03:22:49 +0000 (06:22 +0300)]
drm/msm/dpu: drop extra aspace checks in dpu_formats

The DPU driver isn't expected to be used without an IOMMU. Thus the
aspace will be always present. Not to mention that mdp4/mdp5 drivers
call msm_framebuffer_iova() without such checks, as the whole
msm_framebuffer layer is expected to support both IOMMU and IOMMU-less
configurations.

Drop these useless if (aspace) checks.

Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/612249/
Link: https://lore.kernel.org/r/20240903-dpu-mode-config-width-v6-6-617e1ecc4b7a@linaro.org
7 months agodrm/msm/dpu: drop dpu_format_populate_layout from dpu_plane_sspp_atomic_update
Dmitry Baryshkov [Tue, 3 Sep 2024 03:22:48 +0000 (06:22 +0300)]
drm/msm/dpu: drop dpu_format_populate_layout from dpu_plane_sspp_atomic_update

The dpu_plane_prepare_fb() already calls dpu_format_populate_layout().
Store the generated layout in the plane state and drop this call from
dpu_plane_sspp_update().

Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Tested-by: Abhinav Kumar <quic_abhinavk@quicinc.com> # sc7280
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/612240/
Link: https://lore.kernel.org/r/20240903-dpu-mode-config-width-v6-5-617e1ecc4b7a@linaro.org
7 months agodrm/msm/dpu: drop dpu_format_check_modified_format
Dmitry Baryshkov [Tue, 3 Sep 2024 03:22:47 +0000 (06:22 +0300)]
drm/msm/dpu: drop dpu_format_check_modified_format

The msm_kms_funcs::check_modified_format() callback is not used by the
driver. Drop it completely.

Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Tested-by: Abhinav Kumar <quic_abhinavk@quicinc.com> # sc7280
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/612239/
Link: https://lore.kernel.org/r/20240903-dpu-mode-config-width-v6-4-617e1ecc4b7a@linaro.org
7 months agodrm/msm/dpu: Add SA8775P support
Mahadevan [Sat, 19 Oct 2024 15:44:56 +0000 (21:14 +0530)]
drm/msm/dpu: Add SA8775P support

Add definitions for the display hardware used on the
Qualcomm SA8775P platform.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Mahadevan <quic_mahap@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/620499/
Link: https://lore.kernel.org/r/20241019-patchv3_1-v5-4-d2fb72c9a845@quicinc.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
7 months agodrm/msm: mdss: Add SA8775P support
Mahadevan [Sat, 19 Oct 2024 15:44:55 +0000 (21:14 +0530)]
drm/msm: mdss: Add SA8775P support

Add Mobile Display Subsystem (MDSS) support for the SA8775P platform.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: Mahadevan <quic_mahap@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/620496/
Link: https://lore.kernel.org/r/20241019-patchv3_1-v5-3-d2fb72c9a845@quicinc.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
7 months agodt-bindings: display/msm: Document the DPU for SA8775P
Mahadevan [Sat, 19 Oct 2024 15:44:54 +0000 (21:14 +0530)]
dt-bindings: display/msm: Document the DPU for SA8775P

Document the DPU for Qualcomm SA8775P platform.

Signed-off-by: Mahadevan <quic_mahap@quicinc.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/620494/
Link: https://lore.kernel.org/r/20241019-patchv3_1-v5-2-d2fb72c9a845@quicinc.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
7 months agodt-bindings: display/msm: Document MDSS on SA8775P
Mahadevan [Sat, 19 Oct 2024 15:44:53 +0000 (21:14 +0530)]
dt-bindings: display/msm: Document MDSS on SA8775P

Document the MDSS hardware found on the Qualcomm SA8775P platform.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Mahadevan <quic_mahap@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/620492/
Link: https://lore.kernel.org/r/20241019-patchv3_1-v5-1-d2fb72c9a845@quicinc.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
7 months agodrm/msm: Use video aperture helpers
Thomas Zimmermann [Mon, 30 Sep 2024 13:03:09 +0000 (15:03 +0200)]
drm/msm: Use video aperture helpers

DRM's aperture functions have long been implemented as helpers
under drivers/video/ for use with fbdev. Avoid the DRM wrappers by
calling the video functions directly.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Rob Clark <robdclark@gmail.com>
Cc: Abhinav Kumar <quic_abhinavk@quicinc.com>
Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: Sean Paul <sean@poorly.run>
Cc: Marijn Suijten <marijn.suijten@somainline.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Acked-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
7 months agodrm/msm/dpu: drop LM_3 / LM_4 on MSM8998
Dmitry Baryshkov [Thu, 5 Sep 2024 03:26:15 +0000 (06:26 +0300)]
drm/msm/dpu: drop LM_3 / LM_4 on MSM8998

On the MSM8998 platform ther are no LM_3 and LM_4 blocks. Drop them from
the MSM8998 catalog.

Fixes: 94391a14fc27 ("drm/msm/dpu1: Add MSM8998 to hw catalog")
Reported-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/612585/
Link: https://lore.kernel.org/r/20240905-dpu-fix-sdm845-catalog-v1-3-3363d03998bd@linaro.org
7 months agodrm/msm/dpu: drop LM_3 / LM_4 on SDM845
Dmitry Baryshkov [Thu, 5 Sep 2024 03:26:14 +0000 (06:26 +0300)]
drm/msm/dpu: drop LM_3 / LM_4 on SDM845

On the SDM845 platform ther are no LM_3 and LM_4 blocks. Drop them from
the SDM845 catalog.

Fixes: 25fdd5933e4c ("drm/msm: Add SDM845 DPU support")
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/612586/
Link: https://lore.kernel.org/r/20240905-dpu-fix-sdm845-catalog-v1-2-3363d03998bd@linaro.org
7 months agodrm/msm/dpu: on SDM845 move DSPP_3 to LM_5 block
Dmitry Baryshkov [Thu, 5 Sep 2024 03:26:13 +0000 (06:26 +0300)]
drm/msm/dpu: on SDM845 move DSPP_3 to LM_5 block

On the SDM845 platform the DSPP_3 is used by the LM_5. Correct
corresponding entries in the sdm845_lm array.

Fixes: c72375172194 ("drm/msm/dpu/catalog: define DSPP blocks found on sdm845")
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/612584/
Link: https://lore.kernel.org/r/20240905-dpu-fix-sdm845-catalog-v1-1-3363d03998bd@linaro.org
7 months agodrm/msm8998: make const arrays ratio_list and band_list static
Colin Ian King [Thu, 12 Sep 2024 15:10:37 +0000 (16:10 +0100)]
drm/msm8998: make const arrays ratio_list and band_list static

Don't populate the const read-only arrays ratio_list and band_list on the
stack at run time, instead make them static.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/614156/
Link: https://lore.kernel.org/r/20240912151037.592477-1-colin.i.king@gmail.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
7 months agodrm/msm: Remove unneeded semicolon
Yang Li [Wed, 18 Sep 2024 02:33:57 +0000 (10:33 +0800)]
drm/msm: Remove unneeded semicolon

./drivers/gpu/drm/msm/hdmi/hdmi_phy_8998.c:282:2-3: Unneeded semicolon

This patch removes an unneeded semicolon after a switch statement in the
pll_get_post_div function. Adding a semicolon after a switch statement is
unnecessary and can lead to confusion in the code structure.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=9852
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/614767/
Link: https://lore.kernel.org/r/20240918023357.59399-1-yang.lee@linux.alibaba.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
7 months agodrm/msm/dpu: Add support for MSM8917
Dmitry Baryshkov [Mon, 30 Sep 2024 18:35:59 +0000 (20:35 +0200)]
drm/msm/dpu: Add support for MSM8917

Add support for MSM8917, which has MDP5 v1.15. It looks like
trimmed down version of MSM8937. Even fewer PP, LM and no DSI1.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
[Remove intr_start from CTLs config, reword the commit]
Signed-off-by: Barnabás Czémán <barnabas.czeman@mainlining.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/617311/
Link: https://lore.kernel.org/r/20240930-dpu-msm8953-msm8996-v2-4-594c3e3190b4@mainlining.org