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

2024-06-12 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 v2 8/9] drm/i915: Update plane alignment requirements for TGL+

2024-06-12 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. v2: Don't screw up DPT+semiplanar 2MiB alignment

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

2024-06-12 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). Reviewed-by: Imre Deak Signed-off-by: Ville Syrjälä ---

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

2024-06-12 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. Reviewed-by: Imre Deak Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/i9xx_plane.c | 69 -

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

2024-06-12 Thread Ville Syrjala
From: Ville Syrjälä Split intel_cursor_alignment() into per-platform variants. Reviewed-by: Imre Deak Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_cursor.c | 40 +++-- drivers/gpu/drm/i915/display/intel_fb.c | 16 -

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

2024-06-12 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 is satisfactory to all those planes. So far this was sort of handle by

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

2024-06-12 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 v2 1/9] drm: Rename drm_plane_check_pixel_format() to drm_plane_has_format()

2024-06-12 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. Reviewed-by: Jani Nikula Signed-off-by: Ville Syrjälä ---

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

2024-06-12 Thread Ville Syrjala
From: Ville Syrjälä Export drm_plane_has_format() so that drivers can use it. Reviewed-by: Jani Nikula 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

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

2024-06-12 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. v2: Drop the per-plane vma stuff as it was borked

[PATCH 2/2] drm/doc: Document that userspace should utilize CRTCs bottom up

2024-06-12 Thread Ville Syrjala
From: Ville Syrjälä At leat on Intel GPUs it is best to allocate CRTCs bottom up as it will generally lead to lower power consumption. Recommend userspace does so. Not sure if this is strictly the best order for other hardware, but drivers could always rearrange the CRTC list into some kind of

[PATCH 1/2] drm/doc: Document drm_get_encoder ioctl more thoroughly

2024-06-12 Thread Ville Syrjala
From: Ville Syrjälä Document all the fields of the drm_get_encoder ioctl. Cc: Simon Ser Cc: Daniel Stone Signed-off-by: Ville Syrjälä --- Documentation/gpu/drm-uapi.rst | 13 + include/uapi/drm/drm_mode.h| 22 +- 2 files changed, 34 insertions(+), 1

[PATCH 10/11] drm/i915/dsb: Document that the ATS fault bits are for mtl+

2024-06-11 Thread Ville Syrjala
From: Ville Syrjälä The ATS faults have something to do with some new iommu stuff on mtl+. Document that the relevant DSB interrupt bits aren't valid for earlier platforms. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_dsb_regs.h | 4 ++-- 1 file changed, 2

[PATCH 11/11] drm/i915/dsb: Try to document that DSB_STATUS bit 16 is level triggered

2024-06-11 Thread Ville Syrjala
From: Ville Syrjälä DSB_STATUS bit 16 is supposed to be a sticky bit informing us whether the DSB was idle or not when the pipe's delayed vblank (when double buffered registers latch) occurred. Unfortunately it turns out this is a level triggred signal, ie. the bit will be set whenever the DSB

[PATCH 09/11] drm/i915: Drop useless intel_dsb.h include

2024-06-11 Thread Ville Syrjala
From: Ville Syrjälä intel_crtc.c doens't need intel_dsb.h so don't include it. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_crtc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/gpu/drm/i915/display/intel_crtc.c b/drivers/gpu/drm/i915/display/intel_crtc.c

[PATCH 07/11] drm/i915/dsb: Convert the DSB code to use intel_display rather than i915

2024-06-11 Thread Ville Syrjala
From: Ville Syrjälä The future direction will be to mainly use intel_display rather than i915 in the display code. Start on that path for the DSB code. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_dsb.c | 52 1 file changed, 26 insertions(+), 26

[PATCH 08/11] drm/i915/dsb: Add i915.enable_dsb module parameter

2024-06-11 Thread Ville Syrjala
From: Ville Syrjälä As we extend the use of DSB for critical pipe/plane register programming, it'll be nice to have an escape valve at hand, in case things go very poorly. To that end, add a i915.enable_dsb modparam by which we can force the driver to take the pure mmio path instead.

[PATCH 06/11] drm/i915/dsb: Plumb the whole atomic state into intel_dsb_prepare()

2024-06-11 Thread Ville Syrjala
From: Ville Syrjälä The DSB code will need to examine both the old and new crtc states. Pass in the whole atomic state so we can dig up what we need. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_color.c | 2 +- drivers/gpu/drm/i915/display/intel_dsb.c | 11

[PATCH 05/11] drm/i915: Pass the whole atomic state to intel_color_prepare_commit()

2024-06-11 Thread Ville Syrjala
From: Ville Syrjälä We'll have need to examine both the old and new crtc states in intel_color_prepare_commit(), so let's just pass in the whole atomic state. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_color.c | 11 ---

[PATCH 04/11] drm/i915: Introduce intel_mode_vdisplay()

2024-06-11 Thread Ville Syrjala
From: Ville Syrjälä The DSB code will need to know the hardware's idea of vertical active, as that is also what defines the start of undelayed vblank. Introduce a helper that gives us that information, in line with the other intel_mode_v*() functions. Signed-off-by: Ville Syrjälä ---

[PATCH 03/11] drm/i915: Add flip done tracepoint

2024-06-11 Thread Ville Syrjala
From: Ville Syrjälä Add a tracepoint to see exactly when async flips complete. Signed-off-by: Ville Syrjälä --- .../gpu/drm/i915/display/intel_display_irq.c | 1 + .../drm/i915/display/intel_display_trace.h| 23 +++ 2 files changed, 24 insertions(+) diff --git

[PATCH 02/11] drm/i915: Add async flip tracepoint

2024-06-11 Thread Ville Syrjala
From: Ville Syrjälä Add a separate tracepoint for async flips vs. sync plane updates to make it a bit easier to figure out what is happening. Signed-off-by: Ville Syrjälä --- .../gpu/drm/i915/display/intel_atomic_plane.c | 22 +++ .../gpu/drm/i915/display/intel_atomic_plane.h | 4

[PATCH 01/11] drm/i915: Extract intel_crtc_arm_vblank_event()

2024-06-11 Thread Ville Syrjala
From: Ville Syrjälä We'll need to arm the vblank event also from the future DSB based codepath. Extract the function that does the whold dance for us. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_crtc.c | 29 +++

[PATCH 00/11] drm/i915/dsb: DSB prep stuff

2024-06-11 Thread Ville Syrjala
From: Ville Syrjälä More prep work extracted from my upcoming DSB based plane programming series. Ville Syrjälä (11): drm/i915: Extract intel_crtc_arm_vblank_event() drm/i915: Add async flip tracepoint drm/i915: Add flip done tracepoint drm/i915: Introduce intel_mode_vdisplay()

[PATCH 2/2] drm/i915/bios: Define the "luminance and gamma" sub-struct of block 46

2024-06-05 Thread Ville Syrjala
From: Ville Syrjälä Since BDB version 211 block 46 has included more luminance and gamma related information. Define it fully. The data is semi-based on DisplayID v2.0 apparently. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_vbt_defs.h | 12 1 file changed,

[PATCH 1/2] drm/i915/bios: Define block 46 chromaticity coordinates properly

2024-06-05 Thread Ville Syrjala
From: Ville Syrjälä The VBT spec does a very poor job of defining how the chromaticity coordinates in block 46 are laid out. After double checking the Windows implementation it turns out these more or less match the EDID definition, where the 10bit values are split into 2bit + 8bit chunks.

[PATCH] drm/i915: Reduce DDI clock gating printk level from NOTICE to DEBUG

2024-06-05 Thread Ville Syrjala
From: Ville Syrjälä No idea why the DDI clock gating print is done with drm_notice(). Just use drm_dbg_kms() since no one is going to be interested in this under normal circumstances. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_ddi.c | 6 +++--- 1 file changed, 3

[PATCH 7/7] drm/i915: Enable plane/pipeDMC ATS fault interrupts on mtl

2024-06-05 Thread Ville Syrjala
From: Ville Syrjälä MTL has some new IOMMU thing that has a few new fault interrupts. Enable those so we can know if things are going poorly. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_display_irq.c | 10 ++ drivers/gpu/drm/i915/i915_reg.h |

[PATCH 6/7] drm/i915: Enable pipeDMC fault interrupts on tgl+

2024-06-05 Thread Ville Syrjala
From: Ville Syrjälä PipeDMC has its own fault interrupt. Enable that so that we can know if things are failing. While at it, define the other pipeDMC interrupt as well, even though we're not currently using it. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_display_irq.c

[PATCH 5/7] drm/i915: Nuke the intermediate pipe fault bitmasks

2024-06-05 Thread Ville Syrjala
From: Ville Syrjälä GEN8_DE_PIPE_IRQ_FAULT_ERRORS & co. don't really achieve anything. Get rid of them and just declare all the bits directly in gen8_de_pipe_fault_mask(). Signed-off-by: Ville Syrjälä --- .../gpu/drm/i915/display/intel_display_irq.c | 26 ---

[PATCH 4/7] drm/i915: Extend GEN9_PIPE_PLANE_FLIP_DONE() to cover all universal planes

2024-06-05 Thread Ville Syrjala
From: Ville Syrjälä GEN9_PIPE_PLANE_FLIP_DONE() only works for planes 1-4. Extend it handle planes 5-7 as well. Somewhat annoyingly the bits are spread around into two distinct clumps. Currently this doesn't achieve anything, but if we ever extend async flip support to more than just the first

[PATCH 3/7] drm/i915: Sort bdw+ pipe interrupt bits

2024-06-05 Thread Ville Syrjala
From: Ville Syrjälä It's really hard to figure out which bdw+ pipe interrupt bits we've defined and which we have not. Sort the defines to make that a bit easier (still not super easy since the bits have been shuffled a bit over the years). Signed-off-by: Ville Syrjälä ---

[PATCH 2/7] drm/i915: Document bdw+ pipe interrupt bits

2024-06-05 Thread Ville Syrjala
From: Ville Syrjälä Sprinkle some notes indicating which platforms have which pipe interrupt bits. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/i915_reg.h | 42 - 1 file changed, 21 insertions(+), 21 deletions(-) diff --git

[PATCH 1/7] drm/i915: Use REG_BIT() for bdw+ pipe interrupts

2024-06-05 Thread Ville Syrjala
From: Ville Syrjälä Replace the hand rolled (1< --- drivers/gpu/drm/i915/i915_reg.h | 54 - 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index 0569a23b83b2..6b77de060e33 100644

[PATCH 0/7] drm/i915: bdw+ pipe interrupt stuff

2024-06-05 Thread Ville Syrjala
From: Ville Syrjälä Clean up the bdw+ pipe interrupt bits, and enable some new fault interrupts on tgl+ and mtl+. Ville Syrjälä (7): drm/i915: Use REG_BIT() for bdw+ pipe interrupts drm/i915: Document bdw+ pipe interrupt bits drm/i915: Sort bdw+ pipe interrupt bits drm/i915: Extend

[PATCH 5/7] drm/i915: Document which platforms have which CRC registers

2024-05-31 Thread Ville Syrjala
From: Ville Syrjälä Sprinkle some comments around to indicate which CRC registers are valid for which platforms. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_pipe_crc_regs.h | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git

[PATCH 7/7] drm/i915: Protect CRC reg macro arguments for consistency

2024-05-31 Thread Ville Syrjala
From: Ville Syrjälä It's probably a good idea to start protecting all macro arguments to avoid any cargo-cult mistakes when people go looking for examples of how to define these things. Signed-off-by: Ville Syrjälä --- .../drm/i915/display/intel_pipe_crc_regs.h| 26 +-- 1

[PATCH 4/7] drm/i915: Add a separate defintiion for PIPE_CRC_RES_HSW

2024-05-31 Thread Ville Syrjala
From: Ville Syrjälä On hsw+ we only have one CRC result registers, instead of the five we have on ivb, and some of the others have been repurposed to serve other CRC related purposed. Since the hsw+ vs. pre-hsw register operate quite diffently let's add a separate definition for the hsw+

[PATCH 6/7] drm/i915: Define the PIPE_CRC_EXP registers

2024-05-31 Thread Ville Syrjala
From: Ville Syrjälä I need a scratch register which fill the following requirements: - can be accessed via DSB - all the bits can be read/written - no serious side effects So far the only thing I could think of is the "expected CRC" register. Add the definition so I can use it. While I only

[PATCH 1/7] drm/i915: Extract intel_pipe_crc_regs.h

2024-05-31 Thread Ville Syrjala
From: Ville Syrjälä The CRC registers are a pretty self contained bunch. Extract them to a separate header to declutter i915_reg.h. Signed-off-by: Ville Syrjälä --- .../gpu/drm/i915/display/intel_display_irq.c | 1 + drivers/gpu/drm/i915/display/intel_pipe_crc.c | 1 +

[PATCH 2/7] drm/i915: Switch PIPE_CRC_RES_*_IVB to _MMIO_PIPE()

2024-05-31 Thread Ville Syrjala
From: Ville Syrjälä PIPE_CRC_RES_*_IVB are proper pipe registers, and only valid for IVB+ where pipe register blocks are equally spaced, so we can switch from _MMIO_TRANS2() to the simpler _MMIO_PIPE() for these. Signed-off-by: Ville Syrjälä ---

[PATCH 3/7] drm/i915: Regroup pipe CRC regs

2024-05-31 Thread Ville Syrjala
From: Ville Syrjälä Put all the definitions related to a single pipe CRC register in one place, instead of the current approach where things are spread all over the place. Signed-off-by: Ville Syrjälä --- .../drm/i915/display/intel_pipe_crc_regs.h| 43 ++- 1 file changed,

[PATCH 0/7] drm/i915: Clean up the CRC registers

2024-05-31 Thread Ville Syrjala
From: Ville Syrjälä Polish the CRC register defintions. I really meant to just add one new register definition, but the whole thing ballooned a bit... Ville Syrjälä (7): drm/i915: Extract intel_pipe_crc_regs.h drm/i915: Switch PIPE_CRC_RES_*_IVB to _MMIO_PIPE() drm/i915: Regroup pipe CRC

[PATCH 4/4] drm/i915/dsb: Use intel_color_uses_dsb()

2024-05-31 Thread Ville Syrjala
From: Ville Syrjälä Use intel_color_uses_dsb() instead of open coding it in intel_vblank_evade_init(). Make the logic around DSB a bit more isolated from the rest of the code. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_vblank.c | 4 +++- 1 file changed, 3

[PATCH 3/4] drm/i915/dsb: Pass DSB engine ID to intel_dsb_prepare()

2024-05-31 Thread Ville Syrjala
From: Ville Syrjälä Allow the caller of intel_dsb_prepare() to determine which DSB engine (out of the three possible per pipe) to use. This will let us utilize multiple DSB engines during the same commit. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_color.c | 2 +-

[PATCH 2/4] drm/i915/dsb: Move DSB ID definition to the header

2024-05-31 Thread Ville Syrjala
From: Ville Syrjälä We're going to need to make the DSB ID visible outside the DSB code, so that we eg. can use multiple DSB engines in parallel. to that end move the definition to intel_dsb.h. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_dsb.c | 8

[PATCH 1/4] drm/i915/dsb: Polish the DSB ID enum

2024-05-31 Thread Ville Syrjala
From: Ville Syrjälä Namespace the DSB ID enum properly, and make the naming match other such enums in general. Also make the names 0 based as that's what Bspec uses for DSB (unlike eg. planes where it uses 1 based indexing). We'll throw out INVALID_DSB while at it since we have no use for it at

[PATCH 0/4] drm/i915/dsb: A bit of polish

2024-05-31 Thread Ville Syrjala
From: Ville Syrjälä Apply a bit of polish to the DSB interface. Ville Syrjälä (4): drm/i915/dsb: Polish the DSB ID enum drm/i915/dsb: Move DSB ID definition to the header drm/i915/dsb: Pass DSB engine ID to intel_dsb_prepare() drm/i915/dsb: Use intel_color_uses_dsb()

[PATCH 6/7] drm/i915: Switch intel_usecs_to_scanlines() to 64bit maths

2024-05-28 Thread Ville Syrjala
From: Ville Syrjälä Dotclocks can reach ~1GHz these days, so intel_usecs_to_scanlines(), with its 32bit maths, is currently limited to a few milliseconds. I want bigger numbers in DSB selftests, so switch over to 64bit maths. Signed-off-by: Ville Syrjälä ---

[PATCH 7/7] drm/i915/dsb: Convert dewake_scanline to a hw scanline number earlier

2024-05-28 Thread Ville Syrjala
From: Ville Syrjälä Currently we switch from out software idea of a scanline to the hw's idea of a scanline during the commit phase in _intel_dsb_commit(). While that is slightly easier due to fastsets fiddling with the timings, we'll also need to generate proper hw scanline numbers already when

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

2024-05-28 Thread Ville Syrjala
From: Ville Syrjälä Extract intel_mode_vblank_end() in the same vein as intel_mode_vblank_start(). While we have only one use of this it seems nicer to unify the approach. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_vblank.c | 16

[PATCH 5/7] drm/i915: Move intel_crtc_scanline_offset()

2024-05-28 Thread Ville Syrjala
From: Ville Syrjälä I want to use intel_crtc_scanline_offset() in intel_crtc_scanline_to_hw(). Relocate intel_crtc_scanline_offset() a bit to avoid a forward declaration. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_vblank.c | 76 ++--- 1 file changed,

[PATCH 4/7] drm/i915: Simplify scanline_offset handling for gen2

2024-05-28 Thread Ville Syrjala
From: Ville Syrjälä Currently intel_crtc_scanline_offset() is careful to always return a positive offset. That is not actually necessary as long as we take care of negative values when applying the offset in __intel_get_crtc_scanline(). This simplifies intel_crtc_scanline_offset(), and makes

[PATCH 3/7] drm/i915: Extract intel_mode_vtotal()

2024-05-28 Thread Ville Syrjala
From: Ville Syrjälä We have several copies of code calculating the hardware's idea of vtotal. Pull that to a helper, similar to intel_mode_vblank_{start,end}(). Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_vblank.c | 40 +

[PATCH 1/7] drm/i915: Reuse intel_mode_vblank_start()

2024-05-28 Thread Ville Syrjala
From: Ville Syrjälä Replace a few hand rolled copies of intel_mode_vblank_start() with the real thing. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_dsb.c| 10 +++--- drivers/gpu/drm/i915/display/intel_vblank.c | 9 +++--

[PATCH 0/7] drm/i915: Cleanups around scanline arithmetic

2024-05-28 Thread Ville Syrjala
From: Ville Syrjälä A few cleanups around parts what deal with scanline numbers. Ville Syrjälä (7): drm/i915: Reuse intel_mode_vblank_start() drm/i915: Extract intel_mode_vblank_end() drm/i915: Extract intel_mode_vtotal() drm/i915: Simplify scanline_offset handling for gen2 drm/i915:

[PATCH 3/3] drm/i915: Plumb the full atomic state into skl_ddb_add_affected_planes()

2024-05-28 Thread Ville Syrjala
From: Ville Syrjälä skl_ddb_add_affected_planes() needs the full atomic state. Instead of digging that out from dubious sources plumb it in explicitly. The wm counterpart (skl_wm_add_affected_planes()) already does things in the proper way. Signed-off-by: Ville Syrjälä ---

[PATCH 2/3] drm/i915: Plumb the full atomic state into icl_check_nv12_planes()

2024-05-28 Thread Ville Syrjala
From: Ville Syrjälä icl_check_nv12_planes() needs the full atomic state. Instead of digging that out from dubious sources plumb it in explicitly. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_display.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-)

[PATCH 1/3] drm/i915/cdclk: Plumb the full atomic state deeper

2024-05-28 Thread Ville Syrjala
From: Ville Syrjälä Various parts of the cdclk code need access the full atomic state. Currently it's being dug out via the cdclk_state->base.state pointer, which is not great as that pointer isn't always valid. Instead plumb the full atomic state from the top so that it's clear that it is in

[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(-)

  1   2   3   4   5   6   7   8   9   10   >