[PATCH] drm/uapi: Move drm_color_ctm_3x4 out from drm_mode.h

2024-04-22 Thread Ville Syrjala
From: Ville Syrjälä drm_color_ctm_3x4 is some undocumented amgdpu private uapi and thus has no business being in drm_mode.h. At least move it to some amdgpu specific header, albeit with the wrong namespace as maybe something somewhere is using this already? Cc: Harry Wentland Cc: Joshua Ashton

[PATCH] drm: Fix plane SIZE_HINTS property docs

2024-04-18 Thread Ville Syrjala
From: Ville Syrjälä Fix the typos in the plane SIZE_HINTS kernel docs. Reported-by: Stephen Rothwell Fixes: 9677547d8362 ("drm: Introduce plane SIZE_HINTS property") Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_plane.c | 2 +- include/drm/drm_mode_config.h | 2 +- 2 files changed,

[PATCH] drm/edid: Parse topology block for all DispID structure v1.x

2024-04-10 Thread Ville Syrjala
From: Ville Syrjälä DisplayID spec v1.3 revision history notes do claim that the toplogy block was added in v1.3 so requiring structure v1.2 would seem correct, but there is at least one EDID in edid.tv with a topology block and structure v1.0. And there are also EDIDs with DisplayID structure

[PATCH 5/5] drm/vkms: Use drm_crtc_vblank_crtc()

2024-04-08 Thread Ville Syrjala
From: Ville Syrjälä Replace the open coded drm_crtc_vblank_crtc() with the real thing. Cc: Rodrigo Siqueira Cc: Melissa Wen Cc: "Maíra Canal" Cc: Haneen Mohammed Cc: Daniel Vetter Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/vkms/vkms_crtc.c | 7 ++- 1 file changed, 2

[PATCH 4/5] drm/nouveau: Use drm_crtc_vblank_crtc()

2024-04-08 Thread Ville Syrjala
From: Ville Syrjälä Replace the open coded drm_crtc_vblank_crtc() with the real thing. Cc: Karol Herbst Cc: Lyude Paul Cc: Danilo Krummrich Cc: nouv...@lists.freedesktop.org Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/nouveau/nouveau_display.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH 3/5] drm/i915: Use drm_crtc_vblank_crtc()

2024-04-08 Thread Ville Syrjala
From: Ville Syrjälä Replace the open coded drm_crtc_vblank_crtc() with the real thing. Cc: intel-...@lists.freedesktop.org Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_crtc.c | 3 +-- drivers/gpu/drm/i915/display/intel_vblank.c | 16 +--- 2 files changed,

[PATCH 2/5] drm/amdgpu: Use drm_crtc_vblank_crtc()

2024-04-08 Thread Ville Syrjala
From: Ville Syrjälä Replace the open coded drm_crtc_vblank_crtc() with the real thing. Cc: Alex Deucher Cc: "Christian König" Cc: "Pan, Xinhui" Cc: amd-...@lists.freedesktop.org Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 8 ++--

[PATCH 1/5] drm/vblank: Introduce drm_crtc_vblank_crtc()

2024-04-08 Thread Ville Syrjala
From: Ville Syrjälä Make life easier by providing a function that hands out the the correct drm_vblank_crtc for a given a drm_crtc. Also abstract the lower level internals of the vblank code in a similar fashion. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_vblank.c | 58

[PATCH 17/21] drm/fsl-dcu: Allow build with COMPILE_TEST=y

2024-04-08 Thread Ville Syrjala
From: Ville Syrjälä Allow fsl-dcu to be built with COMPILE_TEST=y for greater coverage. Builds fine on x86/x86_64 at least. Cc: Stefan Agner Cc: Alison Wang Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/fsl-dcu/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH 15/21] drm/omap: Allow build with COMPILE_TEST=y

2024-04-08 Thread Ville Syrjala
From: Ville Syrjälä Allow omapdrm to be built with COMPILE_TEST=y for greater coverage. FIXME: Still borked due to ? Cc: Tomi Valkeinen Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/omapdrm/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH 20/21] drm/rcar-du: Allow build with COMPILE_TEST=y

2024-04-08 Thread Ville Syrjala
From: Ville Syrjälä Allow rcar-du to be built with COMPILE_TEST=y for greater coverage. Builds fine on x86/x86_64 at least. Cc: Laurent Pinchart Cc: Kieran Bingham Cc: linux-renesas-...@vger.kernel.org Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/renesas/rcar-du/Kconfig | 2 +- 1 file

[PATCH 21/21] drm/stm: Allow build with COMPILE_TEST=y

2024-04-08 Thread Ville Syrjala
From: Ville Syrjälä Allow stm to be built with COMPILE_TEST=y for greater coverage. Builds fine on x86/x86_64 at least. Cc: Yannick Fertre Cc: Raphael Gallais-Pou Cc: Philippe Cornu Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/stm/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH 19/21] drm/meson: Allow build with COMPILE_TEST=y

2024-04-08 Thread Ville Syrjala
From: Ville Syrjälä Allow meson to be built with COMPILE_TEST=y for greater coverage. Builds fine on x86/x86_64 at least. Cc: Neil Armstrong Cc: linux-amlo...@lists.infradead.org Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/meson/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH 18/21] drm/mediatek: Allow build with COMPILE_TEST=y

2024-04-08 Thread Ville Syrjala
From: Ville Syrjälä Allow mediatek to be built with COMPILE_TEST=y for greater coverage. Builds fine on x86/x86_64 at least. Cc: Chun-Kuang Hu Cc: Philipp Zabel Cc: linux-media...@lists.infradead.org Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/mediatek/Kconfig | 4 ++-- 1 file changed,

[PATCH 13/21] drm/tilcdc: Allow build with COMPILE_TEST=y

2024-04-08 Thread Ville Syrjala
From: Ville Syrjälä Allow tilcdc to be built with COMPILE_TEST=y for greater coverage. Builds fine on x86/x86_64 at least. Cc: Jyri Sarha Cc: Tomi Valkeinen Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/tilcdc/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH 14/21] drm/omap: Open code phys_to_page()

2024-04-08 Thread Ville Syrjala
From: Ville Syrjälä phys_to_page() is not available on most architectures. Just open code it like msm does. Allows COMPILE_TEST=y builds of omapdrm on other architectures. Cc: Tomi Valkeinen Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/omapdrm/omap_gem.c | 4 ++-- 1 file changed, 2

[PATCH 16/21] drm/atmel-hlcdc: Allow build with COMPILE_TEST=y

2024-04-08 Thread Ville Syrjala
From: Ville Syrjälä Allow atmel-hlcdc to be built with COMPILE_TEST=y for greater coverage. Builds fine on x86/x86_64 at least. Cc: Sam Ravnborg Cc: Boris Brezillon Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/atmel-hlcdc/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[PATCH 10/21] drm/hisilicon/kirin: Fix MASK(32) on 32bit architectures

2024-04-08 Thread Ville Syrjala
From: Ville Syrjälä BIT(32) is illegal when sizeof(long)==4. Use BIT_ULL(32) instead. Cc: Xinliang Liu Cc: Tian Tao Cc: Xinwei Kong Cc: Sumit Semwal Cc: Yongqin Liu Cc: John Stultz Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/hisilicon/kirin/kirin_ade_reg.h | 2 +- 1 file changed, 1

[PATCH 12/21] drm/tilcdc: Allow build without __iowmb()

2024-04-08 Thread Ville Syrjala
From: Ville Syrjälä __iowmb() isn't available on most architectures. Make its use optional so that the driver can be built on other architectures with COMPILE_TEST=y. Cc: Jyri Sarha Cc: Tomi Valkeinen Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/tilcdc/tilcdc_regs.h | 2 ++ 1 file

[PATCH 11/21] drm/hisilicon/kirin: Allow build with COMPILE_TEST=y

2024-04-08 Thread Ville Syrjala
From: Ville Syrjälä Allow kirin to be built with COMPILE_TEST=y for greater coverage. Builds fine on x86/x86_64 at least. Cc: Xinliang Liu Cc: Tian Tao Cc: Xinwei Kong Cc: Sumit Semwal Cc: Yongqin Liu Cc: John Stultz Signed-off-by: Ville Syrjälä ---

[PATCH 09/21] drm/hisilicon/kirin: Fix 64bit divisions

2024-04-08 Thread Ville Syrjala
From: Ville Syrjälä Use the appropriate 64bit division helpers to make the code build on 32bit architectures. Cc: Xinliang Liu Cc: Tian Tao Cc: Xinwei Kong Cc: Sumit Semwal Cc: Yongqin Liu Cc: John Stultz Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c | 11

[PATCH 08/21] drm/hisilicon/kirin: Include linux/io.h for readl()/writel()

2024-04-08 Thread Ville Syrjala
From: Ville Syrjälä Include linux/io.h for readl()/writel(). When built on x86_64 w/ COMPILE_TEST=y: ../drivers/gpu/drm/hisilicon/kirin/dw_dsi_reg.h:93:16: error: implicit declaration of function ‘readl’ [-Werror=implicit-function-declaration] 93 | orig = readl(addr); |

[PATCH 07/21] drm/sti: Allow build with COMPILE_TEST=y

2024-04-08 Thread Ville Syrjala
From: Ville Syrjälä Allow sti to be built with COMPILE_TEST=y for greater coverage. Builds fine on x86/x86_64 at least. Cc: Alain Volmat Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/sti/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH 05/21] drm/imx/dcss: Allow build with COMPILE_TEST=y

2024-04-08 Thread Ville Syrjala
From: Ville Syrjälä Allow imx/dcss to be built with COMPILE_TEST=y for greater coverage. Builds fine on x86/x86_64 at least. Cc: Laurentiu Palcu Cc: Lucas Stach Signed-off-by: Ville Syrjälä dpiormw.cocci --- drivers/gpu/drm/imx/dcss/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH 06/21] drm/sti: Include linux/io.h for devm_ioremap()

2024-04-08 Thread Ville Syrjala
From: Ville Syrjälä Include linux/io.h for devm_ioremap(). When built on x86_64 w/ COMPILE_TEST=y: ../drivers/gpu/drm/sti/sti_dvo.c:531:21: error: implicit declaration of function ‘devm_ioremap’ [-Werror=implicit-function-declaration] 531 | dvo->regs = devm_ioremap(dev, res->start,

[PATCH 04/21] drm/imx/dcss: Fix 64bit divisions

2024-04-08 Thread Ville Syrjala
From: Ville Syrjälä Use the appropriate 64bit division helpers to make the code build on 32bit architectures. Cc: Laurentiu Palcu Cc: Lucas Stach Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/imx/dcss/dcss-scaler.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[PATCH 03/21] drm/armada: Allow build with COMPILE_TEST=y

2024-04-08 Thread Ville Syrjala
From: Ville Syrjälä Allow armada to be built with COMPILE_TEST=y for greater coverage. Builds fine on x86/x86_64 at least. Cc: Russell King Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/armada/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH 02/21] drm/armada: Fix armada_debugfs_crtc_reg_write() return type

2024-04-08 Thread Ville Syrjala
From: Ville Syrjälä Change the armada_debugfs_crtc_reg_write() return type to the correct ssize_t. This makes the code actually build on certain architectures. Cc: Russell King Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/armada/armada_debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH 01/21] drm/armada: Fix printk arguments

2024-04-08 Thread Ville Syrjala
From: Ville Syrjälä ../drivers/gpu/drm/armada/armada_gem.c: In function ‘armada_gem_pwrite_ioctl’: ../drivers/gpu/drm/armada/armada_gem.c:367:27: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 2 has type ‘size_t’ {aka ‘long unsigned int’} [-Wformat=] 367 |

[PATCH 00/21] drm: Increase COMPILE_TEST=y coverage

2024-04-08 Thread Ville Syrjala
From: Ville Syrjälä I got fed up having to build multiple architectures when doing subsystem wide refactoring. So I decided to attack the low hanging COMPILE_TEST=y fruit. Here are the results. All of these drivers now build with COMPILE_TEST=y on x86/x86_64 Ville Syrjälä (21): drm/armada:

[PATCH 10/12] drm/client: Use [CONNECTOR:%d:%s] formatting

2024-04-04 Thread Ville Syrjala
From: Ville Syrjälä Switch to the canonical [CONNECTOR:%d:%s] etc. format for printing out kms objects. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_client_modeset.c | 65 +++- 1 file changed, 35 insertions(+), 30 deletions(-) diff --git

[PATCH 08/12] drm/client: Extract drm_connector_first_mode()

2024-04-04 Thread Ville Syrjala
From: Ville Syrjälä Use a consistent method for picking the first mode from the connnector's mode list. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_client_modeset.c | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git

[PATCH 07/12] drm/client: Use array notation for function arguments

2024-04-04 Thread Ville Syrjala
From: Ville Syrjälä Use the array notation rather that the pointer notation for function arguments. This makes it clear to the reader that we are in fact dealing with an array rather than a single pointer. Functionally the two are equivalent. Signed-off-by: Ville Syrjälä ---

[PATCH 12/12] drm/probe-helper: Switch to per-device debugs

2024-04-04 Thread Ville Syrjala
From: Ville Syrjälä Switch to per-device debugs so that we know which device we're dealing with. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_probe_helper.c | 35 ++ 1 file changed, 16 insertions(+), 19 deletions(-) diff --git

[PATCH 09/12] drm/client: Switch to per-device debugs

2024-04-04 Thread Ville Syrjala
From: Ville Syrjälä Use drm_dev_dbg() & co. so that we know which device we're dealing with. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_client_modeset.c | 117 ++- 1 file changed, 60 insertions(+), 57 deletions(-) diff --git

[PATCH 06/12] drm/client: Constify modes

2024-04-04 Thread Ville Syrjala
From: Ville Syrjälä The modes used by the client code live on the connectors' mode lists, which are not owned by the client code, and thus it has no business modifying the modes. Mark the modes const to make that fact abundantly clear. Signed-off-by: Ville Syrjälä ---

[PATCH 11/12] drm/client: Streamline mode selection debugs

2024-04-04 Thread Ville Syrjala
From: Ville Syrjälä Get rid of all the redundant debugs and just wait until the end to print which mode (and of which type) we picked. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_client_modeset.c | 65 +--- 1 file changed, 31 insertions(+), 34 deletions(-)

[PATCH 05/12] drm/client: Nuke outdated fastboot comment

2024-04-04 Thread Ville Syrjala
From: Ville Syrjälä Remove the tall tale about fastboot vs. user mode vs. adjusted mode. crtc->mode == crtc->state->mode, so none of this makes any sense. I suppose it may have been true long ago in the past. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_client_modeset.c | 10

[PATCH 04/12] drm/client: Add a FIXME around crtc->mode usage

2024-04-04 Thread Ville Syrjala
From: Ville Syrjälä crtc->mode is legacy junk and shouldn't really be used with atomic drivers. Most (all?) atomic drivers do end up still calling drm_atomic_helper_update_legacy_modeset_state() at some point, so crtc->mode does still get populated, and this does work for now. But eventually

[PATCH 03/12] drm/client: Use drm_mode_destroy()

2024-04-04 Thread Ville Syrjala
From: Ville Syrjälä Prefer drm_mode_destroy() over bare kfree(), for consistency and setting a good example. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_client_modeset.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_client_modeset.c

[PATCH 02/12] drm/client: s/drm_connector_has_preferred_mode/drm_connector_preferred_mode/

2024-04-04 Thread Ville Syrjala
From: Ville Syrjälä Drop the "has" from drm_connector_has_preferred_mode() to better describe what it does. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_client_modeset.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/drm_client_modeset.c

[PATCH 01/12] drm/client: Fully protect modes[] with dev->mode_config.mutex

2024-04-04 Thread Ville Syrjala
From: Ville Syrjälä The modes[] array contains pointers to modes on the connectors' mode lists, which are protected by dev->mode_config.mutex. Thus we need to extend modes[] the same protection or by the time we use it the elements may already be pointing to freed/reused memory. Cc:

[PATCH 00/12] drm/client: Use after free and debug improvements

2024-04-04 Thread Ville Syrjala
From: Ville Syrjälä Various improvements to the drm/client code: - Fix a use after free (fairly routinely hit by i915 CI) - Debug print improvements - Cleanups/etc. Ville Syrjälä (12): drm/client: Fully protect modes[] with dev->mode_config.mutex drm/client:

[PATCH v3 1/2] drm: Introduce plane SIZE_HINTS property

2024-03-19 Thread Ville Syrjala
From: Ville Syrjälä Add a new immutable plane property by which a plane can advertise a handful of recommended plane sizes. This would be mostly exposed by cursor planes as a slightly more capable replacement for the DRM_CAP_CURSOR_WIDTH/HEIGHT caps, which can only declare a one size fits all

[PATCH v3 2/2] drm/i915: Add SIZE_HINTS property for cursors

2024-03-19 Thread Ville Syrjala
From: Ville Syrjälä Advertize more suitable cursor sizes via the new SIZE_HINTS plane property. We can't really enumerate all supported cursor sizes on the platforms where the cursor height can vary freely, so for simplicity we'll just expose all square+POT sizes between each platform's min and

[PATCH v3 0/2] drm: Add plane SIZE_HINTS property

2024-03-19 Thread Ville Syrjala
From: Ville Syrjälä Final final version I hope. Mainly for CI to test against the new IGTs. Real userspace implementation: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3165 IGT:

[PATCH] drm/i915/ttm: Fix TTM_PL_FLAG_DESIRED

2024-02-27 Thread Ville Syrjala
From: Ville Syrjälä inlined from ‘i915_ttm_get_pages’ at ../drivers/gpu/drm/i915/gem/i915_gem_ttm.c:847:2: ../drivers/gpu/drm/i915/gem/i915_gem_ttm.c:165:18: warning: ‘places[0].flags’ is used uninitialized [-Wuninitialized] 165 | places[0].flags |= TTM_PL_FLAG_DESIRED; |

[PATCH v2 2/2] drm/i915: Add SIZE_HINTS property for cursors

2024-02-27 Thread Ville Syrjala
From: Ville Syrjälä Advertize more suitable cursor sizes via the new SIZE_HINTS plane property. We can't really enumerate all supported cursor sizes on the platforms where the cursor height can vary freely, so for simplicity we'll just expose all square+POT sizes between each platform's min and

[PATCH v2 1/2] drm: Introduce plane SIZE_HINTS property

2024-02-27 Thread Ville Syrjala
From: Ville Syrjälä Add a new immutable plane property by which a plane can advertise a handful of recommended plane sizes. This would be mostly exposed by cursor planes as a slightly more capable replacement for the DRM_CAP_CURSOR_WIDTH/HEIGHT caps, which can only declare a one size fits all

[PATCH v2 0/2] drm: Add plane SIZE_HINTS property

2024-02-27 Thread Ville Syrjala
From: Ville Syrjälä Final version for a new plane SIZE_HINTS property to essentially replace the cursor size caps, based on recent discussion in this gitlab bug: https://gitlab.freedesktop.org/drm/intel/-/issues/7687 As for userspace, so far I only did a quick modetest blob decoder (mainly to

[PATCH] drm/mm: Allow CONFIG_DRM_MM_DEBUG with DRM=m

2023-12-15 Thread Ville Syrjala
From: Ville Syrjälä The original rationale for commit cd456f8d06d2 ("drm: Restrict stackdepot usage to builtin drm.ko") was that depot_save_stack() (which is what we used back then) wasn't exported. stack_depot_save() (which is what we use now) is exported however, so relax the dependency allow

[PATCH 2/2] drm: Warn when freeing a framebuffer that's still on a list

2023-12-11 Thread Ville Syrjala
From: Ville Syrjälä Sprinkle some extra WARNs around so that we might catch premature framebuffer destruction more readily. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_framebuffer.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git

[PATCH 1/2] drm: Don't unref the same fb many times by mistake due to deadlock handling

2023-12-11 Thread Ville Syrjala
From: Ville Syrjälä If we get a deadlock after the fb lookup in drm_mode_page_flip_ioctl() we proceed to unref the fb and then retry the whole thing from the top. But we forget to reset the fb pointer back to NULL, and so if we then get another error during the retry, before the fb lookup, we

[PATCH 4/4] drm/i915: Fix glk+ degamma LUT conversions

2023-10-13 Thread Ville Syrjala
From: Ville Syrjälä The current implementation of change_lut_val_precision() is just a convoluted way of shifting by 8. Implement the proper rounding by just using drm_color_lut_extract() and intel_color_lut_pack() like everyone else does. And as the uapi can't handle >=1.0 values but the

[PATCH 3/4] drm/i915: s/clamp()/min()/ in i965_lut_11p6_max_pack()

2023-10-13 Thread Ville Syrjala
From: Ville Syrjälä Use min() instead of clamp() since the color values involved are unsigned. No functional changes. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_color.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH 2/4] drm/i915: Adjust LUT rounding rules

2023-10-13 Thread Ville Syrjala
From: Ville Syrjälä drm_color_lut_extract() rounding was changed to follow the OpenGL int<->float conversion rules. Adjust intel_color_lut_pack() to match. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_color.c | 14 ++ 1 file changed, 6 insertions(+), 8

[PATCH 1/4] drm: Fix color LUT rounding

2023-10-13 Thread Ville Syrjala
From: Ville Syrjälä The current implementation of drm_color_lut_extract() generates weird results. Eg. if we go through all the values for 16->8bpc conversion we see the following pattern: inout (count) 0 - 7f -> 0 (128) 80 - 17f -> 1 (256) 180 - 27f -> 2 (256) 280 -

[PATCH 0/4] drm/i915: Fix LUT rounding

2023-10-13 Thread Ville Syrjala
From: Ville Syrjälä The current LUT rounding is generating weird results. Adjust it to follow the OpenGL int<->float conversion rules. Ville Syrjälä (4): drm: Fix color LUT rounding drm/i915: Adjust LUT rounding rules drm/i915: s/clamp()/min()/ in i965_lut_11p6_max_pack() drm/i915: Fix

[PATCH v2 2/2] drm/i915/bios: Fixup h/vsync_end instead of h/vtotal

2023-09-20 Thread Ville Syrjala
From: Ville Syrjälä We have the same h/vsync_end vs. h/vtotal quirk in the VBT parser that was also present in EDID parser. Adjust the VBT parser the same way as was done for hte EDID parser to fixup h/vsync_end instead of h/vtotal. While I'm not currently aware of any machines that need this

[PATCH v2 1/2] drm/edid: Fixup h/vsync_end instead of h/vtotal

2023-09-20 Thread Ville Syrjala
From: Ville Syrjälä There are some weird EDIDs floating around that have the sync pulse extending beyond the end of the blanking period. On the currently problemtic machine (HP Omni 120) EDID reports the following mode: "1600x900": 60 108000 1600 1780 1860 1800 900 910 913 1000 0x40 0x5 which

[PATCH] drm/edid: Fixup h/vsync_end instead of h/vtotal

2023-09-14 Thread Ville Syrjala
From: Ville Syrjälä There are some weird EDIDs floating around that have the sync pulse extending beyond the end of the blanking period. On the currently problemtic machine (HP Omni 120) EDID reports the following mode: "1600x900": 60 108000 1600 1780 1860 1800 900 910 913 1000 0x40 0x5 which

[PATCH v2 2/2] drm/vblank: Warn when silently cancelling vblank works

2023-09-03 Thread Ville Syrjala
From: Ville Syrjälä Silently cancelling vblank works is a bit rude, especially if said works do any resource management (eg. free memory). WARN if we ever hit this. TODO: Maybe drm_crtc_vblank_off() should wait for any pending work to reach its target vblank before actually doing anything

[PATCH v2 1/2] drm/i915: Use vblank worker to unpin old legacy cursor fb safely

2023-09-03 Thread Ville Syrjala
From: Ville Syrjälä The cursor hardware only does sync updates, and thus the hardware will be scanning out from the old fb until the next start of vblank. So in order to make the legacy cursor fastpath actually safe we should not unpin the old fb until we're sure the hardware has ceased

[PATCH v2 03/12] drm/i915: Call the DDC bus i2c adapter "ddc"

2023-08-31 Thread Ville Syrjala
From: Ville Syrjälä Rename the various names we've used for the DDC bus i2c adapter ("i2c", "adapter", etc.) to just "ddc". This differentiates it from the various other i2c busses we might have (DSI panel stuff, DVO control bus, etc.). v2: Don't add a bogus drm_get_edid() call (Jani)

[PATCH 11/12] drm/i915/hdmi: Remove old i2c symlink

2023-08-29 Thread Ville Syrjala
From: Ville Syrjälä Remove the i915 specific i2c-N symlink from HDMI connectors. This was added to sort of mirror the DP connectors that alreayd had their aux ch based i2c adapter sitting beneath them in the sysfs hierarchy. But now that we have the standard "ddc" symlink approach provided by

[PATCH 12/12] drm/i915/sdvo: Constify mapping structs

2023-08-29 Thread Ville Syrjala
From: Ville Syrjälä We aren't intending to mutate the SDVO device mapping structs, so make them const. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_sdvo.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_sdvo.c

[PATCH 10/12] drm/i915/hdmi: Nuke hdmi->ddc_bus

2023-08-29 Thread Ville Syrjala
From: Ville Syrjälä Remove the mostly redundant hdmi->ddc_bus. The only thing that needs it anymore is get_encoder_by_ddc_bus(), but that can be replaced with a slight detour through attached_connector+intel_gmbus_get_adapter(). Signed-off-by: Ville Syrjälä ---

[PATCH 09/12] drm/i915/hdmi: Use connector->ddc everwhere

2023-08-29 Thread Ville Syrjala
From: Ville Syrjälä We already populate connector->ddc for HDMI ports, but so far we've not taken full advantage of it. Do that by eliminating a bunch of intel_gmbus_get_adapter() lookups. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_ddi.c | 3 +-

[PATCH 08/12] drm/i915/mst: Populate connector->ddc

2023-08-29 Thread Ville Syrjala
From: Ville Syrjälä Populate connector->ddc, and thus create the "ddc" symlink in sysfs for DP MST connectors. TODO: test that this actually works References: https://gitlab.freedesktop.org/drm/intel/-/issues/3605 Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_dp_mst.c |

[PATCH 07/12] drm/i915/dp: Populate connector->ddc

2023-08-29 Thread Ville Syrjala
From: Ville Syrjälä Populate connector->ddc, and thus create the "ddc" symlink in sysfs for analog DP SST connectors. Let's also reorder intel_dp_aux_init() vs. drm_connector_init_with_ddc() a bit to make sure the i2c aux ch is at least somewhat populated before we pass it on, though

[PATCH 06/12] drm/i915/dvo: Populate connector->ddc

2023-08-29 Thread Ville Syrjala
From: Ville Syrjälä Populate connector->ddc, and thus create the "ddc" symlink in sysfs for DVO connectors. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_dvo.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git

[PATCH 05/12] drm/i915/crt: Populate connector->ddc

2023-08-29 Thread Ville Syrjala
From: Ville Syrjälä Populate connector->ddc, and thus create the "ddc" symlink in sysfs for analog VGA connectors. As a bonus we can replace a bunch of intel_gmbus_get_adapter() lookups with just the connector->ddc pointer. Sadly one extra lookup still remains due to the g4x DVI-I shenanigans.

[PATCH 03/12] drm/i915: Call the DDC bus i2c adapter "ddc"

2023-08-29 Thread Ville Syrjala
From: Ville Syrjälä Rename the various names we've used for the DDC bus i2c adapter ("i2c", "adapter", etc.) to just "ddc". This differentiates it from the various other i2c busses we might have (DSI panel stuff, DVO control bus, etc.). Signed-off-by: Ville Syrjälä ---

[PATCH 04/12] drm/i915/lvds: Populate connector->ddc

2023-08-29 Thread Ville Syrjala
From: Ville Syrjälä Populate connector->ddc, and thus create the "ddc" symlink in sysfs for the LVDS port. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_lvds.c | 23 +++ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git

[PATCH 02/12] drm/sysfs: Register "ddc" symlink later

2023-08-29 Thread Ville Syrjala
From: Ville Syrjälä Currently drm_sysfs_connector_add() attempts to register the "ddc" symlink (based one connector->ddc) before the driver's .early_register() hook has been called. That is too early for i915 which only fully registers the aux ch and associated i2c bus from said hook (to prevent

[PATCH 01/12] drm: Reorder drm_sysfs_connector_remove() vs. drm_debugfs_connector_remove()

2023-08-29 Thread Ville Syrjala
From: Ville Syrjälä Use the standard onion peeling approach and call drm_debugfs_connector_remove() and drm_sysfs_connector_remove() in the reverse order in drm_connector_unregister() than what we called their add counterpartse in drm_connector_register(). The error unwiding in

[PATCH 00/12] drm/i915: Populate connector->ddc always

2023-08-29 Thread Ville Syrjala
From: Ville Syrjälä Populate connector->ddc for all output types that don't already do so, and clean up a bunch of code as a result of having the ddc i2c adapter in easy reach. And this also provides the sysfs "ddc" symlink. There are potentially a few oddball (mostly DVI-I) cases where the

[PATCH] dma-buf/dma-resv: Stop leaking on krealloc() failure

2023-07-13 Thread Ville Syrjala
From: Ville Syrjälä Currently dma_resv_get_fences() will leak the previously allocated array if the fence iteration got restarted and the krealloc_array() fails. Free the old array by hand, and make sure we still clear the returned *fences so the caller won't end up accessing freed memory. Some

[PATCH v2 08/11] drm/i915: Introduce crtc_state->enhanced_framing

2023-05-03 Thread Ville Syrjala
From: Ville Syrjälä Track DP enhanced framing properly in the crtc state instead of relying just on the cached DPCD everywhere, and hook it up into the state check and dump. v2: Actually set enhanced_framing in .compute_config() Signed-off-by: Ville Syrjälä ---

[PATCH 04/11] drm/i915: Fix FEC pipe A vs. DDI A mixup

2023-05-02 Thread Ville Syrjala
From: Ville Syrjälä On pre-TGL FEC is a port level feature, not a transcoder level features, and it's DDI A which doesn't have it, not trancodere A. Check for the correct thing when determining whether FEC is supported or not. Signed-off-by: Ville Syrjälä ---

[PATCH 11/11] drm/i915: Reduce combo PHY log spam

2023-05-02 Thread Ville Syrjala
From: Ville Syrjälä We always check whether combo PHYs need to be re-initialized after disabling DC states, which leads to log spam. Switch things around so that we only log something when we actually have to re-initialized a PHY. The log spam was exacerbated by commit 41b4c7fe72b6 ("drm/i915:

[PATCH 08/11] drm/i915: Introduce crtc_state->enhanced_framing

2023-05-02 Thread Ville Syrjala
From: Ville Syrjälä Track DP enhanced framing properly in the crtc state instead of relying just on the cached DPCD everywhere, and hook it up into the state check and dump. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/g4x_dp.c | 10 --

[PATCH 10/11] drm/i915: Drop some redundant eDP checks

2023-05-02 Thread Ville Syrjala
From: Ville Syrjälä There's no need to check for both eDP and fixed_mode when deciding whether to do the pfit calculations or not. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_dp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[PATCH 09/11] drm/i915: Stop spamming the logs with PLL state

2023-05-02 Thread Ville Syrjala
From: Ville Syrjälä encoder->get_config() is not the place where the state should be dumped. Get rid of the spam. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_ddi.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c

[PATCH 07/11] drm/i915: Split some long lines

2023-05-02 Thread Ville Syrjala
From: Ville Syrjälä Split some overly long lines. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_fdi.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_fdi.c b/drivers/gpu/drm/i915/display/intel_fdi.c index

[PATCH 06/11] drm/i915: Fix FEC state dump

2023-05-02 Thread Ville Syrjala
From: Ville Syrjälä Stop dumping state while reading it out. We have a proper place for that stuff. Signed-off-by: Ville Syrjälä --- .../gpu/drm/i915/display/intel_crtc_state_dump.c| 2 ++ drivers/gpu/drm/i915/display/intel_ddi.c| 13 +++-- 2 files changed, 5

[PATCH 05/11] drm/i915: Check lane count when determining FEC support

2023-05-02 Thread Ville Syrjala
From: Ville Syrjälä ICL doesn't support FEC with a x1 DP link. Make sure we don't try to enable FEC in such cases. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_dp.c | 23 --- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git

[PATCH 03/11] drm/i915/mst: Read out FEC state

2023-05-02 Thread Ville Syrjala
From: Ville Syrjälä The MST codepath is missing FEC readout. Add it. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_ddi.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c index

[PATCH 02/11] drm/i915/mst: Remove broken MST DSC support

2023-05-02 Thread Ville Syrjala
From: Ville Syrjälä The MST DSC code has a myriad of issues: - Platform checks are wrong (MST+DSC is TGL+ only IIRC) - Return values of .mode_valid_ctx() are wrong - .mode_valid_ctx() assumes bigjoiner might be used, but ther rest of the code doesn't agree - compressed bpp calculations don't

[PATCH 01/11] drm/dp_mst: Fix fractional DSC bpp handling

2023-05-02 Thread Ville Syrjala
From: Ville Syrjälä The current code does '(bpp << 4) / 16' in the MST PBN calculation, but that is just the same as 'bpp' so the DSC codepath achieves absolutely nothing. Fix it up so that the fractional part of the bpp value is actually used instead of truncated away. 64*1006 has enough zero

[PATCH 00/11] drm/i915: MST+DSC nukage and state stuff

2023-05-02 Thread Ville Syrjala
From: Ville Syrjälä The big one here is removal of the defunct i915 MST DSC code. That one clearly needs a lot more love, and the big issue there (FEC) probably can't be done in a way that can be easily backported. So IMO we just need to nuke the whole MST+DSC thing for now, or else we'll end up

[PATCH v2 7/7] drm/i915: Do state check for color management changes

2023-04-13 Thread Ville Syrjala
From: Ville Syrjälä In order to validate LUT programming more thoroughly let's do a state check for all color management updates as well. Not sure we really want this outside CI. It is rather heavy and color management updates could become rather common with all the HDR/etc. stuff happening.

[PATCH v2 6/7] drm/i915: No 10bit gamma on desktop gen3 parts

2023-04-13 Thread Ville Syrjala
From: Ville Syrjälä Apparently desktop gen3 parts don't support the 10bit gamma mode at all. Stop claiming otherwise. As is the case with pipe A on gen3 mobile parts, the PIPECONF gamma mode bit can be set but it has no effect on the output. PNV seems to be the only slight exception, but

[PATCH v2 5/7] drm/i915: Implement CTM property support for VLV

2023-04-13 Thread Ville Syrjala
From: Ville Syrjälä VLV has a so called "wide gamut color correction" unit (WGC). What it is is a 3x3 matrix similar to the later CHV CGM CSC, which less precisions/range. In fact CHV also has the WGC but using it there doesn't reall make sense when you have the superior CGM CSC around. Hook up

[PATCH v2 4/7] drm/i915: Always enable CGM CSC on CHV

2023-04-13 Thread Ville Syrjala
From: Ville Syrjälä On CHV toggling the CGM CSC on/off while the pipe is running leads to underruns. Looks like we'd have to do the toggling strictly inside the start_of_vblank-frame_start window to avoid this, but that window is less than a scanline so there's no way we can guarantee hitting

[PATCH v2 2/7] drm/i915: Expose crtc CTM property on ilk/snb

2023-04-13 Thread Ville Syrjala
From: Ville Syrjälä The ilk/snb code is internally fully capable of handling the CTM property, so expose it. Note that we still choose not to expose DEGAMMA_LUT though. The hardware is capable if degamma or gamma, but not both similtanously due to lack of the split gamma mode. Exposing both

[PATCH v2 3/7] drm/i915: Fix CHV CGM CSC coefficient sign handling

2023-04-13 Thread Ville Syrjala
From: Ville Syrjälä The CHV CGM CSC coefficients are in s4.12 two's complement format. Fix the CTM->CGM conversion to handle that correctly instead of pretending that the hw coefficients are also in some sign-magnitude format. Signed-off-by: Ville Syrjälä ---

[PATCH v2 1/7] drm/uapi: Document CTM matrix better

2023-04-13 Thread Ville Syrjala
From: Ville Syrjälä Document in which order the CTM matrix elements are stored. Signed-off-by: Ville Syrjälä --- include/uapi/drm/drm_mode.h | 5 + 1 file changed, 5 insertions(+) diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h index 46becedf5b2f..43691058d28f

[PATCH v2 0/7] drm/i915: CTM stuff mostly

2023-04-13 Thread Ville Syrjala
From: Ville Syrjälä Mostly some CTM stuff: - document the uapi better - fix CHV CSC negative coefficients - expose CTM on ilk/snb/vlv - a bonus gamma patch for gen3 - cure CGM CSC underruns on CHV (new in v2) Test-with: 20230411161555.10001-1-ville.syrj...@linux.intel.com Ville Syrjälä (7):

[PATCH 6/6] drm/i915: Do state check for color management changes

2023-04-11 Thread Ville Syrjala
From: Ville Syrjälä In order to validate LUT programming more thoroughly let's do a state check for all color management updates as well. Not sure we really want this outside CI. It is rather heavy and color management updates could become rather common with all the HDR/etc. stuff happening.

  1   2   3   4   5   6   7   8   9   10   >