[PATCH] drm/i915: Fix SEL_FETCH_{SIZE,OFFSET} registers

2024-05-24 Thread Ville Syrjala
From: Ville Syrjälä Fix up the SEL_FETCH_{SIZE,OFFSET} registers. A classic copy-paste fail on my part. I even had a small test to confirm that the old and new register offsets match, but somehow I must have screwed things up when running it, and likely just ended up comparing the old defines

[PATCH 3/3] drm/i915: Bury c8_planes_changed() in intel_color_check()

2024-05-23 Thread Ville Syrjala
From: Ville Syrjälä The c8_planes_changed() check in the high level atomic code is a bit of an eyesore. Push it inside intel_color_check() so the high level code doesn't have to care about this stuff. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_color.c | 11

[PATCH 2/3] drm/i915: Hide the intel_crtc_needs_color_update() inside intel_color_check()

2024-05-23 Thread Ville Syrjala
From: Ville Syrjälä Move the intel_crtc_needs_color_update() into intel_color_check() so that the caller doesn't have to care about this. This will also enable us to hide the c8_planes_changed() thing better. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_color.c | 5

[PATCH 1/3] drm/i915: Plumb the entire atomic state into intel_color_check()

2024-05-23 Thread Ville Syrjala
From: Ville Syrjälä Bunch of stuff in intel_color_check() needs to look at both the old and new crtc states. Currently we do that by digging the full atomic state via the crtc_state->state pointer. That thing is a total footgun if I ever saw one, as it's only valid during specific parts of the

[PATCH 0/3] drm/i915: intel_color_check() cleanup

2024-05-23 Thread Ville Syrjala
From: Ville Syrjälä Eliminate the crtc_state->state footgun from intel_color_check(), and hide some mundane C8 plane details inside it. Ville Syrjälä (3): drm/i915: Plumb the entire atomic state into intel_color_check() drm/i915: Hide the intel_crtc_needs_color_update() inside

[PATCH v2 03/13] drm/i915: Add separate define for SEL_FETCH_CUR_CTL()

2024-05-20 Thread Ville Syrjala
From: Ville Syrjälä Split the cursor stuff from the rest of the selective fetch plane registers so that we can collect all cursor registers in intel_cursor_regs.h. Also take the opportunity to rename the registers to match the spec. v2: Pass the correct register offset fpr pipe B (Jani)

[PATCH v2] drm/i915: Bump max TMDS bitrate to 6 Gbps on ADL-S/ADL-P/DG2+

2024-05-20 Thread Ville Syrjala
From: Ville Syrjälä Bspec lists the mas TMDS bitrate as 6 Gbps on ADL-S/ADL-P/DG2. Bump our limit to match. v2: Bump for ADL-S as well (Jani) Cc: Jani Nikula Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_hdmi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)

[PATCH v2 01/13] drm/i915: Add skl+ plane name aliases to enum plane_id

2024-05-17 Thread Ville Syrjala
From: Ville Syrjälä Using PLANE_PRIMARY + PLANE_SPRITE? on skl+ results in a bunch of unnecessary head scratching. Add aliases using the skl+ plane names. And for pre-skl we only need to keep PRIMARY,SPRITE0,SPRITE1 as we only ever have 0-2 sprites per pipe on those platforms. v2: Don't break

[PATCH 6/7] drm/i915: Utilize edp_disable_dsc from VBT

2024-05-17 Thread Ville Syrjala
From: Ville Syrjälä Disable eDP DSC usage when instructed to do so by the VBT. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_bios.c | 4 drivers/gpu/drm/i915/display/intel_display_types.h | 1 + drivers/gpu/drm/i915/display/intel_dp.c| 4 3

[PATCH 7/7] drm/i915: Remove bogus MST check in intel_dp_has_audio()

2024-05-17 Thread Ville Syrjala
From: Ville Syrjälä No idea what this MST checks is doing in intel_dp_has_audio(). Looks completely pointless, so get rid of it. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_dp.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git

[PATCH 5/7] drm/i915: Reuse intel_dp_supports_dsc() for MST

2024-05-17 Thread Ville Syrjala
From: Ville Syrjälä intel_dp_supports_dsc() now works for MST as well, reuse it. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_dp.c | 4 ++-- drivers/gpu/drm/i915/display/intel_dp.h | 3 +++ drivers/gpu/drm/i915/display/intel_dp_mst.c | 20

[PATCH 4/7] drm/i915: Use intel_dp_has_dsc() during .compute_config()

2024-05-17 Thread Ville Syrjala
From: Ville Syrjälä Reuse intel_dp_has_dsc() during .compute_config() instead of repeating some of the checks again by hand. We'll be adding more checks to intel_dp_has_dsc() and this will make sure we cover both .mode_valid() and .compute_config() with them. Signed-off-by: Ville Syrjälä ---

[PATCH 2/7] drm/i915: Extract intel_dp_has_dsc()

2024-05-17 Thread Ville Syrjala
From: Ville Syrjälä Extract a helper to check whether the source+sink combo supports DSC. That basic check is needed both during mode validation and compute config. We'll also need to add extra checks to both places, so having a single place for it is nicer. Signed-off-by: Ville Syrjälä ---

[PATCH 3/7] drm/i915: Handle MST in intel_dp_has_dsc()

2024-05-17 Thread Ville Syrjala
From: Ville Syrjälä Utilize intel_dp_has_dsc() for MST as well. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_dp.c | 5 - drivers/gpu/drm/i915/display/intel_dp.h | 1 + drivers/gpu/drm/i915/display/intel_dp_mst.c | 3 +-- 3 files changed, 6 insertions(+), 3

[PATCH 1/7] drm/i915: Drop redundant dsc_decompression_aux check

2024-05-17 Thread Ville Syrjala
From: Ville Syrjälä If we have no dsc_decompression_aux (only possible on MST) then we won't have the dsc_dpcd caps either. So checking both is not needed. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_dp.c | 1 - 1 file changed, 1 deletion(-) diff --git

[PATCH 0/7] drm/i915: DSC stuff

2024-05-17 Thread Ville Syrjala
From: Ville Syrjälä Respect the VBT's edp_disable_dsc bit, and do a bunch of refactoring around checking for DSC support. Also threw in a bonus cleanup to intel_dp_has_audio() that caught my eye. Ville Syrjälä (7): drm/i915: Drop redundant dsc_decompression_aux check drm/i915: Extract

[PATCH] drm/i915: Bump max TMDS bitrate to 6 Gbps on ADL/DG2+

2024-05-16 Thread Ville Syrjala
From: Ville Syrjälä Bspec lists the mas TMDS bitrate as 6 Gbps on ADL/DG2. Bump our limit to match. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_hdmi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c

[PATCH] drm/probe-helper: Call drm_mode_validate_ycbcr420() before connector->mode_valid()

2024-05-16 Thread Ville Syrjala
From: Ville Syrjälä Make life easier for drivers by filtering out unwanted YCbCr 4:2:0 only modes prior to calling the connector->mode_valid() hook. Currently drivers will still see YCbCr 4:2:0 only modes in said hook, which will likely come as a suprise when the driver has declared no support

[PATCH 12/13] drm/i915: Polish sprite plane register definitions

2024-05-16 Thread Ville Syrjala
From: Ville Syrjälä Group the sprite plane register definitions such that everything to do wiht the same register is in one place. Signed-off-by: Ville Syrjälä --- .../gpu/drm/i915/display/intel_sprite_regs.h | 231 ++ 1 file changed, 134 insertions(+), 97 deletions(-) diff

[PATCH 13/13] drm/i915: Document which platforms use which sprite registers

2024-05-16 Thread Ville Syrjala
From: Ville Syrjälä Note which sprite registers are valid for which platforms. Signed-off-by: Ville Syrjälä --- .../gpu/drm/i915/display/intel_sprite_regs.h | 19 +++ 1 file changed, 11 insertions(+), 8 deletions(-) diff --git

[PATCH 09/13] drm/i915: Extract i9xx_plane_regs.h

2024-05-16 Thread Ville Syrjala
From: Ville Syrjälä Relocate all pre-skl primary plane register definitions into their own declutter i915_reg.h. Cc: Zhenyu Wang Cc: Zhi Wang Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/i9xx_plane.c | 1 + .../gpu/drm/i915/display/i9xx_plane_regs.h| 98

[PATCH 11/13] drm/i915: Document a few pre-skl primary plane platform dependencies

2024-05-16 Thread Ville Syrjala
From: Ville Syrjälä Add some notes indicatign which plane registers/bits are valid for which platforms. Signed-off-by: Ville Syrjälä --- .../gpu/drm/i915/display/i9xx_plane_regs.h| 22 +-- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git

[PATCH 10/13] drm/i915: Polish pre-skl primary plane registers

2024-05-16 Thread Ville Syrjala
From: Ville Syrjälä Group the pre-skl primary plane register definitions sensible, and toss in a few comments to indicate which platforms have what. Signed-off-by: Ville Syrjälä --- .../gpu/drm/i915/display/i9xx_plane_regs.h| 46 --- 1 file changed, 29 insertions(+), 17

[PATCH 08/13] drm/i915: Move PIPEGCMAX to intel_color_regs.h

2024-05-16 Thread Ville Syrjala
From: Ville Syrjälä PIPEGCMAX was left behind when all other gamma registers moved into intel_color_regs.h. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_color_regs.h | 5 + drivers/gpu/drm/i915/i915_reg.h | 4 2 files changed, 5 insertions(+), 4

[PATCH 07/13] drm/i915: Add separate defines for cursor WM/DDB register bits

2024-05-16 Thread Ville Syrjala
From: Ville Syrjälä Make a more thorough split between universal planes vs. cursors by defining the contents of the cursor WM/DDB registers separately. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_cursor.c | 34 +++

[PATCH 06/13] drm/i915: Define SEL_FETCH_PLANE registers via PICK_EVEN_2RANGES()

2024-05-16 Thread Ville Syrjala
From: Ville Syrjälä Instead of that huge _PICK() let's use PICK_EVEN_2RANGES() for the SEL_FETCH_PLANE registers. A bit more tedious to have to define 8 raw register offsets for everything, but perhaps a bit easier to understand since we use a standard mechanism now instead of hand rolling the

[PATCH 05/13] drm/i915: Rename selective fetch plane registers

2024-05-16 Thread Ville Syrjala
From: Ville Syrjälä Rename the selective fetch plane registers to match the spec. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_psr_regs.h | 10 +- drivers/gpu/drm/i915/display/skl_universal_plane.c | 12 ++-- 2 files changed, 11 insertions(+), 11

[PATCH 04/13] drm/i915: Simplify PIPESRC_ERLY_TPT definition

2024-05-16 Thread Ville Syrjala
From: Ville Syrjälä PIPESRC_ERLY_TPT is a pipe register, and it lives in the 0x7 range. so using _MMIO_TRANS2() for it is not really correct. Also since this is a pipe register, and not present on CHV, the registers will be equally spaced out, so we can use the simpler _MMIO_PIPE() instead

[PATCH 03/13] drm/i915: Add separate define for SEL_FETCH_CUR_CTL()

2024-05-16 Thread Ville Syrjala
From: Ville Syrjälä Split the cursor stuff from the rest of the selective fetch plane registers so that we can collect all cursor registers in intel_cursor_regs.h. Also take the opportunity to rename the registers to match the spec. Signed-off-by: Ville Syrjälä ---

[PATCH 02/13] drm/i915: Clean up the cursor register defines

2024-05-16 Thread Ville Syrjala
From: Ville Syrjälä Group the cursor register defines such that everything to do with one register is in one place. Signed-off-by: Ville Syrjälä --- .../gpu/drm/i915/display/intel_cursor_regs.h | 52 +-- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git

[PATCH 01/13] drm/i915: Add skl+ plane name aliases to enum plane_id

2024-05-16 Thread Ville Syrjala
From: Ville Syrjälä Using PLANE_PRIMARY + PLANE_SPRITE? on skl+ results in a bunch of unnecessary head scratching. Add aliases using the skl+ plane names. And for pre-skl we only need to keep PRIMARY,SPRITE0,SPRITE1 as we only ever have 0-2 sprites per pipe on those platforms. Signed-off-by:

[PATCH 00/13] drm/i915: Plane register cleanups

2024-05-16 Thread Ville Syrjala
From: Ville Syrjälä Bunch of cleanup mostly around plane registers. Ville Syrjälä (13): drm/i915: Add skl+ plane name aliases to enum plane_id drm/i915: Clean up the cursor register defines drm/i915: Add separate define for SEL_FETCH_CUR_CTL() drm/i915: Simplify PIPESRC_ERLY_TPT

[PATCH 9/9] drm/i915: Nuke the TGL+ chroma plane tile row alignment stuff

2024-05-13 Thread Ville Syrjala
From: Ville Syrjälä I don't think the display hardware really has such chroma plane tile row alignment requirements as outlined in commit d156135e6a54 ("drm/i915/tgl: Make sure a semiplanar UV plane is tile row size aligned") Bspec had the same exact thing to say about earlier hardware as well,

[PATCH 8/9] drm/i915: Update plane alignment requirements for TGL+

2024-05-13 Thread Ville Syrjala
From: Ville Syrjälä Currently we still use the SKL+ PLANE_SURF alignment even for TGL+ even though the hardware no longer needs it. Introduce a separate tgl_plane_min_alignment() and update it to more accurately reflect the hardware requirements. Signed-off-by: Ville Syrjälä ---

[PATCH 7/9] drm/i915: Move intel_surf_alignment() into skl_univerals_plane.c

2024-05-13 Thread Ville Syrjala
From: Ville Syrjälä Now that all pre-skl platforms have their own .min_alignment() functions the remainder of intel_surf_alignment() can be hoisted into skl_univerals_plane.c (and renamed appropriately). Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_fb.c | 77

[PATCH 6/9] drm/i915: Split pre-skl platforms out from intel_surf_alignment()

2024-05-13 Thread Ville Syrjala
From: Ville Syrjälä Extract the necessary chunks from intel_surf_alignment() into per-platform variants for all pre-skl primary/sprite planes. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/i9xx_plane.c | 69 - drivers/gpu/drm/i915/display/intel_fb.c |

[PATCH 5/9] drm/i915: Split cursor alignment to per-platform vfuncs

2024-05-13 Thread Ville Syrjala
From: Ville Syrjälä Split intel_cursor_alignment() into per-platform variants. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_cursor.c | 40 +++-- drivers/gpu/drm/i915/display/intel_fb.c | 16 - drivers/gpu/drm/i915/display/intel_fb.h | 3

[PATCH 4/9] drm/i915: Introduce fb->min_alignment

2024-05-13 Thread Ville Syrjala
From: Ville Syrjälä Different planes could have different alignment requirements even for the same format/modifier. Collect the alignment requirements across all planes capable of scanning out the fb such that the alignment used when pinning the normal ggtt view is satisfactory to all those

[PATCH 3/9] drm/i915: Introduce plane->min_alignment() vfunc

2024-05-13 Thread Ville Syrjala
From: Ville Syrjälä Different hardware generations have different scanout alignment requirements. Introduce a new vfunc that will allow us to make that distinction without horrible if-ladders. For now we directly plug in the existing intel_surf_alignment() and intel_cursor_alignment()

[PATCH 1/9] drm: Rename drm_plane_check_pixel_format() to drm_plane_has_format()

2024-05-13 Thread Ville Syrjala
From: Ville Syrjälä Rename drm_plane_check_pixel_format() to drm_plane_has_format() and change the return type accordingly. Allows one to write more natural code. Also matches drm_any_plane_has_format() better. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_atomic.c| 7 ++-

[PATCH 2/9] drm: Export drm_plane_has_format()

2024-05-13 Thread Ville Syrjala
From: Ville Syrjälä Export drm_plane_has_format() so that drivers can use it. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/drm_crtc_internal.h | 2 -- drivers/gpu/drm/drm_plane.c | 1 + include/drm/drm_plane.h | 2 ++ 3 files changed, 3 insertions(+), 2 deletions(-)

[PATCH 0/9] drm/i915: Polish plane surface alignment handling

2024-05-13 Thread Ville Syrjala
From: Ville Syrjälä intel_surf_alignment() in particular has devolved into a complete mess. Redesign the code so that we can handle alignment restrictions in a nicer. Also adjust alignment for TGL+ to actually match the hardware requirements. Ville Syrjälä (9): drm: Rename

[PATCH v2 13/16] drm/i915: Refactor skl+ plane register offset calculations

2024-05-13 Thread Ville Syrjala
From: Ville Syrjälä Currentluy every skl+ plane register defines some intermediate macros to calculate the final register offset. Pull all of that into common macros, simplifying the final register offset stuff into just five defines: - raw register offsets for the planes 1 and 2 on pipes A and

[PATCH v2 12/16] drm/i915: Drop a few unwanted tabs from skl+ plane reg defines

2024-05-13 Thread Ville Syrjala
From: Ville Syrjälä A few extra tabs have snuck into the skl+ plane register bit definitions. Remove them. v2: Rebase Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/skl_universal_plane_regs.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)

[PATCH v2 11/16] drm/i915: Use REG_BIT for PLANE_WM bits

2024-05-13 Thread Ville Syrjala
From: Ville Syrjälä A couple of PLANE_WM bits were still using the hand rolled (1< Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/skl_universal_plane_regs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

[PATCH v2 10/16] drm/i915: Shuffle the skl+ plane register definitions

2024-05-13 Thread Ville Syrjala
From: Ville Syrjälä Rearrange the plane skl+ universal plane register definitions: - keep everything related to the same register in one place - sort based on register offset - unify the whitespace/etc a bit v2: Define register contents after all offsets (Jani) Cc: Jani Nikula Signed-off-by:

[PATCH v2 09/16] drm/i915: Drop useless PLANE_FOO_3 register defines

2024-05-13 Thread Ville Syrjala
From: Ville Syrjälä We only need register defines for the first two planes on the first two pipes. Nuke everything else. v2: Drop a few more that snuck through Reviewed-by: Jani Nikula #v1 Signed-off-by: Ville Syrjälä --- .../i915/display/skl_universal_plane_regs.h | 19

[PATCH 16/16] drm/i915: Handle SKL+ WM/DDB registers next to all other plane registers

2024-05-10 Thread Ville Syrjala
From: Ville Syrjälä Having the plane WM/DDB regitster write functions in skl_watermarks.c is rather annoying when trying to implement DSB based plane updates. Move them into the respective files that handle all other plane register writes. Less places where I need to worry about the DSB vs. MMIO

[PATCH 15/16] drm/i915: Nuke skl_write_wm_level() and skl_ddb_entry_write()

2024-05-10 Thread Ville Syrjala
From: Ville Syrjälä Get rid of skl_ddb_entry_write() and skl_write_wm_level() and just call intel_de_write_fw() directly. This is prep work towards DSB based plane updates where these wrappers are more of a hinderance. Done with cocci mostly: @@ expression D, R, L; @@ - skl_write_wm_level(D,

[PATCH 14/16] drm/i915: Extract skl_plane_{wm,ddb}_reg_val()

2024-05-10 Thread Ville Syrjala
From: Ville Syrjälä Extract helpers to calculate the final wm/ddb register values for skl+. Will allow me to more cleanly remove the register write wrappers for these registers. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/skl_watermark.c | 29 +--- 1 file

[PATCH 13/16] drm/i915: Refactor skl+ plane register offset calculations

2024-05-10 Thread Ville Syrjala
From: Ville Syrjälä Currentluy every skl+ plane register defines some intermediate macros to calculate the final register offset. Pull all of that into common macros, simplifying the final register offset stuff into just five defines: - raw register offsets for the planes 1 and 2 on pipes A and

[PATCH 12/16] drm/i915: Drop a few unwanted tabs from skl+ plane reg defines

2024-05-10 Thread Ville Syrjala
From: Ville Syrjälä A few extra tabs have snuck into the skl+ plane register bit definitions. Remove them. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/skl_universal_plane_regs.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git

[PATCH 11/16] drm/i915: Use REG_BIT for PLANE_WM bits

2024-05-10 Thread Ville Syrjala
From: Ville Syrjälä A couple of PLANE_WM bits were still using the hand rolled (1< --- drivers/gpu/drm/i915/display/skl_universal_plane_regs.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/display/skl_universal_plane_regs.h

[PATCH 10/16] drm/i915: Shuffle the skl+ plane register definitions

2024-05-10 Thread Ville Syrjala
From: Ville Syrjälä Rearrange the plane skl+ universal plane register definitions: - keep everything related to the same register in one place - sort based on register offset - unify the whitespace/etc a bit Signed-off-by: Ville Syrjälä --- .../i915/display/skl_universal_plane_regs.h | 502

[PATCH 09/16] drm/i915: Drop useless PLANE_FOO_3 register defines

2024-05-10 Thread Ville Syrjala
From: Ville Syrjälä We only need register defines for the first two planes on the first two pipes. Nuke everything else. Signed-off-by: Ville Syrjälä --- .../gpu/drm/i915/display/skl_universal_plane_regs.h | 12 1 file changed, 12 deletions(-) diff --git

[PATCH 08/16] drm/i915/gvt: Use PLANE_CTL and PLANE_SURF defines

2024-05-10 Thread Ville Syrjala
From: Ville Syrjälä Stop hand rolling PLANE_CTL and PLANE_SURF for the third plane and just use the real thing. Cc: Zhenyu Wang CC: Zhi Wang Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_gvt_mmio_table.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff

[PATCH 07/16] drm/i915/gvt: Use the full PLANE_KEY*() defines

2024-05-10 Thread Ville Syrjala
From: Ville Syrjälä Stop hand rolling PLANE_KEY*() register defines and just use the real thing. Cc: Zhenyu Wang CC: Zhi Wang Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_gvt_mmio_table.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git

[PATCH 06/16] drm/i915/gvt: Use the proper PLANE_AUX_OFFSET() define

2024-05-10 Thread Ville Syrjala
From: Ville Syrjälä Stop hand rolling PLANE_AUX_OFFSET() and just use the real thing. Cc: Zhenyu Wang CC: Zhi Wang Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/gvt/handlers.c | 24 ++--- drivers/gpu/drm/i915/gvt/reg.h | 2 --

[PATCH 05/16] drm/i915/gvt: Use the proper PLANE_AUX_DIST() define

2024-05-10 Thread Ville Syrjala
From: Ville Syrjälä Stop hand rolling PLANE_AUX_DIST() and just use the real thing. Cc: Zhenyu Wang CC: Zhi Wang Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/gvt/handlers.c | 24 ++--- drivers/gpu/drm/i915/gvt/reg.h | 1 -

[PATCH 04/16] drm/i915: Move skl+ wm/ddb registers to proper headers

2024-05-10 Thread Ville Syrjala
From: Ville Syrjälä On SKL+ the watermark/DDB registers are proper per-plane registers. Move the definitons to their respective files. Cc: Zhenyu Wang CC: Zhi Wang Signed-off-by: Ville Syrjälä --- .../gpu/drm/i915/display/intel_cursor_regs.h | 20 +

[PATCH 03/16] drm/i915: Extract intel_cursor_regs.h

2024-05-10 Thread Ville Syrjala
From: Ville Syrjälä Move most cursor register definitions into their own file. Declutters i915_reg.h a bit more. Cc: Zhenyu Wang CC: Zhi Wang Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_cursor.c | 1 + .../gpu/drm/i915/display/intel_cursor_regs.h | 78

[PATCH 02/16] drm/i915: Extract skl_universal_plane_regs.h

2024-05-10 Thread Ville Syrjala
From: Ville Syrjälä Move most of the SKL+ universal plane register definitions into their own file. Declutters i915_reg.h a bit more. Cc: Zhenyu Wang CC: Zhi Wang Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_display.c | 1 +

[PATCH 01/16] drm/i915: Nuke _MMIO_PLANE_GAMC()

2024-05-10 Thread Ville Syrjala
From: Ville Syrjälä _MMIO_PLANE_GAMC() is some leftover macro that is never used. Get rid of it. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/i915_reg.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index

[PATCH 00/16] drm/i915: skl+ plane register stuff

2024-05-10 Thread Ville Syrjala
From: Ville Syrjälä Bunch of refactoring around skl+ plane registers. Ville Syrjälä (16): drm/i915: Nuke _MMIO_PLANE_GAMC() drm/i915: Extract skl_universal_plane_regs.h drm/i915: Extract intel_cursor_regs.h drm/i915: Move skl+ wm/ddb registers to proper headers drm/i915/gvt: Use the

[PATCH v2 8/9] drm/i915: Cleanup fbdev fb setup

2024-05-10 Thread Ville Syrjala
From: Ville Syrjälä We use a mix of 'intel_fb' vs. 'ifbdev->fb' in the same function. Both should be pointing at the same thing. Make things less confusing by just getting existing fb from 'ifbdev->fb' at the start and then sticking with the local 'fb' (renamed from the 'intel_fb') until the

[PATCH v2 7/9] drm/i915: Change intel_fbdev_fb_alloc() return type

2024-05-10 Thread Ville Syrjala
From: Ville Syrjälä Change intel_fbdev_fb_alloc() to return struct intel_fb instead of struct drm_framebuffer. Let's us eliminate some annoying aliasing variables in the fbdev setup code. v2: Assing the results to the correct variable (Jani) Fix xe's copy Signed-off-by: Ville Syrjälä ---

[PATCH] drm/xe: Nuke xe's copy of intel_fbdev_fb.h

2024-05-06 Thread Ville Syrjala
From: Ville Syrjälä For some reason xe and i915 each have an identical (fortunately) copy of intel_fbdev_fb.h. The xe copy actually only gets included by xe's intel_fbdev_fb.c, and the i915 copy by everyone else, include intel_fbdev.c which is the actual caller of the functions declared in the

[PATCH 9/9] drm/i915: Rename the fb pinning functions to indicate the address space

2024-05-06 Thread Ville Syrjala
From: Ville Syrjälä Rename the fb pinning functions such that their name directly informs us what gets pinned into which address space. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_dpt.c | 6 +-- drivers/gpu/drm/i915/display/intel_dpt.h | 6 +--

[PATCH 8/9] drm/i915: Cleanup fbdev fb setup

2024-05-06 Thread Ville Syrjala
From: Ville Syrjälä We use a mix of 'fb' vs. 'ifbdev->fb' in the same function. Both should be pointing at the same thing. Make things less confusing by just getting existing fb from 'ifbdev->fb' at the start and then sticking with the local 'fb' until the very end. And we'll also change

[PATCH 7/9] drm/i915: Change intel_fbdev_fb_alloc() reuturn type

2024-05-06 Thread Ville Syrjala
From: Ville Syrjälä Change intel_fbdev_fb_alloc() to return struct intel_fb instead of struct drm_framebuffer. Let's us eliminate some annoying aliasing variables in the fbdev setup code. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_fbdev.c| 10 +-

[PATCH 6/9] drm/i915: Constify 'fb' in during pinning

2024-05-06 Thread Ville Syrjala
From: Ville Syrjälä Make the 'fb' pointers const in the pinning code. We never want to mutate these. Also nuke a few aliasing fb vs. intel_fb cases by just using the more specific type everywhere in the same function. Signed-off-by: Ville Syrjälä ---

[PATCH 5/9] drm/i915: Polish types in fb calculations

2024-05-06 Thread Ville Syrjala
From: Ville Syrjälä Be a bit more consistent in our use of integer types in the fb related calculatiosn. u32 we generally only use for ggtt offsets and such, and everything else can be regular (unsigned) ints. There's also an overabundance of consts for local variables in

[PATCH 4/9] drm/i915: Extract intel_plane_needs_physical()

2024-05-06 Thread Ville Syrjala
From: Ville Syrjälä Pull the "does this plane need a physical address?" check into a small helper. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_atomic_plane.c | 8 drivers/gpu/drm/i915/display/intel_atomic_plane.h | 1 +

[PATCH 3/9] drm/i915: Drop 'uses_fence' parameter from intel_pin_fb_obj_dpt()

2024-05-06 Thread Ville Syrjala
From: Ville Syrjälä Fence regions are only relevant for GGTT, not DPT. Drop the pointless 'uses_fence' argument from intel_pin_fb_obj_dpt(). Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_fb_pin.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git

[PATCH 2/9] drm/i915: Clean up skl+ plane stride limits

2024-05-06 Thread Ville Syrjala
From: Ville Syrjälä skl_plane_max_stride() is pretty messy. Streamline it and split it into clear skl+ vs. adl+ variants. TODO: Deal with icl and tgl strude limits properly Signed-off-by: Ville Syrjälä --- .../drm/i915/display/skl_universal_plane.c| 65 +++ 1 file

[PATCH 1/9] drm/i915: Split gen2 vs. gen3 .max_stride()

2024-05-06 Thread Ville Syrjala
From: Ville Syrjälä Plane .max_stride() is alreayd a vfunc so having one made up of two branches based on the display version is silly. Split i9xx_plane_max_stride() into gen2 vs. gen3 variants so that we get rid of said check. Signed-off-by: Ville Syrjälä ---

[PATCH 0/9] drm/i915: Plane fb refactoring

2024-05-06 Thread Ville Syrjala
From: Ville Syrjälä A bit of cleanup/refactoring around plane fb stuff. This is mainly prep work for a slightly bigger rework of alignment handling. Ville Syrjälä (9): drm/i915: Split gen2 vs. gen3 .max_stride() drm/i915: Clean up skl+ plane stride limits drm/i915: Drop 'uses_fence'

[PATCH 35/35] drm/i915/bios: Define VBT block 253 (PRD Table) contents

2024-05-03 Thread Ville Syrjala
From: Ville Syrjälä Define the contents of VBT block 253 (PRD Table). Unfortunately the block has two definitions, with the cutoff supposedly happening on ICL vs. TGL. Also according to some notes it might be that the VBIOS (if that's still a thing) still uses the old definition even on TGL+.

[PATCH 34/35] drm/i915/bios: Define VBT block 252 (int15 Hook)

2024-05-03 Thread Ville Syrjala
From: Ville Syrjälä Declare that VBT block 252 is the "int15 hook". This is some VBIOS only juju so don't bother with a full definition. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_vbt_defs.h | 1 + 1 file changed, 1 insertion(+) diff --git

[PATCH 33/35] drm/i915/bios: Define VBT block 55 (Compression Parameters)

2024-05-03 Thread Ville Syrjala
From: Ville Syrjälä Define the contents of the obsolete VBT block 55 (Compression Parameters). This was some early attempt at defining the compression parameters. However the spec says: "This block is obsolete and should not be consumed for any compression programming." Block 56 is the

[PATCH 32/35] drm/i915/bios: Define VBT block 50 (MIPI) contents

2024-05-03 Thread Ville Syrjala
From: Ville Syrjälä Define the contents of VBT block 50 (MIPI). This was some easly attempt at a MIPI DSI stuff. I'm not sure this was ever actually used (I certainly don't have any VBTs with this block), but here's some kind of definition for it anyway. Signed-off-by: Ville Syrjälä ---

[PATCH 31/35] drm/i915/bios: Define VBT block 57 (Vswing PreEmphasis Table) contents

2024-05-03 Thread Ville Syrjala
From: Ville Syrjälä Define the contents of VBT block 57 (Vswing PreEmphasis Table). The contents is highly platform specific. The columns of the table corresponding to some set of PHY/etc registers. The rows corresponding to all legal vswing+pre-emphasis combinations (ie. should be 10 rows in

[PATCH 30/35] drm/i915/bios: Define VBT block 55 (RGB Palette Table) contents

2024-05-03 Thread Ville Syrjala
From: Ville Syrjälä Define the contents of VBT block 55 (RGB Palette Table). Note that I've not actually seen any real world VBTs with this block. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_vbt_defs.h | 12 1 file changed, 12 insertions(+) diff --git

[PATCH 29/35] drm/i915/bios: Define VBT block 51 (Fixed Set Mode Table) contents

2024-05-03 Thread Ville Syrjala
From: Ville Syrjälä Define the contents of VBT block 51 (Fixed Set Mode Table). Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_vbt_defs.h | 11 +++ 1 file changed, 11 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_vbt_defs.h

[PATCH 28/35] drm/i915/bios: Define VBT block 46 (Chromaticity For Narrow Gamut Panel) contents

2024-05-03 Thread Ville Syrjala
From: Ville Syrjälä Define the contents of VBT block 46 (Chromaticity For Narrow Gamut Panel). One entry per panel. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_vbt_defs.h | 26 +++ 1 file changed, 26 insertions(+) diff --git

[PATCH 27/35] drm/i915/bios: Define VBT block 45 (eDP BFI) contents

2024-05-03 Thread Ville Syrjala
From: Ville Syrjälä Define the contents of VBT block 45 (eDP BFI). Note that I've not actually seen any real world VBTs with this block. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_vbt_defs.h | 17 + 1 file changed, 17 insertions(+) diff --git

[PATCH 26/35] drm/i915/bios: Define VBT block 28 (EFP DTD) contents

2024-05-03 Thread Ville Syrjala
From: Ville Syrjälä Define the contents of VBT block 28 (EFP DTD). Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_vbt_defs.h | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_vbt_defs.h

[PATCH 25/35] drm/i915/bios: Define VBT block 26 (TV Options) contents

2024-05-03 Thread Ville Syrjala
From: Ville Syrjälä Define the contents of VBT block 26 (TV Options). Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_vbt_defs.h | 12 1 file changed, 12 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_vbt_defs.h

[PATCH 24/35] drm/i915/bios: Define VBT block 25 (SDVO LVDS PPS) contents

2024-05-03 Thread Ville Syrjala
From: Ville Syrjälä Define the contents of VBT block 25 (SDVO LVDS PPS). Not 100% sure about the order of the fields as this is not documented in the VBT spec anymore, but this order matches what is included as part of the power sequencing SDVO commands (struct sdvo_panel_power_sequencing).

[PATCH 23/35] drm/i915/bios: Define VBT block 24 (SDVO LVDS PnP ID) contents

2024-05-03 Thread Ville Syrjala
From: Ville Syrjälä Define the contents of VBT block 24 (SDVO LVDS PnP ID). The descriotion is not part of the VBT spec anymore, but the layout is rather obsvious. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_vbt_defs.h | 8 1 file changed, 8 insertions(+)

[PATCH 22/35] drm/i915/bios: Define VBT block 21 (EFP List) contents

2024-05-03 Thread Ville Syrjala
From: Ville Syrjälä Define the contents of VBT block 21 (EFP List). Specs are nowhere to be found, but real world data suggests that each entry is just the first four bytes of the EDID PnP ID structure. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_vbt_defs.h | 15

[PATCH 21/35] drm/i915/bios: Define VBT block 20 (OEM Customizable Modes) contents

2024-05-03 Thread Ville Syrjala
From: Ville Syrjälä Define the contents of VBT block 20 (OEM Customizable Modes). Each entry is either 26 or 28 bytes, depending on the BDB version. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_vbt_defs.h | 24 +++ 1 file changed, 24 insertions(+) diff

[PATCH 20/35] drm/i915/bios: Define VBT blocks 19, 30, 32 (Display Configuration Removal Table) contents

2024-05-03 Thread Ville Syrjala
From: Ville Syrjälä Define the contenst is VBT blocks 19,30,32 (Display Configuration Removal Table) contents. There are three variants of this block: pre-IVB, IVB, HSW+, with each having slightly different entries. Curiously many HSW/BDW machines seem to have both the IVB and HSW+ variants in

[PATCH 19/35] drm/i915/bios: Define VBT blocks 16, 29, 31 (Toggle List) contents

2024-05-03 Thread Ville Syrjala
From: Ville Syrjälä Define the contenst is VBT blocks 16,19,31 (Toggle List). There are three variants of this block: pre-IVB, IVB, HSW+, with each having slightly different entries. Curiously many HSW/BDW machines seem to have both the IVB and HSW+ variants in their VBTs simultanously. No idea

[PATCH 16/35] drm/i915/bios: Define ALM only VBT block 9 contents

2024-05-03 Thread Ville Syrjala
From: Ville Syrjälä For some reason ALM VBT has two dot clock override tables. One as the normal block 15 and a second one as block 9. The table in block 9 has no row_size/num_rows information. On my Fujitsu Lifebook S6010 only the block 9 table has actual data in it. Block 15 is present but

[PATCH 18/35] drm/i915/bios: Define VBT block 18 (Driver Rotation) contents

2024-05-03 Thread Ville Syrjala
From: Ville Syrjälä Define the contents of block 18 (Driver Rotation). Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_vbt_defs.h | 12 1 file changed, 12 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_vbt_defs.h

[PATCH 17/35] drm/i915/bios: Define VBT block 17 (SV Test Functions) contents

2024-05-03 Thread Ville Syrjala
From: Ville Syrjälä Define the contents of VBT block 17 (SV Test Functions). Nothing real here for us, but might as well define it for completeness. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_vbt_defs.h | 9 + 1 file changed, 9 insertions(+) diff --git

[PATCH 15/35] drm/i915/bios: Define VBT block 15 (Dot Clock Override Table) contents

2024-05-03 Thread Ville Syrjala
From: Ville Syrjälä Define the contents of VBT block 15 (Dot Clock Override Table) The contents were reverse engineered by intuition. The gen2 stuff seems solid as I can verify that against real world VBT data. The gen3 stuff less so as all the gen3+ VBTs I have just filla the entire block with

[PATCH 14/35] drm/i915/bios: Define VBT block 12 (Driver Persistent Algorithm) contents

2024-05-03 Thread Ville Syrjala
From: Ville Syrjälä Define the contents of VBT block 12 (Driver Persistent Algorithm). Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_vbt_defs.h | 19 +++ 1 file changed, 19 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_vbt_defs.h

[PATCH 13/35] drm/i915/bios: Define VBT block 10 (Mode Removal Table) contents

2024-05-03 Thread Ville Syrjala
From: Ville Syrjälä Define the contents of VBT block 10 (Mode Removal Table). There seem to be two variants: - 8 byte entries for desktop systems - 10 byte entries for mobile systems, with the extra panel_flags being a bitmask of LFPs It seems starting from HSW only the mobile variant is

  1   2   3   4   5   6   7   8   9   10   >