Marek Vasut
2ba5b68326
drm/bridge: ti-sn65dsi83: Handle dsi_lanes == 0 as invalid
...
Handle empty data-lanes = < >; property, which translates to
dsi_lanes = 0 as invalid.
Fixes: ceb515ba29 ("drm/bridge: ti-sn65dsi83: Add TI SN65DSI83 and SN65DSI84 driver")
Signed-off-by: Marek Vasut <marex@denx.de >
Cc: Jonas Karlman <jonas@kwiboo.se >
Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com >
Cc: Lucas Stach <l.stach@pengutronix.de >
Cc: Marek Vasut <marex@denx.de >
Cc: Maxime Ripard <maxime@cerno.tech >
Cc: Neil Armstrong <narmstrong@baylibre.com >
Cc: Robert Foss <robert.foss@linaro.org >
Cc: Sam Ravnborg <sam@ravnborg.org >
Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com >
Reviewed-by: Lucas Stach <l.stach@pengutronix.de >
Signed-off-by: Robert Foss <robert.foss@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20220518233844.248504-1-marex@denx.de
2022-05-23 11:38:43 +02:00
Jani Nikula
0ea917819d
drm/i915/dsi: fix VBT send packet port selection for ICL+
...
The VBT send packet port selection was never updated for ICL+ where the
2nd link is on port B instead of port C as in VLV+ DSI.
First, single link DSI needs to use the configured port instead of
relying on the VBT sequence block port. Remove the hard-coded port C
check here and make it generic. For reference, see commit f915084edc
("drm/i915: Changes related to the sequence port no for") for the
original VLV specific fix.
Second, the sequence block port number is either 0 or 1, where 1
indicates the 2nd link. Remove the hard-coded port C here for 2nd
link. (This could be a "find second set bit" on DSI ports, but just
check the two possible options.)
Third, sanity check the result with a warning to avoid a NULL pointer
dereference.
Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/5984
Cc: stable@vger.kernel.org # v4.19+
Cc: Ville Syrjala <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/20220520094600.2066945-1-jani.nikula@intel.com
(cherry picked from commit 08c59dde71 )
2022-05-23 12:08:58 +03:00
Tvrtko Ursulin
8ec5c0006c
Merge tag 'drm-intel-next-2022-05-20' of git://anongit.freedesktop.org/drm/drm-intel into drm-intel-gt-next
...
drm/i915 drm-intel-next -> drm-intel-gt-next cross-merge sync
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
# Conflicts:
# drivers/gpu/drm/i915/gt/intel_rps.c
# drivers/gpu/drm/i915/i915_vma.c
From: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/87y1ywbh5y.fsf@intel.com
2022-05-23 09:34:47 +01:00
Bhanuprakash Modem
4cd79f614b
drm/amd/display: Move connector debugfs to drm
...
As drm_connector already have the display_info, instead of creating
"output_bpc" debugfs in vendor specific driver, move the logic to
the drm layer.
This patch will also move "Current" bpc to the crtc debugfs from
connector debugfs, since we are getting this info from crtc_state.
Cc: Harry Wentland <harry.wentland@amd.com >
Cc: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com >
Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com >
Reported-by: kernel test robot <lkp@intel.com >
Reviewed-by: Arun R Murthy <arun.r.murthy@intel.com >
Reviewed-by: Harry Wentland <harry.wentland@amd.com >
Acked-by: Harry Wentland <harry.wentland@amd.com >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220519095149.3560034-4-bhanuprakash.modem@intel.com
2022-05-23 11:27:44 +03:00
Bhanuprakash Modem
fa373eb219
drm/i915/display/debug: Expose crtc current bpc via debugfs
...
This new debugfs will expose the currently using bpc by crtc.
It is very useful for verifying whether we enter the correct
output color depth from IGT.
This patch will also add the connector's max supported bpc to
"i915_display_info" debugfs.
Example:
cat /sys/kernel/debug/dri/0/crtc-0/i915_current_bpc
Current: 8
Cc: Jani Nikula <jani.nikula@linux.intel.com >
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com >
Cc: Uma Shankar <uma.shankar@intel.com >
Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com >
Reviewed-by: Arun R Murthy <arun.r.murthy@intel.com >
Acked-by: Jani Nikula <jani.nikula@intel.com >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220519095149.3560034-3-bhanuprakash.modem@intel.com
2022-05-23 11:27:41 +03:00
Bhanuprakash Modem
67d935b471
drm/debug: Expose connector's max supported bpc via debugfs
...
It's useful to know the connector's max supported bpc for IGT
testing. Expose it via a debugfs file on the connector "output_bpc".
Example: cat /sys/kernel/debug/dri/0/DP-1/output_bpc
V2:
* Fix typo in comments (Harry)
Cc: Jani Nikula <jani.nikula@linux.intel.com >
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com >
Cc: Harry Wentland <harry.wentland@amd.com >
Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com >
Reviewed-by: Arun R Murthy <arun.r.murthy@intel.com >
Reviewed-by: Harry Wentland <harry.wentland@amd.com >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220519095149.3560034-2-bhanuprakash.modem@intel.com
2022-05-23 11:27:36 +03:00
Jani Nikula
08c59dde71
drm/i915/dsi: fix VBT send packet port selection for ICL+
...
The VBT send packet port selection was never updated for ICL+ where the
2nd link is on port B instead of port C as in VLV+ DSI.
First, single link DSI needs to use the configured port instead of
relying on the VBT sequence block port. Remove the hard-coded port C
check here and make it generic. For reference, see commit f915084edc
("drm/i915: Changes related to the sequence port no for") for the
original VLV specific fix.
Second, the sequence block port number is either 0 or 1, where 1
indicates the 2nd link. Remove the hard-coded port C here for 2nd
link. (This could be a "find second set bit" on DSI ports, but just
check the two possible options.)
Third, sanity check the result with a warning to avoid a NULL pointer
dereference.
Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/5984
Cc: stable@vger.kernel.org # v4.19+
Cc: Ville Syrjala <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/20220520094600.2066945-1-jani.nikula@intel.com
2022-05-23 10:58:32 +03:00
Borislav Petkov
6556551f88
drm/r128: Fix undefined behavior due to shift overflowing the constant
...
Fix:
drivers/gpu/drm/r128/r128_cce.c: In function ‘r128_do_init_cce’:
drivers/gpu/drm/r128/r128_cce.c:417:2: error: case label does not reduce to an integer constant
case R128_PM4_64BM_64VCBM_64INDBM:
^~~~
drivers/gpu/drm/r128/r128_cce.c:418:2: error: case label does not reduce to an integer constant
case R128_PM4_64PIO_64VCPIO_64INDPIO:
^~~~
See https://lore.kernel.org/r/YkwQ6%2BtIH8GQpuct@zn.tnic for the gory
details as to why it triggers with older gccs only.
Reviewed-by: Randy Dunlap <rdunlap@infradead.org >
Signed-off-by: Borislav Petkov <bp@suse.de >
Cc: David Airlie <airlied@linux.ie >
Cc: Daniel Vetter <daniel@ffwll.ch >
Cc: Alex Deucher <alexander.deucher@amd.com >
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Link: https://patchwork.freedesktop.org/patch/msgid/20220405151517.29753-5-bp@alien8.de
2022-05-21 18:02:47 +02:00
Marek Vasut
0b4c48f3e3
drm/bridge: tc358767: Make sure Refclk clock are enabled
...
The Refclk may be supplied by SoC clock output instead of crystal
oscillator, make sure the clock are enabled before any other action
is performed with the bridge chip, otherwise it may either fail to
operate at all, or miss reset GPIO toggle.
Reviewed-by: Lucas Stach <l.stach@pengutronix.de >
Fixes: 7caff0fc42 ("drm/bridge: tc358767: Add DPI to eDP bridge driver")
Signed-off-by: Marek Vasut <marex@denx.de >
Cc: Jonas Karlman <jonas@kwiboo.se >
Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com >
Cc: Lucas Stach <l.stach@pengutronix.de >
Cc: Marek Vasut <marex@denx.de >
Cc: Maxime Ripard <maxime@cerno.tech >
Cc: Neil Armstrong <narmstrong@baylibre.com >
Cc: Robert Foss <robert.foss@linaro.org >
Cc: Sam Ravnborg <sam@ravnborg.org >
Reviewed-by: Maxime Ripard <maxime@cerno.tech >
Link: https://patchwork.freedesktop.org/patch/msgid/20220520121543.11550-1-marex@denx.de
2022-05-21 17:58:55 +02:00
Marek Vasut
c1de02bbec
drm/bridge: tc358767: Report DSI-to-(e)DP as supported
...
The DSI-to-e(DP) mode is now supported, update the driver comment
to reflect this. No functional change.
Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com >
Reviewed-by: Lucas Stach <l.stach@pengutronix.de >
Fixes: 3080c21a04 ("drm/bridge: tc358767: Add DSI-to-(e)DP mode support")
Signed-off-by: Marek Vasut <marex@denx.de >
Cc: Jonas Karlman <jonas@kwiboo.se >
Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com >
Cc: Lucas Stach <l.stach@pengutronix.de >
Cc: Marek Vasut <marex@denx.de >
Cc: Maxime Ripard <maxime@cerno.tech >
Cc: Neil Armstrong <narmstrong@baylibre.com >
Cc: Robert Foss <robert.foss@linaro.org >
Cc: Sam Ravnborg <sam@ravnborg.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20220519095137.11896-2-marex@denx.de
2022-05-21 17:58:54 +02:00
Marek Vasut
0d66235092
drm/bridge: tc358767: Handle dsi_lanes == 0 as invalid
...
Handle empty data-lanes = < >; property, which translates to
dsi_lanes = 0 as invalid.
Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com >
Reviewed-by: Lucas Stach <l.stach@pengutronix.de >
Fixes: bbfd3190b6 ("drm/bridge: tc358767: Add DSI-to-DPI mode support")
Signed-off-by: Marek Vasut <marex@denx.de >
Cc: Jonas Karlman <jonas@kwiboo.se >
Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com >
Cc: Lucas Stach <l.stach@pengutronix.de >
Cc: Marek Vasut <marex@denx.de >
Cc: Maxime Ripard <maxime@cerno.tech >
Cc: Neil Armstrong <narmstrong@baylibre.com >
Cc: Robert Foss <robert.foss@linaro.org >
Cc: Sam Ravnborg <sam@ravnborg.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20220519095137.11896-1-marex@denx.de
2022-05-21 17:58:54 +02:00
Marek Vasut
edbc7960be
drm/bridge: ti-sn65dsi83: Handle dsi_lanes == 0 as invalid
...
Handle empty data-lanes = < >; property, which translates to
dsi_lanes = 0 as invalid.
Fixes: ceb515ba29 ("drm/bridge: ti-sn65dsi83: Add TI SN65DSI83 and SN65DSI84 driver")
Signed-off-by: Marek Vasut <marex@denx.de >
Cc: Jonas Karlman <jonas@kwiboo.se >
Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com >
Cc: Lucas Stach <l.stach@pengutronix.de >
Cc: Marek Vasut <marex@denx.de >
Cc: Maxime Ripard <maxime@cerno.tech >
Cc: Neil Armstrong <narmstrong@baylibre.com >
Cc: Robert Foss <robert.foss@linaro.org >
Cc: Sam Ravnborg <sam@ravnborg.org >
Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com >
Reviewed-by: Lucas Stach <l.stach@pengutronix.de >
Link: https://patchwork.freedesktop.org/patch/msgid/20220518233844.248504-1-marex@denx.de
2022-05-21 17:28:41 +02:00
Douglas Anderson
39c28cdfb7
drm/dp: Export symbol / kerneldoc fixes for DP AUX bus
...
While working on the DP AUX bus code I found a few small things that
should be fixed. Namely the non-devm version of
of_dp_aux_populate_ep_devices() was missing an export. There was also
an extra blank line in a kerneldoc and a kerneldoc that incorrectly
documented a return value. Fix these.
Fixes: aeb33699fc ("drm: Introduce the DP AUX bus")
Signed-off-by: Douglas Anderson <dianders@chromium.org >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20220510122726.v3.1.Ia91f4849adfc5eb9da1eb37ba79aa65fb3c95a0f@changeid
2022-05-20 13:25:00 -07:00
Dave Airlie
64eea6805e
Merge tag 'drm-intel-fixes-2022-05-20' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes
...
- fix for #5806 : GPU hangs and display artifacts on 5.18-rc3 on Intel GM45
- reject DMC with out-of-spec MMIO (Cc: stable)
- correctly mark guilty contexts on GuC reset.
Signed-off-by: Dave Airlie <airlied@redhat.com >
From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/YocqqvG6PbYx3QgJ@jlahtine-mobl.ger.corp.intel.com
2022-05-21 06:01:57 +10:00
Dave Airlie
6e4a61cd39
Merge tag 'drm-misc-fixes-2022-05-20' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes
...
Fix for a memory leak in dp_mst, a (userspace) build fix for
DMA_BUF_SET_NAME defines and a directory name generation fix for dmabuf
stats
Signed-off-by: Dave Airlie <airlied@redhat.com >
From: Maxime Ripard <maxime@cerno.tech >
Link: https://patchwork.freedesktop.org/patch/msgid/20220520072408.cpjzy2taugagvrh7@houat
2022-05-21 06:00:34 +10:00
Dale B Stimson
5f38c3fb55
drm/i915/pcode: Add a couple of pcode helpers
...
Some dGfx pcode commands take additional sub-commands and parameters. Add a
couple of helpers to help formatting these commands to improve code
readability.
v2: Fixed commit author (Rodrigo)
v3: Function rename and convert to new uncore interface for pcode functions
Remove unnecessary #define's (Andi)
v4: Another function rename
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com >
Signed-off-by: Dale B Stimson <dale.b.stimson@intel.com >
Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com >
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220519085732.1276255-3-tvrtko.ursulin@linux.intel.com
2022-05-20 09:11:45 +01:00
Ashutosh Dixit
ee421bb4cb
drm/i915/pcode: Extend pcode functions for multiple gt's
...
Each gt contains an independent instance of pcode. Extend pcode functions
to interface with pcode on different gt's. To avoid creating dependency of
display functionality on intel_gt, pcode function interfaces are exposed in
terms of uncore rather than intel_gt. Callers have been converted to pass
in the appropritate (i915 or intel_gt) uncore to the pcode functions.
v2: Expose pcode functions in terms of uncore rather than gt (Jani/Rodrigo)
v3: Retain previous function names to eliminate needless #defines (Rodrigo)
v4: Move out i915_pcode_init() to a separate patch (Tvrtko)
Remove duplicated drm_err/drm_dbg from intel_pcode_init() (Tvrtko)
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com >
Cc: Jani Nikula <jani.nikula@intel.com >
Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com >
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com >
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220519085732.1276255-2-tvrtko.ursulin@linux.intel.com
[tursulin: fixup merge conflict]
2022-05-20 09:11:27 +01:00
Ashutosh Dixit
85a040bc90
drm/i915: Introduce has_media_ratio_mode
...
Media ratio mode (the ability for media IP to work at a different frequency
from the GT) is available for a subset of dGfx platforms supporting
GuC/SLPC. Introduce 'has_media_ratio_mode' flag in intel_device_info to
identify these platforms and set it for XEHPSDV and DG2/ATS-M.
Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com >
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com >
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220519085732.1276255-1-tvrtko.ursulin@linux.intel.com
[tursulin: fixup merge conflict]
2022-05-20 09:11:06 +01:00
Tvrtko Ursulin
39921e5f00
Revert "drm/i915: Drop has_gt_uc from device info"
...
This reverts commit 222ff6db8a .
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com >
Acked-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220519090802.1294691-8-tvrtko.ursulin@linux.intel.com
2022-05-20 08:32:59 +01:00
Tvrtko Ursulin
fdbec9ff66
Revert "drm/i915: Drop has_rc6 from device info"
...
This reverts commit 218076abbc .
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com >
Acked-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220519090802.1294691-7-tvrtko.ursulin@linux.intel.com
2022-05-20 08:32:57 +01:00
Tvrtko Ursulin
b409db082d
Revert "drm/i915: Drop has_reset_engine from device info"
...
This reverts commit 922abe4d19 .
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com >
Acked-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220519090802.1294691-6-tvrtko.ursulin@linux.intel.com
2022-05-20 08:32:54 +01:00
Tvrtko Ursulin
3d6c72b7fd
Revert "drm/i915: Drop has_logical_ring_elsq from device info"
...
This reverts commit b6411373d3 .
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com >
Acked-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220519090802.1294691-5-tvrtko.ursulin@linux.intel.com
2022-05-20 08:32:52 +01:00
Tvrtko Ursulin
9d8d5a3917
Revert "drm/i915: Drop has_ddi from device info"
...
This reverts commit efd01cd3c2 .
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com >
Acked-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220519090802.1294691-4-tvrtko.ursulin@linux.intel.com
2022-05-20 08:32:49 +01:00
Tvrtko Ursulin
e91eec9128
Revert "drm/i915: Drop has_dp_mst from device info"
...
This reverts commit eb86f645ab .
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com >
Acked-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220519090802.1294691-3-tvrtko.ursulin@linux.intel.com
2022-05-20 08:32:45 +01:00
Tvrtko Ursulin
9602efab9f
Revert "drm/i915: Drop has_psr from device info"
...
This reverts commit b15a7357a8 .
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Acked-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com >
Acked-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220519090802.1294691-2-tvrtko.ursulin@linux.intel.com
2022-05-20 08:32:41 +01:00
Dave Airlie
0353682358
Merge tag 'msm-next-5.19-fixes' of https://gitlab.freedesktop.org/abhinavk/msm into drm-next
...
5.19 fixes for msm-next
- Limiting WB modes to max sspp linewidth
- Fixing the supported rotations to add 180 back for IGT
- Fix to handle pm_runtime_get_sync() errors to avoid unclocked access
in the bind() path for dpu driver
- Fix the irq_free() without request issue which was a big-time
hitter in the CI-runs.
Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com >
Signed-off-by: Dave Airlie <airlied@redhat.com >
From: Abhinav Kumar <quic_abhinavk@quicinc.com >
Link: https://patchwork.freedesktop.org/patch/msgid/b011d51d-d634-123e-bf5f-27219ee33151@quicinc.com
2022-05-20 16:35:52 +10:00
Dave Airlie
66ccd1d16e
Merge tag 'drm-misc-next-fixes-2022-05-19' of git://anongit.freedesktop.org/drm/drm-misc into drm-next
...
A device tree binding change for Rockchip VOP2
Signed-off-by: Dave Airlie <airlied@redhat.com >
From: Maxime Ripard <maxime@cerno.tech >
Link: https://patchwork.freedesktop.org/patch/msgid/20220519080556.42p52cya4u6y3kps@houat
2022-05-20 16:33:34 +10:00
Douglas Anderson
e7c254d75d
drm/probe-helper: For DP, add 640x480 if all other modes are bad
...
As per Displayport spec section 5.2.1.2 ("Video Timing Format") says
that all detachable sinks shall support 640x480 @60Hz as a fail safe
mode.
A DP compliance test expected us to utilize the above fact when all
modes it presented to the DP source were not achievable. It presented
only modes that would be achievable with more lanes and/or higher
speeds than we had available and expected that when we couldn't do
that then we'd fall back to 640x480 even though it didn't advertise
this size.
In order to pass the compliance test (and also support any users who
might fall into a similar situation with their display), we need to
add 640x480 into the list of modes. However, we don't want to add
640x480 all the time. Despite the fact that the DP spec says all sinks
_shall support_ 640x480, they're not guaranteed to support it
_well_. Continuing to read the spec you can see that the display is
not required to really treat 640x480 equal to all the other modes. It
doesn't need to scale or anything--just display the pixels somehow for
failsafe purposes. It should also be noted that it's not hard to find
a display hooked up via DisplayPort that _doesn't_ support 640x480 at
all. The HP ZR30w screen I'm sitting in front of has a native DP port
and doesn't work at 640x480. I also plugged in a tiny 800x480 HDMI
display via a DP to HDMI adapter and that screen definitely doesn't
support 640x480.
As a compromise solution, let's only add the 640x480 mode if:
* We're on DP.
* All other modes have been pruned.
This acknowledges that 640x480 might not be the best mode to use but,
since sinks are _supposed_ to support it, we will at least fall back
to it if there's nothing else.
Note that we _don't_ add higher resolution modes like 1024x768 in this
case. We only add those modes for a failed EDID read where we have no
idea what's going on. In the case where we've pruned all modes then
instead we only want 640x480 which is the only defined "Fail Safe"
resolution.
This patch originated in response to Kuogee Hsieh's patch [1].
[1] https://lore.kernel.org/r/1650671124-14030-1-git-send-email-quic_khsieh@quicinc.com
Signed-off-by: Douglas Anderson <dianders@chromium.org >
Tested-by: Kuogee Hsieh <quic_khsieh@quicinc.com >
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20220511155749.v3.2.I4ac7f55aa446699f8c200a23c10463256f6f439f@changeid
2022-05-19 17:17:32 -07:00
Douglas Anderson
4a2a13a57b
drm/probe-helper: Add helper for drm_helper_probe_single_connector_modes()
...
The drm_helper_probe_single_connector_modes() is a bit long. Let's
break a chunk off to update and validate modes. This helps avoid one
goto and also will allow us to more easily call the helper a second
time in a future patch without adding looping or another goto.
This change is intended to be a no-op change--just code movement.
Signed-off-by: Douglas Anderson <dianders@chromium.org >
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com >
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de >
Link: https://patchwork.freedesktop.org/patch/msgid/20220511155749.v3.1.I2dd93486c6952bd52f2020904de0133970d11b29@changeid
2022-05-19 17:16:57 -07:00
Thomas Zimmermann
4f093a527b
drm/gem: Warn on trying to use a non-existing framebuffer plane
...
Warn if callers of drm_gem_fb_get_obj() try to use a GEM buffer for
a non-existing or unset plane.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com >
Tested-by: Noralf Trønnes <noralf@tronnes.org >
Acked-by: Christian König <christian.koenig@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220517113327.26919-6-tzimmermann@suse.de
2022-05-19 19:25:23 +02:00
Thomas Zimmermann
a8d6e12725
drm/gem-vram: Ignore planes that are unused by framebuffer format
...
Only handle color planes that exist in a framebuffer's color format.
Ignore non-existing planes.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com >
Tested-by: Noralf Trønnes <noralf@tronnes.org >
Acked-by: Christian König <christian.koenig@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220517113327.26919-5-tzimmermann@suse.de
2022-05-19 19:25:19 +02:00
Thomas Zimmermann
1c89b4b718
drm/gem-vram: Share code between GEM VRAM's _{prepare, cleanup}_fb()
...
The error-recovery code in drm_gem_vram_plane_helper_prepare_fb() is of
the same pattern as drm_gem_vram_plane_helper_cleanup_fb(). Implement
both of them using an internal helper. No functional changes.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com >
Acked-by: Christian König <christian.koenig@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220517113327.26919-4-tzimmermann@suse.de
2022-05-19 19:25:10 +02:00
Thomas Zimmermann
746b9c62cc
drm/gem: Ignore color planes that are unused by framebuffer format
...
Only handle color planes that exist in a framebuffer's color format.
Ignore non-existing planes.
So far, several helpers assumed that all 4 planes are available and
silently ignored non-existing planes. This lead to subtil bugs with
uninitialized data in instances of struct iosys_map. [1]
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com >
Tested-by: Noralf Trønnes <noralf@tronnes.org >
Acked-by: Christian König <christian.koenig@amd.com >
Link: https://lore.kernel.org/dri-devel/20210730183511.20080-1-tzimmermann@suse.de/T/#md0172b10bb588d8f20f4f456e304f08d2a4505f7 # 1
Link: https://patchwork.freedesktop.org/patch/msgid/20220517113327.26919-3-tzimmermann@suse.de
2022-05-19 19:25:02 +02:00
Thomas Zimmermann
f159b1b22c
drm/gem: Share code between drm_gem_fb_{begin,end}_cpu_access()
...
The error-recovery code in drm_gem_fb_begin() is of the same pattern
as drm_gem_fb_end(). Implement both of them using an internal helper.
No functional changes.
v2:
* print additional information in error message (Javier)
* fix commit description (Javier)
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com >
Tested-by: Noralf Trønnes <noralf@tronnes.org >
Acked-by: Christian König <christian.koenig@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220517113327.26919-2-tzimmermann@suse.de
2022-05-19 19:24:51 +02:00
Swathi Dhanavanthri
7f73b37171
drm/i915/dg2: Extend Wa_22010954014 to DG2-G11 and DG2-G12
...
Signed-off-by: Swathi Dhanavanthri <swathi.dhanavanthri@intel.com >
Reviewed-by: Matt Roper <matthew.d.roper@intel.com >
Signed-off-by: Matt Roper <matthew.d.roper@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220517201338.7291-1-swathi.dhanavanthri@intel.com
2022-05-19 09:47:35 -07:00
Swathi Dhanavanthri
411d44d754
drm/i915/dg2: Add workaround 22014600077
...
Signed-off-by: Swathi Dhanavanthri <swathi.dhanavanthri@intel.com >
Reviewed-by: Matt Roper <matthew.d.roper@intel.com >
Signed-off-by: Matt Roper <matthew.d.roper@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220517212905.24212-1-swathi.dhanavanthri@intel.com
2022-05-19 09:46:10 -07:00
Juergen Gross
ae19265ca3
xen/drmfront: use xenbus_setup_ring() and xenbus_teardown_ring()
...
Simplify drmfront's ring creation and removal via xenbus_setup_ring()
and xenbus_teardown_ring().
Signed-off-by: Juergen Gross <jgross@suse.com >
Reviewed-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com >
Tested-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com > # Arm64 only
Signed-off-by: Juergen Gross <jgross@suse.com >
2022-05-19 14:22:01 +02:00
Juergen Gross
cb5216319b
xen/drm: switch xen_drm_front to use INVALID_GRANT_REF
...
Instead of using a private macro for an invalid grant reference use
the common one.
Signed-off-by: Juergen Gross <jgross@suse.com >
Reviewed-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com >
Tested-by: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com > # Arm64 only
Signed-off-by: Juergen Gross <jgross@suse.com >
2022-05-19 14:21:45 +02:00
Borislav Petkov
0696172956
drm/i915/uc: Fix undefined behavior due to shift overflowing the constant
...
Fix:
In file included from <command-line>:0:0:
drivers/gpu/drm/i915/gt/uc/intel_guc.c: In function ‘intel_guc_send_mmio’:
././include/linux/compiler_types.h:352:38: error: call to ‘__compiletime_assert_1047’ \
declared with attribute error: FIELD_PREP: mask is not constant
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
and other build errors due to shift overflowing values.
See https://lore.kernel.org/r/YkwQ6%2BtIH8GQpuct@zn.tnic for the gory
details as to why it triggers with older gccs only.
v2 by Jani:
- Drop the i915_reg.h changes
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com >
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com >
Cc: Ruiqi GONG <gongruiqi1@huawei.com >
Cc: Randy Dunlap <rdunlap@infradead.org >
Signed-off-by: Borislav Petkov <bp@suse.de >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Reviewed-by: Michal Wajdeczko <michal.wajdeczko@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220518113315.1305027-2-jani.nikula@intel.com
(cherry picked from commit 962bd34bb4 )
2022-05-19 12:50:29 +03:00
Jani Nikula
416e07a84f
drm/i915/reg: fix undefined behavior due to shift overflowing the constant
...
Use REG_GENMASK() and REG_FIELD_PREP() to avoid errors due to
-fsanitize=shift.
References: https://lore.kernel.org/r/20220405151517.29753-12-bp@alien8.de
Reported-by: Borislav Petkov <bp@suse.de >
Reported-by: Ruiqi GONG <gongruiqi1@huawei.com >
Cc: Randy Dunlap <rdunlap@infradead.org >
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/20220518113315.1305027-1-jani.nikula@intel.com
(cherry picked from commit 230fb39ff7 )
2022-05-19 12:50:29 +03:00
Andi Shyti
183f815d42
drm/i915/gt: Fix use of static in macro mismatch
...
The INTEL_GT_RPS_SYSFS_ATTR was creating to different structures
but. When called with the "static" keyword this is affecting only
the first structure, while the second is created as non static.
Move the static keyword inside the macros to affect both the
structures.
Reported-by: Jani Nikula <jani.nikula@linux.intel.com >
Fixes: 56a709cf77 ("drm/i915/gt: Create per-tile RPS sysfs interfaces")
Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com >
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220510140447.80200-1-andi.shyti@linux.intel.com
(cherry picked from commit 1ade30812a )
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
2022-05-19 12:50:29 +03:00
Jani Nikula
d91e9be0f0
drm/i915/audio: fix audio code enable/disable pipe logging
...
Need to use pipe_name(pipe) instead of pipe directly.
Fixes: 1f31e35f2e ("drm/i915/audio: unify audio codec enable/disable debug logging")
Cc: 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/20220512161638.272601-1-jani.nikula@intel.com
(cherry picked from commit 945ae909aa )
2022-05-19 12:50:25 +03:00
Maarten Lankhorst
7b1d6924f2
drm/i915: Use i915_gem_object_ggtt_pin_ww for reloc_iomap
...
When removing short term pins, I've changed the the batch buffer
pinning for relocation to use __i915_vma_pin, because
i915_gem_object_ggtt_pin_ww was destroying the old vma. This
caused regressions, because the functions are not identical.
Fix the regressions by calling i915_gem_object_ggtt_pin_ww() again
on ggtt-only platforms, but only if the batch can be pinned without
being moved.
Fixes: b5cfe6f7a6 ("drm/i915: Remove short-term pins from execbuf, v6.")
Cc: Matthew Auld <matthew.auld@intel.com >
Reported-by: Mateusz Jończyk <mat.jonczyk@o2.pl >
Tested-by: Hans de Goede <hdegoede@redhat.com >
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Acked-by: Matthew Auld <matthew.auld@intel.com >
Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/5806
Link: https://patchwork.freedesktop.org/patch/msgid/20220511115219.46507-1-maarten.lankhorst@linux.intel.com
(cherry picked from commit 451374eef6 )
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com >
2022-05-19 12:49:49 +03:00
Nathan Chancellor
58606220a2
drm/i915: Fix CFI violation with show_dynamic_id()
...
When an attribute group is created with sysfs_create_group(), the
->sysfs_ops() callback is set to kobj_sysfs_ops, which sets the ->show()
callback to kobj_attr_show(). kobj_attr_show() uses container_of() to
get the ->show() callback from the attribute it was passed, meaning the
->show() callback needs to be the same type as the ->show() callback in
'struct kobj_attribute'.
However, show_dynamic_id() has the type of the ->show() callback in
'struct device_attribute', which causes a CFI violation when opening the
'id' sysfs node under drm/card0/metrics. This happens to work because
the layout of 'struct kobj_attribute' and 'struct device_attribute' are
the same, so the container_of() cast happens to allow the ->show()
callback to still work.
Change the type of show_dynamic_id() to match the ->show() callback in
'struct kobj_attributes' and update the type of sysfs_metric_id to
match, which resolves the CFI violation.
Fixes: f89823c212 ("drm/i915/perf: Implement I915_PERF_ADD/REMOVE_CONFIG interface")
Signed-off-by: Nathan Chancellor <nathan@kernel.org >
Reviewed-by: Kees Cook <keescook@chromium.org >
Reviewed-by: Sami Tolvanen <samitolvanen@google.com >
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220513075136.1027007-1-tvrtko.ursulin@linux.intel.com
(cherry picked from commit 18fb42db05 )
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
2022-05-19 12:10:57 +03:00
Imre Deak
61e00044c6
drm/i915: Fix 'mixing different enum types' warnings in intel_display_power.c
...
Fix the following sparse warnings:
drivers/gpu/drm/i915/display/intel_display_power.c:2431:34: warning: mixing different enum types:
drivers/gpu/drm/i915/display/intel_display_power.c:2431:34: unsigned int enum intel_display_power_domain
drivers/gpu/drm/i915/display/intel_display_power.c:2431:34: int enum port
drivers/gpu/drm/i915/display/intel_display_power.c:2442:37: warning: mixing different enum types:
drivers/gpu/drm/i915/display/intel_display_power.c:2442:37: unsigned int enum intel_display_power_domain
drivers/gpu/drm/i915/display/intel_display_power.c:2442:37: int enum port
drivers/gpu/drm/i915/display/intel_display_power.c:2468:43: warning: mixing different enum types:
drivers/gpu/drm/i915/display/intel_display_power.c:2468:43: unsigned int enum intel_display_power_domain
drivers/gpu/drm/i915/display/intel_display_power.c:2468:43: unsigned int enum aux_ch
drivers/gpu/drm/i915/display/intel_display_power.c:2479:35: warning: mixing different enum types:
drivers/gpu/drm/i915/display/intel_display_power.c:2479:35: unsigned int enum intel_display_power_domain
drivers/gpu/drm/i915/display/intel_display_power.c:2479:35: unsigned int enum aux_ch
Fixes: 979e1b32e0 ("drm/i915: Sanitize the port -> DDI/AUX power domain mapping for each platform")
Reported-by: Jani Nikula <jani.nikula@intel.com >
Cc: Jouni Högander <jouni.hogander@intel.com >
Signed-off-by: Imre Deak <imre.deak@intel.com >
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220510114957.406070-1-imre.deak@intel.com
(cherry picked from commit 7ecc3cc8a7 )
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
2022-05-19 12:10:51 +03:00
YueHaibing
43ab20c599
drm/i915/gt: Fix build error without CONFIG_PM
...
drivers/gpu/drm/i915/gt/intel_gt_sysfs_pm.c: In function ‘act_freq_mhz_show’:
drivers/gpu/drm/i915/gt/intel_gt_sysfs_pm.c:276:20: error: implicit declaration of function ‘sysfs_gt_attribute_r_max_func’ [-Werror=implicit-function-declaration]
276 | u32 actual_freq = sysfs_gt_attribute_r_max_func(dev, attr,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Move sysfs_gt_attribute_* macros out of #ifdef block to fix this.
Fixes: 56a709cf77 ("drm/i915/gt: Create per-tile RPS sysfs interfaces")
Signed-off-by: YueHaibing <yuehaibing@huawei.com >
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220506032652.1856-1-yuehaibing@huawei.com
(cherry picked from commit 09708b6d82 )
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
2022-05-19 12:10:46 +03:00
Borislav Petkov
962bd34bb4
drm/i915/uc: Fix undefined behavior due to shift overflowing the constant
...
Fix:
In file included from <command-line>:0:0:
drivers/gpu/drm/i915/gt/uc/intel_guc.c: In function ‘intel_guc_send_mmio’:
././include/linux/compiler_types.h:352:38: error: call to ‘__compiletime_assert_1047’ \
declared with attribute error: FIELD_PREP: mask is not constant
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
and other build errors due to shift overflowing values.
See https://lore.kernel.org/r/YkwQ6%2BtIH8GQpuct@zn.tnic for the gory
details as to why it triggers with older gccs only.
v2 by Jani:
- Drop the i915_reg.h changes
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com >
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com >
Cc: Ruiqi GONG <gongruiqi1@huawei.com >
Cc: Randy Dunlap <rdunlap@infradead.org >
Signed-off-by: Borislav Petkov <bp@suse.de >
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Reviewed-by: Michal Wajdeczko <michal.wajdeczko@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220518113315.1305027-2-jani.nikula@intel.com
2022-05-19 11:08:58 +03:00
Jani Nikula
230fb39ff7
drm/i915/reg: fix undefined behavior due to shift overflowing the constant
...
Use REG_GENMASK() and REG_FIELD_PREP() to avoid errors due to
-fsanitize=shift.
References: https://lore.kernel.org/r/20220405151517.29753-12-bp@alien8.de
Reported-by: Borislav Petkov <bp@suse.de >
Reported-by: Ruiqi GONG <gongruiqi1@huawei.com >
Cc: Randy Dunlap <rdunlap@infradead.org >
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/20220518113315.1305027-1-jani.nikula@intel.com
2022-05-19 11:00:46 +03:00
Dave Airlie
00df0514ab
Merge tag 'amd-drm-next-5.19-2022-05-18' of https://gitlab.freedesktop.org/agd5f/linux into drm-next
...
amd-drm-next-5.19-2022-05-18:
amdgpu:
- Misc code cleanups
- Additional SMU 13.x enablement
- Smartshift fixes
- GFX11 fixes
- Support for SMU 13.0.4
- SMU mutex fix
- Suspend/resume fix
amdkfd:
- static checker fix
- Doorbell/MMIO resource handling fix
Signed-off-by: Dave Airlie <airlied@redhat.com >
From: Alex Deucher <alexander.deucher@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220518205621.5741-1-alexander.deucher@amd.com
2022-05-19 14:09:54 +10:00
Abhinav Kumar
64b22a0da1
drm/msm/dpu: handle pm_runtime_get_sync() errors in bind path
...
If there are errors while trying to enable the pm in the
bind path, it will lead to unclocked access of hw revision
register thereby crashing the device.
This will not address why the pm_runtime_get_sync() fails
but at the very least we should be able to prevent the
crash by handling the error and bailing out earlier.
changes in v2:
- use pm_runtime_resume_and_get() instead of
pm_runtime_get_sync()
Fixes: 25fdd5933e ("drm/msm: Add SDM845 DPU support")
Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com >
Reviewed-by: Rob Clark <robdclark@gmail.com >
Reviewed-by: Stephen Boyd <swboyd@chromium.org >
Patchwork: https://patchwork.freedesktop.org/patch/486721/
Link: https://lore.kernel.org/r/20220518223407.26147-1-quic_abhinavk@quicinc.com
Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com >
2022-05-18 18:32:03 -07:00