Matt Roper
202b1f4c12
drm/i915/gt: Move engine registers to their own header
...
Let's continue breaking up and cleaning up the massive i915_reg.h file
by moving all registers that are defined in relation to an engine base
to their own header.
There are probably a bunch of other "engine registers" that we haven't
moved yet (especially those that belong to the render engine in the
0x2??? range), but this is a relatively straightforward first step.
Cc: Jani Nikula <jani.nikula@linux.intel.com >
Signed-off-by: Matt Roper <matthew.d.roper@intel.com >
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220111051600.3429104-8-matthew.d.roper@intel.com
2022-01-11 14:03:25 -08:00
Matt Roper
2b25a93bf0
drm/i915: Introduce i915_reg_defs.h
...
We'd like to start splitting i915_reg.h into various domain-specific
register files and cleaning them up. Let's move the basic macros and
type definitions to their own header file that can be including in each
of the new split headers.
Cc: Jani Nikula <jani.nikula@linux.intel.com >
Signed-off-by: Matt Roper <matthew.d.roper@intel.com >
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220111051600.3429104-7-matthew.d.roper@intel.com
2022-01-11 14:03:21 -08:00
Matt Roper
ab076d8d79
drm/i915: Replace GFX_MODE_GEN7 with RING_MODE_GEN7
...
It's preferable to use parameterized register macros where possible.
Cc: Jani Nikula <jani.nikula@linux.intel.com >
Signed-off-by: Matt Roper <matthew.d.roper@intel.com >
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220111051600.3429104-6-matthew.d.roper@intel.com
2022-01-11 13:45:40 -08:00
Matt Roper
3e5cbecb9a
drm/i915: Use RING_PSMI_CTL rather than per-engine macros
...
We have a parameterized macro for RING_PSMI_CTL; let's use that instead
of the per-engine definitions where possible.
Cc: Jani Nikula <jani.nikula@linux.intel.com >
Signed-off-by: Matt Roper <matthew.d.roper@intel.com >
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220111051600.3429104-5-matthew.d.roper@intel.com
2022-01-11 13:45:39 -08:00
Matt Roper
e0d47fcff1
drm/i915: Parameterize ECOSKPD
...
Combine the separate render and blitter register definitions into a
single definition. We already know we have some workarounds on an
upcoming platform that will need to update the ECOSKPD register for
other engines too, so this helps pave the way for that.
Cc: Jani Nikula <jani.nikula@linux.intel.com >
Signed-off-by: Matt Roper <matthew.d.roper@intel.com >
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220111051600.3429104-4-matthew.d.roper@intel.com
2022-01-11 13:45:39 -08:00
Matt Roper
cd5d2fdb04
drm/i915: Parameterize PWRCTX_MAXCNT
...
Rather than having separate definitions for each engine, create a single
parameterized macro that takes the engine base offset. This will also
ensure we get to the proper offset if we ever need to use these
registers on newer platforms (where the media engine offsets have
changed).
Cc: Jani Nikula <jani.nikula@linux.intel.com >
Signed-off-by: Matt Roper <matthew.d.roper@intel.com >
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220111051600.3429104-3-matthew.d.roper@intel.com
2022-01-11 13:45:38 -08:00
Matt Roper
e9f9bcd598
drm/i915: Use parameterized GPR register definitions everywhere
...
Since we have an engine-parameterized macro GEN8_RING_CS_GPR, let's use
that in place of the HSW_CS_GPR and BCS_GPR register definitions.
Cc: Jani Nikula <jani.nikula@linux.intel.com >
Signed-off-by: Matt Roper <matthew.d.roper@intel.com >
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220111051600.3429104-2-matthew.d.roper@intel.com
2022-01-11 13:45:37 -08:00
Clint Taylor
583998c5e8
drm/i915/snps: vswing value refined for SNPS phys
...
Updated new values from BSPEC.
Bspec: 53920
Cc: Jani Nikula <jani.nikula@intel.com >
Cc: José Roberto de Souza <jose.souza@intel.com >
Cc: Imre Deak <imre.deak@intel.com >
Signed-off-by: Clint Taylor <clinton.a.taylor@intel.com >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220110234520.6836-1-clinton.a.taylor@intel.com
2022-01-11 10:49:30 +02:00
Jani Nikula
b4435717f5
drm/i915: split out vlv sideband registers from i915_reg.h
...
Add a dedicated file vlv_sideband_reg.h for the VLV/CHV sideband
registers. The sideband registers macros are needed by the same files
that need vlv_sideband.h, so include the definitions from there.
v2: Fix copyright year (Matt)
Cc: Matt Roper <matthew.d.roper@intel.com >
Reviewed-by: Matt Roper <matthew.d.roper@intel.com >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220110095740.166078-2-jani.nikula@intel.com
2022-01-10 16:17:50 +02:00
Jani Nikula
7e470f103d
drm/i915: split out PCI config space registers from i915_reg.h
...
The PCI config space registers don't really belong next to the MMIO
register definitions.
v2: Fix copyright year (Matt)
Cc: Matt Roper <matthew.d.roper@intel.com >
Reviewed-by: Matt Roper <matthew.d.roper@intel.com >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220110095740.166078-1-jani.nikula@intel.com
2022-01-10 16:17:46 +02:00
Jani Nikula
386e75a414
drm/i915: split out gem/i915_gem_tiling.h from i915_drv.h
...
We already have the gem/i915_gem_tiling.c file.
Acked-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/8073a429ed1f8ade9c0cc8a6ed1a0f82183100c5.1641561552.git.jani.nikula@intel.com
2022-01-10 15:43:23 +02:00
Jani Nikula
db583eea5a
drm/i915: split out gem/i915_gem_userptr.h from i915_drv.h
...
We already have the gem/i915_gem_userptr.c file.
Acked-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/c29f66604ebd973b8eff1cce7d7c53615a26480f.1641561552.git.jani.nikula@intel.com
2022-01-10 15:43:19 +02:00
Jani Nikula
2ef97818d3
drm/i915: split out i915_gem_evict.h from i915_drv.h
...
We already have the i915_gem_evict.c file.
v2: Fixed commit message (Tvrtko)
Acked-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/ec666853171d04daeb21a93083940df36907c343.1641561552.git.jani.nikula@intel.com
2022-01-10 15:43:12 +02:00
Jani Nikula
23d639d7b6
drm/i915: split out i915_cmd_parser.h from i915_drv.h
...
We already have the i915_cmd_parser.c file.
Acked-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/1a02b8788266f4f2fd4de12808b55c4a66179e98.1641561552.git.jani.nikula@intel.com
2022-01-10 15:43:09 +02:00
Jani Nikula
2564c35df5
drm/i915: split out i915_getparam.h from i915_drv.h
...
We already have the i915_getparam.c file.
Acked-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/27f3af2298c3cdd3cb2839c2a9a52237248e087a.1641561552.git.jani.nikula@intel.com
2022-01-10 15:43:05 +02:00
Harish Chegondi
814d5c51f8
drm/i915: Fix possible NULL pointer dereferences in i9xx_update_wm()
...
Check return pointer from intel_crtc_for_plane() before dereferencing
it, as it can be NULL.
v2: Moved the NULL check into intel_crtc_active().
Cc: Jani Nikula <jani.nikula@intel.com >
Cc: Caz Yokoyama <caz.yokoyama@intel.com >
Cc: Radhakrishna Sripada <radhakrishna.sripada@intel.com >
Signed-off-by: Harish Chegondi <harish.chegondi@intel.com >
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
Signed-off-by: Matt Roper <matthew.d.roper@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20211217160255.1300348-1-harish.chegondi@intel.com
2022-01-07 13:33:51 -08:00
Jani Nikula
80dfdeb750
drm/i915: stop including i915_irq.h from i915_drv.h
...
Only include i915_irq.h where actually needed.
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Acked-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220105102131.988791-1-jani.nikula@intel.com
2022-01-05 17:57:06 +02:00
Anisse Astier
0b464ca3e0
drm: Add orientation quirk for GPD Win Max
...
Panel is 800x1280, but mounted on a laptop form factor, sideways.
Signed-off-by: Anisse Astier <anisse@astier.eu >
Reviewed-by: Hans de Goede <hdegoede@redhat.com >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20211229222200.53128-3-anisse@astier.eu
2021-12-31 12:14:19 +02:00
Anisse Astier
e35d8762b0
drm/i915/opregion: add support for mailbox #5 EDID
...
The ACPI OpRegion Mailbox #5 ASLE extension may contain an EDID to be
used for the embedded display. Add support for using it via by adding
the EDID to the list of available modes on the connector, and use it for
eDP when available.
If a panel's EDID is broken, there may be an override EDID set in the
ACPI OpRegion mailbox #5 . Use it if available.
Fixes the GPD Win Max display.
Based on original patch series by: Jani Nikula <jani.nikula@intel.com >
https://patchwork.kernel.org/project/intel-gfx/patch/20200828061941.17051-1-jani.nikula@intel.com/
Changes:
- EDID is copied and validated with drm_edid_is_valid
- EDID is now only used as a fallback.
- squashed the two patches
Cc: Jani Nikula <jani.nikula@intel.com >
Cc: Uma Shankar <uma.shankar@intel.com >
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com >
Co-developed-by: Jani Nikula <jani.nikula@intel.com >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Signed-off-by: Anisse Astier <anisse@astier.eu >
Link: https://patchwork.freedesktop.org/patch/msgid/20211229222200.53128-2-anisse@astier.eu
2021-12-31 12:13:54 +02:00
Andy Shevchenko
f7747be141
drm/i915/dsi: Drop double check ACPI companion device for NULL
...
acpi_dev_get_resources() does perform the NULL pointer check against
ACPI companion device which is given as function parameter. Thus,
there is no need to duplicate this check in the caller.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20211222154033.6770-1-andriy.shevchenko@linux.intel.com
2021-12-27 12:46:14 +02:00
Ville Syrjälä
798c5daf3c
drm/i915/fbc: Remember to update FBC state even when not reallocating CFB
...
We mustn't forget to update our FBC state even if we don't have
to reallocate the CFB. Otherwise we won't refresh our notion
of what eg. the new fence or the new override CFB stride
should be. Using the wrong CFB stride in particular can cause
underruns and could even corrupt other stuff in stolen.
Fixes: f4cfdbb02c ("drm/i915/fbc: Nuke state_cache")
Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/4774
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20211216110822.8461-1-ville.syrjala@linux.intel.com
Reviewed-by: Mika Kahola <mika.kahola@intel.com >
2021-12-23 14:06:32 +02:00
Jani Nikula
980f42e7d5
drm/i915/bios: fix slab-out-of-bounds access
...
If VBT size is not a multiple of 4, the last 4-byte store will be out of
bounds of the allocated buffer. Spotted with KASAN. Round up the
allocation size.
v2: Use round_up() intead of roundup() as it's a power of 2 (Thomas)
Reported-by: Thomas Hellström <thomas.hellstrom@linux.intel.com >
Fixes: a36e7dc0af ("drm/i915/dg1: Read OPROM via SPI controller")
Cc: Clint Taylor <clinton.a.taylor@intel.com >
Cc: Lucas De Marchi <lucas.demarchi@intel.com >
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20211222081654.1843211-1-jani.nikula@intel.com
2021-12-23 12:05:42 +02:00
Ville Syrjälä
825ca9ed1c
drm: Always include the debugfs dentry in drm_crtc
...
Remove the counterproductive CONFIG_DEBUG_FS ifdef and just include
the debugfs dentry in drm_crtc always. This way we don't need
annoying ifdefs in the actual code with DEBUGFS=n. Also we don't
have these ifdefs around any of the other debugfs dentries either
so can't see why drm_crtc should be special.
This fixes the i915 DEBUGFS=n build because I assumed the dentry
would always be there.
Cc: Jani Nikula <jani.nikula@intel.com >
Reported-by: Nathan Chancellor <nathan@kernel.org >
Tested-by: Nathan Chancellor <nathan@kernel.org >
Fixes: e74c6aa955 ("drm/i915/fbc: Register per-crtc debugfs files")
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20211221193754.12287-1-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
Acked-by: Daniel Vetter <daniel@ffwll.ch >
2021-12-22 22:46:33 +02:00
Tejas Upadhyay
7e28d0b267
drm/i915/adl-n: Enable ADL-N platform
...
Adding PCI device ids and enabling ADL-N platform.
ADL-N from i915 point of view is subplatform of ADL-P.
BSpec: 68397
Changes since V2:
- Added version log history
Changes since V1:
- replace IS_ALDERLAKE_N with IS_ADLP_N - Jani Nikula
Signed-off-by: Tejas Upadhyay <tejaskumarx.surendrakumar.upadhyay@intel.com >
Reviewed-by: Anusha Srivatsa <anusha.srivatsa@intel.com >
Acked-by: Thomas Gleixner <tglx@linutronix.de >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20211210051802.4063958-1-tejaskumarx.surendrakumar.upadhyay@intel.com
2021-12-20 15:42:33 +02:00
Clint Taylor
a36e7dc0af
drm/i915/dg1: Read OPROM via SPI controller
...
Read OPROM SPI through MMIO and find VBT entry since we can't use
OpRegion and PCI mapping may not work on some systems due to most BIOSes
not leaving the Option ROM mapped.
v2: Remove message with allocation failure
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com >
Cc: Tomas Winkler <tomas.winkler@intel.com >
Signed-off-by: Clint Taylor <clinton.a.taylor@intel.com >
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Acked-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20211216062645.3477854-1-lucas.demarchi@intel.com
2021-12-16 08:39:06 -08:00
Hans de Goede
d0c0cf22d7
drm/i915: Remove unused intel_gmbus_set_speed() function
...
The intel_gmbus_set_speed() function is not used anywhere, remove it.
Note drivers/gpu/drm/gma500 has its own copy called
gma_intel_gmbus_set_speed() which is used, the intel_gmbus_set_speed()
version in the i915 code is not used at all
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20211121191001.252076-1-hdegoede@redhat.com
2021-12-16 16:17:01 +01:00
Hans de Goede
637088a21e
drm/i915/backlight: Make ext_pwm_disable_backlight() call intel_backlight_set_pwm_level()
...
At least the Bay Trail LPSS PWM controller used with DSI panels on many
Bay Trail tablets seems to leave the PWM pin in whatever state it was
(high or low) ATM that the PWM gets disabled. Combined with some panels
not having a separate backlight-enable pin this leads to the backlight
sometimes staying on while it should not (when the pin was high during
PWM-disabling).
First calling intel_backlight_set_pwm_level() will ensure that the pin
is always low (or high for inverted brightness panels) since the passed
in duty-cycle is 0% (or 100%) when the PWM gets disabled fixing the
backlight sometimes staying on.
With the exception of ext_pwm_disable_backlight() all other
foo_disable_backlight() functions call intel_backlight_set_pwm_level()
already before disabling the backlight, so this change also aligns
ext_pwm_disable_backlight() with all the other disable() functions.
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
Acked-by: Jani Nikula <jani.nikula@intel.com >
Reviewed-by: Lyude Paul <lyude@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20211121110032.4720-2-hdegoede@redhat.com
2021-12-16 16:16:22 +01:00
Ville Syrjälä
e74c6aa955
drm/i915/fbc: Register per-crtc debugfs files
...
Expose FBC debugfs files for each crtc. These may or may not point
to the same FBC instance depending on the platform.
We leave the old global debugfs files in place until
igt catches up to the new per-crtc approach.
v2: Take a trip via intel_crtc_debugfs_add() (Jani)
Cc: Jani Nikula <jani.nikula@intel.com >
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20211213151435.9700-1-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
2021-12-15 17:02:40 +02:00
Ville Syrjälä
b8ca477e51
drm/i915/fbc: Introduce device info fbc_mask
...
Declare which FBC instances are present via a fbc_mask
in device info. For the moment there is just the one.
TODO: Need to figure out how to expose multiple FBC
instances in debugs. Just different file names, or move
the files under some subdirectory (per-crtc maybe), or
something else? This will need igt changes as well.
v2: Put the mask into device_info.display (Jani)
Put the magic pipe->fbc thing into skl_fbc_id_for_pipe() (Jani)
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20211213134450.3082-4-ville.syrjala@linux.intel.com
2021-12-15 17:02:23 +02:00
Ville Syrjälä
c2a9682d22
drm/i915/fbc: Loop through FBC instances in various places
...
Convert i915->fbc into an array in preparation for
multiple FBC instances, and loop through all instances
in all places where the caller does not know which
instance(s) (if any) are relevant. This is the case
for eg. frontbuffer tracking and FIFO underrun hadling.
v2: More intel_ namespace (Jani)
Leave out debugfs for later
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20211213134450.3082-3-ville.syrjala@linux.intel.com
2021-12-15 17:02:13 +02:00
Ville Syrjälä
ae361eb07e
drm/i915/fbc: Parametrize FBC register offsets
...
Parametrize ilk+ FBC register offsets based on the FBC instance.
v2: More intel_ namespace (Jani)
v3: Don't break gvt (Jani)
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20211214184616.1410-1-ville.syrjala@linux.intel.com
2021-12-15 17:01:37 +02:00
Jani Nikula
a908db6d98
drm/i915/cdclk: move struct intel_cdclk_funcs to intel_cdclk.c
...
The funcs struct can be opaque, make it internal to intel_cdclk.c.
Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20211213114106.296017-2-jani.nikula@intel.com
2021-12-14 20:41:30 +02:00
Jani Nikula
cce936f4ff
drm/i915/cdclk: turn around i915_drv.h and intel_cdclk.h dependency
...
intel_cdclk.h only needs i915_drv.h for struct intel_cdclk_config. Move
the definition to intel_cdclk.h and turn the includes around to avoid
including i915_drv.h from other headers.
The intel cdclk state macros in intel_cdclk.h still reference struct
drm_i915_private, but as macros they don't strictly require the
definition until they are used.
v2: Expand on the commit message wrt cdclk state macros
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20211213114106.296017-1-jani.nikula@intel.com
2021-12-14 20:41:21 +02:00
Mark Brown
96db14432d
drm/i915: Fix implicit use of struct pci_dev
...
intel_device_info.h references struct pci_dev but does not ensure that
the struct has been declared, causing build failures if something in
other headers changes so that the implicit dependency it is relying on
is no longer satisfied:
In file included from drivers/gpu/drm/i915/intel_device_info.h:32,
from drivers/gpu/drm/i915/gt/uc/intel_uc_fw.h:11,
from drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c:11:
drivers/gpu/drm/i915/display/intel_display.h:643:39: error: 'struct pci_dev' declared inside parameter list will not be visible outside of this definition or declaration [-Werror]
643 | bool intel_modeset_probe_defer(struct pci_dev *pdev);
| ^~~~~~~
cc1: all warnings being treated as errors
Add a declaration of the struct to fix this.
Signed-off-by: Mark Brown <broonie@kernel.org >
Fixes: 94b541f53d ("drm/i915: Add intel_modeset_probe_defer() helper")
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20211213170753.3680209-1-broonie@kernel.org
2021-12-14 10:38:29 +02:00
Ville Syrjälä
6678916dfa
drm/i915: Move pipe/transcoder/abox masks under intel_device_info.display
...
Collect the dipslay related mask under the display sub-structure
in intel_device_info.
Note that there is a slight change in behaviour in that we zero
out .display entirely when !HAS_DISPLAY (aka. pipe_mask==0), so
now we also zero out the other masks (although cpu_transocder_mask
should already be zero of pipe_mask is zero). abox_mask is
only used by the display core init when HAS_DISPLAY is true, so
the actual behaviour of the system shouldn't change despite the
zeroing of these masks.
There is a lot more display stuff directly in device info that
could be moved over. Maybe someone else will be inspired to do it...
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20211210122726.12577-1-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
2021-12-13 14:58:28 +02:00
Jani Nikula
2bebea57c2
drm/i915/cdclk: hide struct intel_cdclk_vals
...
The definition is not needed outside of intel_cdclk.c.
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/f7e7e7fb91eae2b49a0ab5d982a235cec34e3320.1639068649.git.jani.nikula@intel.com
2021-12-13 12:28:04 +02:00
Jani Nikula
754d6275e9
drm/i915/cdclk: move intel_atomic_check_cdclk() to intel_cdclk.c
...
Rename to intel_cdclk_atomic_check() and make
intel_cdclk_bw_calc_min_cdclk() static.
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/43ad4d437121f43d76c790ac5d4d131743d58988.1639068649.git.jani.nikula@intel.com
2021-12-13 12:27:55 +02:00
Jani Nikula
a09147188f
drm/i915/pxp: remove useless includes
...
Not needed.
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/01c4ea0cea17eead027c83dc9eaca3c181ce3a24.1639142167.git.jani.nikula@intel.com
2021-12-13 12:05:10 +02:00
Jani Nikula
ee0ff28a49
drm/i915/pxp: un-inline intel_pxp_is_enabled()
...
In the interest of reducing include dependencies, un-inline
intel_pxp_is_enabled().
v2: Fix build for CONFIG_DRM_I915_PXP=n
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/36bbb3708f3b1f84f0718afff94212dde93cb479.1639142167.git.jani.nikula@intel.com
2021-12-13 12:05:06 +02:00
Jani Nikula
0cdbab89c0
drm/i915/fb: reduce include dependencies
...
We actually need i915_active_types.h, not i915_active.h.
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/aed5f1afda4448ec46c7ff1f95291edebf355790.1639142167.git.jani.nikula@intel.com
2021-12-13 12:04:59 +02:00
Jani Nikula
14567eed87
drm/i915/fbc: avoid intel_frontbuffer.h include with declaration
...
Reduce include dependencies using forward declarations.
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/fb54050e03f830a1b29eb14cb37466f39c499cc2.1639142167.git.jani.nikula@intel.com
2021-12-13 12:04:56 +02:00
Jani Nikula
1aad06f892
drm/i915/psr: avoid intel_frontbuffer.h include with declaration
...
Reduce include dependencies using forward declarations.
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/ee35f2f01f731c21f24a238f2d1690b09ac2da1f.1639142167.git.jani.nikula@intel.com
2021-12-13 12:04:54 +02:00
Jani Nikula
c7c2918849
drm/i915/active: remove useless i915_utils.h include
...
Not needed.
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/52b1cf56c16bf669a1357ce81d9232c5480914a4.1639142167.git.jani.nikula@intel.com
2021-12-13 12:04:44 +02:00
Jani Nikula
35291c9c02
drm/i915/reset: include intel_display.h instead of intel_display_types.h
...
Use the more specific include that's needed.
v2: Include intel_display.h (Ville)
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/e1e195b8ca1252d1e149c8185d107a5517496973.1639142167.git.jani.nikula@intel.com
2021-12-13 12:04:38 +02:00
Harshit Mogalapalli
87bb2a410d
drm/i915/display: Fix an unsigned subtraction which can never be negative.
...
smatch warning:
drivers/gpu/drm/i915/display/intel_dmc.c:601 parse_dmc_fw() warn:
unsigned 'fw->size - offset' is never less than zero
Firmware size is size_t and offset is u32. So the subtraction is
unsigned which can never be less than zero.
Fixes: 3d5928a168 ("drm/i915/xelpd: Pipe A DMC plugging")
Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com >
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com >
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20211210044129.12422-1-harshit.m.mogalapalli@oracle.com
2021-12-12 20:55:37 -08:00
Hans de Goede
6306d8dbfa
drm/i915: Add privacy-screen support (v3)
...
Add support for eDP panels with a built-in privacy screen using the
new drm_privacy_screen class.
Changes in v3:
- Move drm_privacy_screen_get() call to intel_ddi_init_dp_connector()
Changes in v2:
- Call drm_connector_update_privacy_screen() from
intel_enable_ddi_dp() / intel_ddi_update_pipe_dp() instead of adding a
for_each_new_connector_in_state() loop to intel_atomic_commit_tail()
- Move the probe-deferral check to the intel_modeset_probe_defer() helper
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20211005202322.700909-11-hdegoede@redhat.com
2021-12-09 16:09:46 +01:00
Hans de Goede
94b541f53d
drm/i915: Add intel_modeset_probe_defer() helper
...
The upcoming privacy-screen support adds another check for
deferring probe till some other drivers have bound first.
Factor out the current vga_switcheroo_client_probe_defer() check
into an intel_modeset_probe_defer() helper, so that further
probe-deferral checks can be added there.
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Signed-off-by: Hans de Goede <hdegoede@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20211005202322.700909-10-hdegoede@redhat.com
2021-12-09 16:09:35 +01:00
Ville Syrjälä
7d41745acf
drm/i915: s/intel_get_first_crtc/intel_first_crtc/
...
Since we got rid of the "_get_" from intel_get_crtc_for_pipe()
let's do the same for intel_get_first_crtc() for consistency.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20211203112029.1057-3-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
2021-12-09 16:18:30 +02:00
Ville Syrjälä
927167f37f
drm/i915: Relocate intel_crtc_for_plane()
...
Move intel_crtc_for_plane() next to its only user. No one
else should ever use this.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20211203112029.1057-2-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
2021-12-09 16:18:30 +02:00
Ville Syrjälä
cbb8a79571
drm/i915: Nuke {pipe,plane}_to_crtc_mapping[]
...
These plane/pipe->crtc mapping arrays are rather pointless.
Get rid of them and just iterate the lists instead.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20211203112029.1057-1-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
2021-12-09 16:18:30 +02:00