[PATCH v2 9/9] drm/msm: drop msm_kms_funcs::get_format() callback

2024-04-19 Thread Dmitry Baryshkov
Now as all subdrivers were converted to use common database of formats, drop the get_format() callback and use mdp_get_format() directly. Reviewed-by: Abhinav Kumar Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c | 4 ++--

[PATCH v2 5/9] drm/msm: merge dpu_format and mdp_format in struct msm_format

2024-04-19 Thread Dmitry Baryshkov
Structures dpu_format and mdp_format are largely the same structures. In order to remove duplication between format databases, merge these two stucture definitions into the global struct msm_format. Reviewed-by: Abhinav Kumar Signed-off-by: Dmitry Baryshkov ---

[PATCH v2 8/9] drm/msm: merge dpu format database to MDP formats

2024-04-19 Thread Dmitry Baryshkov
Finally remove duplication between DPU and generic MDP code by merging DPU format lists to the MDP format database. Signed-off-by: Dmitry Baryshkov --- .../gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c | 4 +- .../gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c| 7 +-

[PATCH v2 7/9] drm/msm: convert msm_format::unpack_align_msb to the flag

2024-04-19 Thread Dmitry Baryshkov
Instead of having a u8 or bool field unpack_align_msb, convert it to the flag, this save space in the tables and allows us to handle all booleans in the same way. Reviewed-by: Abhinav Kumar Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c | 12 ++--

[PATCH v2 6/9] drm/msm: convert msm_format::unpack_tight to the flag

2024-04-19 Thread Dmitry Baryshkov
Instead of having a u8 or bool field unpack_tight, convert it to the flag, this save space in the tables and allows us to handle all booleans in the same way. Reviewed-by: Abhinav Kumar Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c | 22

[PATCH v2 4/9] drm/msm/dpu: pull format flag definitions to mdp_format.h

2024-04-19 Thread Dmitry Baryshkov
In preparation to merger of formats databases, pull format flag definitions to mdp_format.h header, so that they are visibile to both dpu and mdp drivers. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c | 98 ++---

[PATCH v2 3/9] drm/msm/dpu: in dpu_format replace bitmap with unsigned long field

2024-04-19 Thread Dmitry Baryshkov
Using bitmap for the flags results in a clumsy syntax on test_bit, replace it with unsigned long type and simple binary ops. Reviewed-by: Abhinav Kumar Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c | 18 +-

[PATCH v2 2/9] drm/msm: add arrays listing formats supported by MDP4/MDP5 hardware

2024-04-19 Thread Dmitry Baryshkov
MDP4 and MDP5 drivers enumerate supported formats each time the plane is created. In preparation to merger of MDP DPU format databases, define precise formats list, so that changes to the database do not cause the driver to add unsupported format to the list. Reviewed-by: Abhinav Kumar

[PATCH v2 1/9] drm/msm/dpu: use format-related definitions from mdp_common.xml.h

2024-04-19 Thread Dmitry Baryshkov
Instead of having DPU-specific defines, switch to the definitions from the mdp_common.xml.h file. This is the preparation for merged of DPU and MDP format tables. Reviewed-by: Abhinav Kumar Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c| 8 +-

[PATCH v2 0/9] drm/msm: fold dpu_format into mdp_formats database

2024-04-19 Thread Dmitry Baryshkov
During the review of [1] Abhinav pointed out that mdp_rgb_formats and mdp_rgb_yuv_formats arrays from patch 1 are directly based on the struct mdp_format formats array. This was true, because MDP4 / MDP5 drivers used their own (small) list of supported formats. The DPU driver, supporting more

Re: [PATCH 9/9] drm/msm/dpu: sync mode_config limits to the FB limits in dpu_plane.c

2024-04-19 Thread Abhinav Kumar
On 4/19/2024 8:06 PM, Dmitry Baryshkov wrote: On Sat, 20 Apr 2024 at 06:05, Abhinav Kumar wrote: On 3/19/2024 6:22 AM, Dmitry Baryshkov wrote: Lift mode_config limits set by the DPU driver to the actual FB limits as handled by the dpu_plane.c. Signed-off-by: Dmitry Baryshkov ---

Re: [PATCH 9/9] drm/msm/dpu: sync mode_config limits to the FB limits in dpu_plane.c

2024-04-19 Thread Dmitry Baryshkov
On Sat, 20 Apr 2024 at 06:05, Abhinav Kumar wrote: > > > > On 3/19/2024 6:22 AM, Dmitry Baryshkov wrote: > > Lift mode_config limits set by the DPU driver to the actual FB limits as > > handled by the dpu_plane.c. > > > > Signed-off-by: Dmitry Baryshkov > > --- > >

Re: [PATCH 9/9] drm/msm/dpu: sync mode_config limits to the FB limits in dpu_plane.c

2024-04-19 Thread Abhinav Kumar
On 3/19/2024 6:22 AM, Dmitry Baryshkov wrote: Lift mode_config limits set by the DPU driver to the actual FB limits as handled by the dpu_plane.c. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-)

Re: [PATCH 8/9] drm/msm/dpu: merge MAX_IMG_WIDTH/HEIGHT with DPU_MAX_IMG_WIDTH/HEIGHT

2024-04-19 Thread Abhinav Kumar
On 3/19/2024 6:22 AM, Dmitry Baryshkov wrote: 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. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c

Re: [PATCH 4/9] drm/msm/dpu: move dpu_format_populate_plane_sizes to atomic_check

2024-04-19 Thread Abhinav Kumar
On 4/19/2024 6:34 PM, Dmitry Baryshkov wrote: On Fri, Apr 19, 2024 at 05:14:01PM -0700, Abhinav Kumar wrote: On 3/19/2024 6:22 AM, Dmitry Baryshkov wrote: Move a call to dpu_format_populate_plane_sizes() to the atomic_check step, so that any issues with the FB layout can be reported as

[PATCH 2/3] drm/msm/mdp4: don't destroy mdp4_kms in mdp4_kms_init error path

2024-04-19 Thread Dmitry Baryshkov
Since commit 3c74682637e6 ("drm/msm/mdp4: move resource allocation to the _probe function") the mdp4_kms data is allocated during probe. It is an error to destroy it during mdp4_kms_init(), as the data is still referenced by the drivers's data and can be used later in case of probe deferral.

[PATCH 1/3] drm/msm: don't clean up priv->kms prematurely

2024-04-19 Thread Dmitry Baryshkov
MSM display drivers provide kms structure allocated during probe(). Don't clean up priv->kms field in case of an error. Otherwise probe functions might fail after KMS probe deferral. Fixes: a2ab5d5bb6b1 ("drm/msm: allow passing struct msm_kms to msm_drv_probe()") Signed-off-by: Dmitry Baryshkov

[PATCH 3/3] drm/msm/mdp4: correct LCDC regulator name

2024-04-19 Thread Dmitry Baryshkov
Correct c error from the conversion of LCDC regulators to the bulk API. Fixes: 54f1fbcb47d4 ("drm/msm/mdp4: use bulk regulators API for LCDC encoder") Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/mdp4/mdp4_lcdc_encoder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[PATCH 0/3] drm/msm/mdp4: fix probe deferral issues

2024-04-19 Thread Dmitry Baryshkov
While testing MDP4 LVDS support I noticed several issues (two are related to probe deferral case and last one is a c error in LCDC part). Fix those issues. Signed-off-by: Dmitry Baryshkov --- Dmitry Baryshkov (3): drm/msm: don't clean up priv->kms prematurely drm/msm/mdp4: don't

Re: [PATCH 1/9] drm/msm/dpu: drop dpu_format_check_modified_format

2024-04-19 Thread Abhinav Kumar
On 4/19/2024 6:26 PM, Dmitry Baryshkov wrote: On Fri, Apr 19, 2024 at 04:43:20PM -0700, Abhinav Kumar wrote: On 3/19/2024 6:21 AM, Dmitry Baryshkov wrote: The msm_kms_funcs::check_modified_format() callback is not used by the driver. Drop it completely. Signed-off-by: Dmitry Baryshkov

Re: [PATCH 5/9] drm/msm/dpu: check for the plane pitch overflow

2024-04-19 Thread Dmitry Baryshkov
On Fri, Apr 19, 2024 at 05:16:30PM -0700, Abhinav Kumar wrote: > > > On 3/19/2024 6:22 AM, Dmitry Baryshkov wrote: > > Check that the plane pitch doesn't overflow the maximum pitch size > > allowed by the hardware. > > > > Signed-off-by: Dmitry Baryshkov > > --- > >

Re: [PATCH 4/9] drm/msm/dpu: move dpu_format_populate_plane_sizes to atomic_check

2024-04-19 Thread Dmitry Baryshkov
On Fri, Apr 19, 2024 at 05:14:01PM -0700, Abhinav Kumar wrote: > > > On 3/19/2024 6:22 AM, Dmitry Baryshkov wrote: > > Move a 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. > > > >

Re: [PATCH 1/9] drm/msm/dpu: drop dpu_format_check_modified_format

2024-04-19 Thread Dmitry Baryshkov
On Fri, Apr 19, 2024 at 04:43:20PM -0700, Abhinav Kumar wrote: > > > On 3/19/2024 6:21 AM, Dmitry Baryshkov wrote: > > The msm_kms_funcs::check_modified_format() callback is not used by the > > driver. Drop it completely. > > > > Signed-off-by: Dmitry Baryshkov > > --- > >

Re: [PATCH 5/9] drm/msm/dpu: check for the plane pitch overflow

2024-04-19 Thread Abhinav Kumar
On 3/19/2024 6:22 AM, Dmitry Baryshkov wrote: Check that the plane pitch doesn't overflow the maximum pitch size allowed by the hardware. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h | 2 ++ drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 6 +- 2

Re: [PATCH 4/9] drm/msm/dpu: move dpu_format_populate_plane_sizes to atomic_check

2024-04-19 Thread Abhinav Kumar
On 3/19/2024 6:22 AM, Dmitry Baryshkov wrote: Move a 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. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 12

Re: [PATCH 3/9] drm/msm/dpu: split dpu_format_populate_layout

2024-04-19 Thread Abhinav Kumar
On 3/19/2024 6:22 AM, Dmitry Baryshkov wrote: Split dpu_format_populate_layout() into addess-related and pitch/format-related parts. Signed-off-by: Dmitry Baryshkov --- .../gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c| 8 +++- drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c| 44

Re: [PATCH 2/9] drm/msm/dpu: drop dpu_format_populate_layout from dpu_plane_sspp_atomic_update

2024-04-19 Thread Abhinav Kumar
On 3/19/2024 6:22 AM, Dmitry Baryshkov wrote: The dpu_plane_prepare_fb() already calls dpu_format_populate_layout(). Store the generated layour in the plane state and drop this call from dpu_plane_sspp_update(). Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c

Re: [PATCH 1/9] drm/msm/dpu: drop dpu_format_check_modified_format

2024-04-19 Thread Abhinav Kumar
On 3/19/2024 6:21 AM, Dmitry Baryshkov wrote: The msm_kms_funcs::check_modified_format() callback is not used by the driver. Drop it completely. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c | 45 -

Re: [PATCH 2/7] drm/msm/dsi: Pass bonded-DSI hdisplay/2 to DSC timing configuration

2024-04-19 Thread Dmitry Baryshkov
On Sat, Apr 20, 2024 at 12:18:39AM +0200, Marijn Suijten wrote: > On 2024-04-17 14:58:25, Dmitry Baryshkov wrote: > > On Wed, 17 Apr 2024 at 02:57, Marijn Suijten > > wrote: > > > > > > When configuring the timing of DSI hosts (interfaces) in > > > dsi_timing_setup() all values written to

Re: [PATCH 2/7] drm/msm/dsi: Pass bonded-DSI hdisplay/2 to DSC timing configuration

2024-04-19 Thread Marijn Suijten
On 2024-04-17 14:58:25, Dmitry Baryshkov wrote: > On Wed, 17 Apr 2024 at 02:57, Marijn Suijten > wrote: > > > > When configuring the timing of DSI hosts (interfaces) in > > dsi_timing_setup() all values written to registers are taking bonded > > DSI into account by dividing the original mode

Re: [PATCH 04/12] drm/msm: add arrays listing formats supported by MDP4/MDP5 hardware

2024-04-19 Thread Abhinav Kumar
On 4/19/2024 2:21 PM, Dmitry Baryshkov wrote: On Sat, 20 Apr 2024 at 00:06, Abhinav Kumar wrote: On 12/2/2023 1:40 PM, Dmitry Baryshkov wrote: MDP4 and MDP5 drivers enumerate supported formats each time the plane is created. In preparation to merger of MDP DPU format databases, define

Re: [PATCH 04/12] drm/msm: add arrays listing formats supported by MDP4/MDP5 hardware

2024-04-19 Thread Dmitry Baryshkov
On Sat, 20 Apr 2024 at 00:06, Abhinav Kumar wrote: > > > > On 12/2/2023 1:40 PM, Dmitry Baryshkov wrote: > > MDP4 and MDP5 drivers enumerate supported formats each time the plane is > > created. In preparation to merger of MDP DPU format databases, define > > precise formats list, so that changes

Re: [PATCH 04/12] drm/msm: add arrays listing formats supported by MDP4/MDP5 hardware

2024-04-19 Thread Abhinav Kumar
On 12/2/2023 1:40 PM, Dmitry Baryshkov wrote: MDP4 and MDP5 drivers enumerate supported formats each time the plane is created. In preparation to merger of MDP DPU format databases, define precise formats list, so that changes to the database do not cause the driver to add unsupported format

Re: [PATCH 03/12] drm/msm/dpu: use format-related definitions from mdp_common.xml.h

2024-04-19 Thread Abhinav Kumar
On 4/10/2024 7:38 PM, Dmitry Baryshkov wrote: On Thu, 11 Apr 2024 at 02:54, Abhinav Kumar wrote: On 4/10/2024 2:12 PM, Dmitry Baryshkov wrote: On Wed, Apr 10, 2024 at 01:18:42PM -0700, Abhinav Kumar wrote: On 4/10/2024 1:16 PM, Dmitry Baryshkov wrote: On Wed, 10 Apr 2024 at 23:00,

Re: [PATCH] drm/msm: Fix gen_header.py for older python3 versions

2024-04-19 Thread Dmitry Baryshkov
On Fri, Apr 12, 2024 at 05:54:07PM +0100, Jon Hunter wrote: > The gen_header.py script is failing for older versions of python3 such > as python 3.5. Two issues observed with python 3.5 are ... > > 1. Python 3 versions prior to 3.6 do not support the f-string format. > 2. Early python 3