Marek Vasut
66230cc9b6
drm: bridge: icn6211: Drop I2C module owner assignment
...
The module owner = THIS_MODULE is set by I2C core, drop duplicate assignment.
Fixes: 8dde6f7452 ("drm: bridge: icn6211: Add I2C configuration support")
Signed-off-by: Marek Vasut <marex@denx.de >
Cc: Jagan Teki <jagan@amarulasolutions.com >
Cc: Maxime Ripard <maxime@cerno.tech >
Cc: Robert Foss <robert.foss@linaro.org >
Cc: Sam Ravnborg <sam@ravnborg.org >
Cc: Thomas Zimmermann <tzimmermann@suse.de >
To: dri-devel@lists.freedesktop.org
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220401113317.7033-1-marex@denx.de
2022-04-06 11:23:46 +02:00
Lucas Stach
2829a9fcb7
drm/etnaviv: reap idle softpin mappings when necessary
...
Right now the only point where softpin mappings get removed from the
MMU context is when the mapped GEM object is destroyed. However,
userspace might want to reuse that address space before the object
is destroyed, which is a valid usage, as long as all mapping in that
region of the address space are no longer used by any GPU jobs.
Implement reaping of idle MMU mappings that would otherwise
prevent the insertion of a softpin mapping.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de >
Tested-by: Guido Günther <agx@sigxcpu.org >
Acked-by: Guido Günther <agx@sigxcpu.org >
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com >
2022-04-06 10:01:51 +02:00
Lucas Stach
9247fcca39
drm/etnaviv: move flush_seq increment into etnaviv_iommu_map/unmap
...
The flush sequence is a marker that the page tables have been changed
and any affected TLBs need to be flushed. Move the flush_seq increment
a little further down the call stack to place it next to the actual
page table manipulation. Not functional change.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de >
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de >
Tested-by: Guido Günther <agx@sigxcpu.org >
Acked-by: Guido Günther <agx@sigxcpu.org >
2022-04-06 10:01:43 +02:00
Lucas Stach
11ad6a1f18
drm/etnaviv: move MMU context ref/unref into map/unmap_gem
...
This makes it a little more clear that the mapping holds a reference
to the context once the buffer has been successfully mapped into that
context and simplifies the error handling a bit.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de >
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de >
Tested-by: Guido Günther <agx@sigxcpu.org >
Acked-by: Guido Günther <agx@sigxcpu.org >
2022-04-06 10:01:36 +02:00
Lucas Stach
e168c25526
drm/etnaviv: check for reaped mapping in etnaviv_iommu_unmap_gem
...
When the mapping is already reaped the unmap must be a no-op, as we
would otherwise try to remove the mapping twice, corrupting the involved
data structures.
Cc: stable@vger.kernel.org # 5.4
Signed-off-by: Lucas Stach <l.stach@pengutronix.de >
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de >
Tested-by: Guido Günther <agx@sigxcpu.org >
Acked-by: Guido Günther <agx@sigxcpu.org >
2022-04-06 10:00:51 +02:00
Xiaomeng Tong
61fe0ab26e
drm/gma500: fix a missing break in psb_intel_crtc_mode_set
...
Instead of exiting the loop as expected when an entry is found, the
list_for_each_entry() continues until the traversal is complete.
when found the entry, add a break after the switch statement.
Signed-off-by: Xiaomeng Tong <xiam0nd.tong@gmail.com >
Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220401115018.9335-1-xiam0nd.tong@gmail.com
2022-04-06 09:38:11 +02:00
Marek Vasut
7a828f1f1f
drm: bridge: icn6211: Mark module exit callback with __exit
...
Fix copy-paste error, module exit function should be marked with __exit
instead of __init.
Fixes: 8dde6f7452 ("drm: bridge: icn6211: Add I2C configuration support")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au >
Signed-off-by: Marek Vasut <marex@denx.de >
Cc: Jagan Teki <jagan@amarulasolutions.com >
Cc: Maxime Ripard <maxime@cerno.tech >
Cc: Robert Foss <robert.foss@linaro.org >
Cc: Sam Ravnborg <sam@ravnborg.org >
Cc: Stephen Rothwell <sfr@canb.auug.org.au >
Cc: Thomas Zimmermann <tzimmermann@suse.de >
To: dri-devel@lists.freedesktop.org
Signed-off-by: Robert Foss <robert.foss@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20220406014250.902187-1-marex@denx.de
Reviewed-by: Robert Foss <robert.foss@linaro.org >
2022-04-06 09:34:58 +02:00
Tvrtko Ursulin
b9bd483207
drm/i915: Fixup kerneldoc in struct i915_gem_context
...
Mixup in rebasing and patchwork re-runs made me push the wrong version of
the patch. Or I even forgot to send out the fixed version. Fix it up.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Fixes: 49bd54b390 ("drm/i915: Track all user contexts per client")
Cc: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com >
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Link: https://patchwork.freedesktop.org/patch/msgid/20220405155345.3292769-1-tvrtko.ursulin@linux.intel.com
2022-04-06 08:33:40 +01:00
Chen-Yu Tsai
cfab37ff31
drm/mediatek: Fix DPI component detection for MT8192
...
When support for MT8192 was added, the DPI device was not added to the
list of components to look for. This causes the secondary display
pipeline to not be able to fully bind, and the DRM driver subsequently
defers probing.
Add the DPI device compatible to list of DPI components to fix this.
Link: https://patchwork.kernel.org/project/linux-mediatek/patch/20220225032754.140168-1-wenst@chromium.org/
Fixes: 01365f549c ("drm/mediatek: Add support for Mediatek SoC MT8192")
Signed-off-by: Chen-Yu Tsai <wenst@chromium.org >
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org >
2022-04-06 07:28:36 +08:00
Marek Vasut
21d139a956
drm: bridge: icn6211: Fix DSI-to-DPI PLL configuration
...
The datasheet for this bridge is not available, the PLL behavior has been
inferred from [1] and [2] and by analyzing the DPI pixel clock with scope.
After further testing with other displays and different DSI data lane count,
it turns out the P-factor is not 1/2^N divider, but rather only 1/N divider.
It also turns out the input into the PLL seem to be ByteClock instead of DSI
HS clock.
Rework the P-factor calculation such that the PLL calculation code handles
P-factor from 1..32 with P-factors above 16 must be even. In case P-factor
is even, enable built-in 1:2 divider and program P-factor/2 to PLL_REF_DIV,
otherwise configure only the P-factor into PLL_REF_DIV register.
Switch the PLL factor calculation from kHz to Hz to maintain precision.
[1] https://github.com/rockchip-linux/kernel/blob/develop-4.19/drivers/gpu/drm/bridge/icn6211.c
[2] https://github.com/tdjastrzebski/ICN6211-Configurator
Fixes: f30cf0ece6 ("drm: bridge: icn6211: Add generic DSI-to-DPI PLL configuration")
Signed-off-by: Marek Vasut <marex@denx.de >
Cc: Jagan Teki <jagan@amarulasolutions.com >
Cc: Maxime Ripard <maxime@cerno.tech >
Cc: Robert Foss <robert.foss@linaro.org >
Cc: Sam Ravnborg <sam@ravnborg.org >
Cc: Thomas Zimmermann <tzimmermann@suse.de >
To: dri-devel@lists.freedesktop.org
Acked-by: Maxime Ripard <maxime@cerno.tech >
Link: https://patchwork.freedesktop.org/patch/msgid/20220402004118.897014-1-marex@denx.de
2022-04-06 01:14:53 +02:00
Rex-BC Chen
b74d921b90
drm/mediatek: Add vblank register/unregister callback functions
...
We encountered a kernel panic issue that callback data will be NULL when
it's using in ovl irq handler. There is a timing issue between
mtk_disp_ovl_irq_handler() and mtk_ovl_disable_vblank().
To resolve this issue, we use the flow to register/unregister vblank cb:
- Register callback function and callback data when crtc creates.
- Unregister callback function and callback data when crtc destroies.
With this solution, we can assure callback data will not be NULL when
vblank is disable.
Link: https://patchwork.kernel.org/project/linux-mediatek/patch/20220321072320.15019-1-rex-bc.chen@mediatek.com/
Fixes: 9b0704988b ("drm/mediatek: Register vblank callback function")
Signed-off-by: Rex-BC Chen <rex-bc.chen@mediatek.com >
Reviewed-by: jason-jh.lin <jason-jh.lin@mediatek.com >
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org >
2022-04-06 07:10:26 +08:00
AngeloGioacchino Del Regno
07fb1e5bab
drm/mediatek: mtk_drm_crtc: Use kmalloc in mtk_drm_crtc_duplicate_state
...
Optimize mtk_drm_crtc_duplicate_state() by switching from kzalloc() to
kmalloc(): the only variable of this struct that gets checked in other
functions is `pending_config`, but if that's set to false, then all of
the remaining variables will only ever be set, but not read - so, also
set `pending_config` to false.
This saves us some small overhead.
Link: https://patchwork.kernel.org/project/linux-mediatek/patch/20220118133759.112458-2-angelogioacchino.delregno@collabora.com/
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com >
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org >
2022-04-06 06:27:23 +08:00
AngeloGioacchino Del Regno
d327bc37c1
drm/mediatek: mtk_drm_plane: Use kmalloc in mtk_plane_duplicate_state
...
There is no need to zero out the newly allocated memory because we are
duplicating all members of struct mtk_plane_state: switch to kmalloc
to save some overhead.
Link: https://patchwork.kernel.org/project/linux-mediatek/patch/20220118133759.112458-1-angelogioacchino.delregno@collabora.com/
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com >
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org >
2022-04-06 06:27:23 +08:00
Christophe Branchereau
a271bf3241
drm/panel: innolux-ej030na and abt-y030xx067a: add .enable and .disable
...
Following the introduction of bridge_atomic_enable in the ingenic
drm driver, the crtc is enabled between .prepare and .enable, if
it exists. Add it so the backlight is only enabled after the crtc is, to
avoid graphical issues.
As we're moving the "sleep out" command out of the init sequence
into .enable for the ABT, we need to switch the regmap cache
to REGCACHE_FLAT to be able to use regmap_set_bits, given this
panel registers are write-ony and read as 0.
Signed-off-by: Christophe Branchereau <cbranchereau@gmail.com >
Signed-off-by: Paul Cercueil <paul@crapouillou.net >
[pcercuei: Remove empty line after opening brace]
Acked-by: Sam Ravnborg <sam@ravnborg.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20220321133651.291592-4-cbranchereau@gmail.com
2022-04-05 21:41:36 +01:00
Christophe Branchereau
49956b505c
drm/panel: Add panel driver for NewVision NV3052C based LCDs
...
This driver supports the NewVision NV3052C based LCDs. Right now, it
only supports the LeadTek LTK035C5444T 2.4" 640x480 TFT LCD panel, which
can be found in the Anbernic RG-350M handheld console.
Signed-off-by: Christophe Branchereau <cbranchereau@gmail.com >
Signed-off-by: Paul Cercueil <paul@crapouillou.net >
[pcercuei: Change msleep(5) to usleep_range(5000, 20000)]
Reviewed-by: Sam Ravnborg <sam@ravnborg.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20220321133651.291592-3-cbranchereau@gmail.com
2022-04-05 21:41:36 +01:00
Christophe Branchereau
aa46154355
drm/ingenic: Add ingenic_drm_bridge_atomic_enable and disable
...
ingenic_drm_bridge_atomic_enable allows the CRTC to be enabled after
panels have slept out, and before their display is turned on, solving
a graphical bug on the newvision nv3502c.
Also add ingenic_drm_bridge_atomic_disable to balance it out.
Signed-off-by: Christophe Branchereau <cbranchereau@gmail.com >
Signed-off-by: Paul Cercueil <paul@crapouillou.net >
Acked-by: Artur Rojek <contact@artur-rojek.eu >
Link: https://patchwork.freedesktop.org/patch/msgid/20220321133651.291592-2-cbranchereau@gmail.com
2022-04-05 21:41:35 +01:00
Anthony Koo
78174f4770
drm/amd/display: [FW Promotion] Release 0.0.111.0
...
- Add options to allow for configurable PHY options during PSR active
state
- Remove unused versioning and git hash
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com >
Reviewed-by: Aric Cyr <Aric.Cyr@amd.com >
Acked-by: Tom Chung <chiahsuan.chung@amd.com >
Signed-off-by: Anthony Koo <Anthony.Koo@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-04-05 10:29:48 -04:00
Michael Strauss
73b1da69f5
drm/amd/display: Check for invalid input params when building scaling params
...
[WHY]
Function to calculate scaling ratios can be called with invalid plane
src/dest, causing a divide by zero.
[HOW]
Fail building scaling params if plane state src/dest rects are
unpopulated
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com >
Reviewed-by: Charlene Liu <Charlene.Liu@amd.com >
Acked-by: Tom Chung <chiahsuan.chung@amd.com >
Signed-off-by: Michael Strauss <michael.strauss@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-04-05 10:29:48 -04:00
Leo (Hanghong) Ma
176cd4385a
drm/amd/display: Move link_trace for edp to dp_trace
...
[Why & How]
The dp_trace structure is self contained component designed for
all dp trace, and the edp link trace should be a part of it;
Suggested-by: Wenjing Liu <wenjing.liu@amd.com >
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com >
Reviewed-by: Wenjing Liu <Wenjing.Liu@amd.com >
Reviewed-by: Charlene Liu <Charlene.Liu@amd.com >
Acked-by: Tom Chung <chiahsuan.chung@amd.com >
Signed-off-by: Leo (Hanghong) Ma <hanghong.ma@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-04-05 10:29:48 -04:00
Aric Cyr
68cdbf631b
drm/amd/display: 3.2.180
...
- [FW Promotion] Release 0.0.111.0
- Check for invalid input params when building scaling params
- Move link_trace for edp to dp_trace
- Fix missing-prototypes warning
- Enable 3 plane for DCN 3.0 and 3.02
- Extract set stream attribute into link_hwss
- Revert Power down hardware if timer not trigger
- Add support for handling 128b/132b link training test request
- Add configuration options for AUX wake work around
- Remove underflow IRQ type
- Add flip interval workaround for low FPS in some game
- Remove assert for odm transition case
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com >
Acked-by: Tom Chung <chiahsuan.chung@amd.com >
Signed-off-by: Aric Cyr <aric.cyr@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-04-05 10:29:48 -04:00
Becle Lee
24566aab61
drm/amd/display: fix missing-prototypes warning
...
[Why]
No declaration of hubp1_wait_pipe_read_start found in header file.
[How]
Add its declaration.
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com >
Reviewed-by: Aric Cyr <Aric.Cyr@amd.com >
Acked-by: Tom Chung <chiahsuan.chung@amd.com >
Signed-off-by: Becle Lee <becle.lee@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-04-05 10:29:48 -04:00
Krunoslav Kovac
0191d38417
drm/amd/display: Enable 3 plane for DCN 3.0 and 3.02
...
[WHY&HOW]
Increase num of bottom planes to 2. Note that DCN 3.03 is left out
since it has max 2 planes.
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com >
Reviewed-by: Aric Cyr <Aric.Cyr@amd.com >
Acked-by: Tom Chung <chiahsuan.chung@amd.com >
Signed-off-by: Krunoslav Kovac <Krunoslav.Kovac@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-04-05 10:29:48 -04:00
Wenjing Liu
eff5e11508
drm/amd/display: extract set stream attribute to link_hwss
...
[why]
Extract set stream attribute into link_hwss as part of the link hwss
refactor work.
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com >
Reviewed-by: George Shen <George.Shen@amd.com >
Acked-by: Tom Chung <chiahsuan.chung@amd.com >
Signed-off-by: Wenjing Liu <wenjing.liu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-04-05 10:29:48 -04:00
Martin Leung
3f68934528
drm/amd/display: revert Power down hardware if timer not trigger
...
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com >
Reviewed-by: George Shen <George.Shen@amd.com >
Acked-by: Tom Chung <chiahsuan.chung@amd.com >
Signed-off-by: Martin Leung <Martin.Leung@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-04-05 10:29:48 -04:00
Wenjing Liu
180c4592e2
drm/amd/display: add support for handling 128b/132b link training test request
...
[why]
DP2.x added new enum values for UHBR link rates in link training test
request for test automation. We need to add UHBR link rates test request
support in preparation for compliance test automation.
[how]
added a function that translate test link rate to dc link rate. Call
the translation function to decide the requested test link rate.
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com >
Reviewed-by: George Shen <George.Shen@amd.com >
Acked-by: Tom Chung <chiahsuan.chung@amd.com >
Signed-off-by: Wenjing Liu <wenjing.liu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-04-05 10:29:48 -04:00
Jimmy Kizito
bb90786fa8
drm/amd/display: Add configuration options for AUX wake work around.
...
[Why]
Work around to try to wake unresponsive DP sinks may need to be adjusted
for certain sinks.
[How]
Add options to disable work around or adjust time spent trying to wake
unresponsive DPRX.
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com >
Reviewed-by: Martin Leung <Martin.Leung@amd.com >
Acked-by: Tom Chung <chiahsuan.chung@amd.com >
Signed-off-by: Jimmy Kizito <Jimmy.Kizito@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-04-05 10:29:48 -04:00
Angus Wang
ec313220c3
drm/amd/display: Remove underflow IRQ type
...
[WHY]
Feature using the underflow IRQ type reverted
[HOW]
Removed underflow IRQ type entry
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com >
Reviewed-by: Martin Leung <Martin.Leung@amd.com >
Acked-by: Tom Chung <chiahsuan.chung@amd.com >
Signed-off-by: Angus Wang <Angus.Wang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-04-05 10:29:47 -04:00
Angus Wang
3fe5739db4
drm/amd/display: Add flip interval workaround
...
[WHY]
Some games experience low FPS issues when FreeSync is on and VSync is
toggled to half refresh rate.
[HOW]
First create a function to determine workaround conditions, which is
when we detect 2 or more VSync interrupts between flips and a very short
VSync to flip interval. We do the workaround during VSync interrupts and
set the v_total_max and min to nominal. We also cleanup after we exit
the game.
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com >
Reviewed-by: Anthony Koo <Anthony.Koo@amd.com >
Reviewed-by: Aric Cyr <Aric.Cyr@amd.com >
Acked-by: Tom Chung <chiahsuan.chung@amd.com >
Signed-off-by: Angus Wang <Angus.Wang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-04-05 10:29:47 -04:00
Eric Bernstein
35b2186b13
drm/amd/display: remove assert for odm transition case
...
Remove assert that will hit during odm transition case,
since this is a valid case.
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com >
Reviewed-by: Alvin Lee <alvin.lee2@amd.com >
Acked-by: Tom Chung <chiahsuan.chung@amd.com >
Signed-off-by: Eric Bernstein <eric.bernstein@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-04-05 10:29:47 -04:00
Philip Yang
0f12a22f37
drm/amdgpu: Flush TLB after mapping for VG20+XGMI
...
For VG20 + XGMI bridge, all mappings PTEs cache in TC, this may have
stall invalid PTEs in TC because one cache line has 8 pages. Need always
flush_tlb after updating mapping.
Signed-off-by: Philip Yang <Philip.Yang@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-04-05 10:29:47 -04:00
Alex Deucher
34452ac303
drm/amdgpu: don't use BACO for reset in S3
...
Seems to cause a reboots or hangs on some systems.
Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1924
Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1953
Fixes: daf8de0874 ("drm/amdgpu: always reset the asic in suspend (v2)")
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-04-05 10:27:34 -04:00
Haowen Bai
7e97de3e7f
drm/amdgpu/vcn: Remove unneeded semicolon
...
report by coccicheck:
drivers/gpu/drm/amd/amdgpu/vcn_v2_5.c:1951:2-3: Unneeded semicolon
Fixes: c543dcbe42 ("drm/amdgpu/vcn: Add VCN ras error query support")
Signed-off-by: Haowen Bai <baihaowen@meizu.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-04-05 10:26:42 -04:00
Aashish Sharma
7da7b02e97
drm/amd/display: Fix unused-but-set-variable warning
...
Fix the kernel test robot warning below:
drivers/gpu/drm/amd/amdgpu/../display/dmub/inc/dmub_cmd.h:2893:12:
warning: variable 'temp' set but not used [-Wunused-but-set-variable]
Replaced the assignment to the unused temp variable with READ_ONCE()
macro to flush the writes. READ_ONCE() helps avoid the use of
volatile and makes it obvious from the code that the read here is
intentional. Also verified on x86 that the generated code is exactly the
same as before.
Reported-by: kernel test robot <lkp@intel.com >
Signed-off-by: Aashish Sharma <shraash@google.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-04-05 10:26:36 -04:00
Marko Zekovic
a68bec2ce7
amdgpu/pm: Enable sysfs nodes for vclk and dclk for NAVI12
...
SMI clock measure API is failing on NAVI12, because
sysfs node for pp_dpm_vclk is not existing. Enable
sysfs node for pp_dpm_vclk for NAVI12.
v2: Also enable sysfs node for pp_dpm_dclk.
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com >
Signed-off-by: Marko Zekovic <Marko.Zekovic@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-04-05 10:26:28 -04:00
Christian König
30671b44aa
drm/amdgpu: fix TLB flushing during eviction
...
Testing the valid bit is not enough to figure out if we
need to invalidate the TLB or not.
During eviction it is quite likely that we move a BO from VRAM to GTT and
update the page tables immediately to the new GTT address.
Rework the whole function to get all the necessary parameters directly as
value.
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Philip Yang <Philip.Yang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-04-05 10:26:20 -04:00
CHANDAN VURDIGERE NATARAJ
50e6cb3fd2
drm/amd/display: Fix by adding FPU protection for dcn30_internal_validate_bw
...
[Why]
Below general protection fault observed when WebGL Aquarium is run for
longer duration. If drm debug logs are enabled and set to 0x1f then the
issue is observed within 10 minutes of run.
[ 100.717056] general protection fault, probably for non-canonical address 0x2d33302d32323032: 0000 [#1 ] PREEMPT SMP NOPTI
[ 100.727921] CPU: 3 PID: 1906 Comm: DrmThread Tainted: G W 5.15.30 #12 d726c6a2d6ebe5cf9223931cbca6892f916fe18b
[ 100.754419] RIP: 0010:CalculateSwathWidth+0x1f7/0x44f
[ 100.767109] Code: 00 00 00 f2 42 0f 11 04 f0 48 8b 85 88 00 00 00 f2 42 0f 10 04 f0 48 8b 85 98 00 00 00 f2 42 0f 11 04 f0 48 8b 45 10 0f 57 c0 <f3> 42 0f 2a 04 b0 0f 57 c9 f3 43 0f 2a 0c b4 e8 8c e2 f3 ff 48 8b
[ 100.781269] RSP: 0018:ffffa9230079eeb0 EFLAGS: 00010246
[ 100.812528] RAX: 2d33302d32323032 RBX: 0000000000000500 RCX: 0000000000000000
[ 100.819656] RDX: 0000000000000001 RSI: ffff99deb712c49c RDI: 0000000000000000
[ 100.826781] RBP: ffffa9230079ef50 R08: ffff99deb712460c R09: ffff99deb712462c
[ 100.833907] R10: ffff99deb7124940 R11: ffff99deb7124d70 R12: ffff99deb712ae44
[ 100.841033] R13: 0000000000000001 R14: 0000000000000000 R15: ffffa9230079f0a0
[ 100.848159] FS: 00007af121212640(0000) GS:ffff99deba780000(0000) knlGS:0000000000000000
[ 100.856240] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 100.861980] CR2: 0000209000fe1000 CR3: 000000011b18c000 CR4: 0000000000350ee0
[ 100.869106] Call Trace:
[ 100.871555] <TASK>
[ 100.873655] ? asm_sysvec_reschedule_ipi+0x12/0x20
[ 100.878449] CalculateSwathAndDETConfiguration+0x1a3/0x6dd
[ 100.883937] dml31_ModeSupportAndSystemConfigurationFull+0x2ce4/0x76da
[ 100.890467] ? kallsyms_lookup_buildid+0xc8/0x163
[ 100.895173] ? kallsyms_lookup_buildid+0xc8/0x163
[ 100.899874] ? __sprint_symbol+0x80/0x135
[ 100.903883] ? dm_update_plane_state+0x3f9/0x4d2
[ 100.908500] ? symbol_string+0xb7/0xde
[ 100.912250] ? number+0x145/0x29b
[ 100.915566] ? vsnprintf+0x341/0x5ff
[ 100.919141] ? desc_read_finalized_seq+0x39/0x87
[ 100.923755] ? update_load_avg+0x1b9/0x607
[ 100.927849] ? compute_mst_dsc_configs_for_state+0x7d/0xd5b
[ 100.933416] ? fetch_pipe_params+0xa4d/0xd0c
[ 100.937686] ? dc_fpu_end+0x3d/0xa8
[ 100.941175] dml_get_voltage_level+0x16b/0x180
[ 100.945619] dcn30_internal_validate_bw+0x10e/0x89b
[ 100.950495] ? dcn31_validate_bandwidth+0x68/0x1fc
[ 100.955285] ? resource_build_scaling_params+0x98b/0xb8c
[ 100.960595] ? dcn31_validate_bandwidth+0x68/0x1fc
[ 100.965384] dcn31_validate_bandwidth+0x9a/0x1fc
[ 100.970001] dc_validate_global_state+0x238/0x295
[ 100.974703] amdgpu_dm_atomic_check+0x9c1/0xbce
[ 100.979235] ? _printk+0x59/0x73
[ 100.982467] drm_atomic_check_only+0x403/0x78b
[ 100.986912] drm_mode_atomic_ioctl+0x49b/0x546
[ 100.991358] ? drm_ioctl+0x1c1/0x3b3
[ 100.994936] ? drm_atomic_set_property+0x92a/0x92a
[ 100.999725] drm_ioctl_kernel+0xdc/0x149
[ 101.003648] drm_ioctl+0x27f/0x3b3
[ 101.007051] ? drm_atomic_set_property+0x92a/0x92a
[ 101.011842] amdgpu_drm_ioctl+0x49/0x7d
[ 101.015679] __se_sys_ioctl+0x7c/0xb8
[ 101.015685] do_syscall_64+0x5f/0xb8
[ 101.015690] ? __irq_exit_rcu+0x34/0x96
[How]
It calles populate_dml_pipes which uses doubles to initialize.
Adding FPU protection avoids context switch and probable loss of vba context
as there is potential contention while drm debug logs are enabled.
Signed-off-by: CHANDAN VURDIGERE NATARAJ <chandan.vurdigerenataraj@amd.com >
Reviewed-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2022-04-05 10:26:05 -04:00
Animesh Manna
92bc908af5
drm/i915/dsb: modified to drm_info in dsb_prepare()
...
The request to aqquire gem resources is failing for DSB in rare
scenario where it is busy and the register programming will be done
through mmio fallback path.
DSB has extra advantage of faster register programming which may
go away through mmio path. Adding wait for gem resource also may
not be right as anyways losing time.
To make the CI execution happy replaced drm_err() to drm_info()
for printing debug info during dsb buffer preparation.
v1: Initial version.
v2: Added print for mmio fallback at out label. [Nirmoy]
v3: Improved debug message. [Nirmoy]
Cc: Nirmoy Das <nirmoy.das@linux.intel.com >
Signed-off-by: Animesh Manna <animesh.manna@intel.com >
Signed-off-by: Uma Shankar <uma.shankar@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220325161140.11906-1-animesh.manna@intel.com
Reviewed-by: Nirmoy Das <nirmoy.das@intel.com >
2022-04-05 17:13:07 +05:30
Christian König
33f2069fb6
drm/nouveau: support more than one write fence in fenv50_wndw_prepare_fb
...
Use dma_resv_get_singleton() here to eventually get more than one write
fence as single fence.
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Cc: Thomas Zimmermann <tzimmermann@suse.de >
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com >
Cc: Maxime Ripard <maxime@cerno.tech >
Cc: Lyude Paul <lyude@redhat.com >
Cc: nouveau@lists.freedesktop.org
Link: https://patchwork.freedesktop.org/patch/msgid/20220321135856.1331-14-christian.koenig@amd.com
2022-04-05 11:43:45 +02:00
Maxime Ripard
13043d1a12
Merge drm-misc/drm-misc-next-fixes into drm-misc-fixes
...
There were a few patches left in drm-misc-next-fixes, let's bring them
into drm-misc-fixes.
Signed-off-by: Maxime Ripard <maxime@cerno.tech >
2022-04-05 11:39:22 +02:00
Maxime Ripard
cf5c5763eb
Merge drm/drm-fixes into drm-misc-fixes
...
Let's start the 5.18 fixes cycle.
Signed-off-by: Maxime Ripard <maxime@cerno.tech >
2022-04-05 11:37:03 +02:00
Maxime Ripard
9cbbd694a5
Merge drm/drm-next into drm-misc-next
...
Let's start the 5.19 development cycle.
Signed-off-by: Maxime Ripard <maxime@cerno.tech >
2022-04-05 11:06:58 +02:00
Ville Syrjälä
af65840f19
drm/i915/dp: Fix DFP rgb->ycbcr conversion matrix
...
Our YCbCr output is always supposed to be limited range BT.709.
That's what we send with native HDMI. The conn_state->colorspace
stuff is entirely independent of that and is not supposed to alter
the generated output in any way. If we want a way to do that then
we need a new proprty for it.
Make it so that the RGB->YCbCr conversion when performed by the
DPF will match the BT.709 we would transmit with native HDMI.
Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com >
Cc: Uma Shankar <uma.shankar@intel.com >
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220322120015.28074-12-ville.syrjala@linux.intel.com
Reviewed-by: Uma Shankar <uma.shankar@intel.com >
2022-04-05 11:20:14 +03:00
Ville Syrjälä
56185b9048
drm/i915/dp: Duplicate native HDMI TMDS clock limit handling for DP HDMI DFPs
...
With native HDMI we allow the user to override the mode with
something that may not respect the downstream (sink,dual-mode adapter)
TMDS clock limits. Let's reuse the same logic for DP HDMI DFPs
so that behaviour is more or less uniform.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220322120015.28074-11-ville.syrjala@linux.intel.com
Reviewed-by: Uma Shankar <uma.shankar@intel.com >
2022-04-05 11:18:46 +03:00
Ville Syrjälä
632f853525
drm/i915/dp: Add support for "4:2:0 also" modes for DP
...
Currently we only support "4:2:0 also" modes on native HDMI.
Extend that support for DP as well.
With all the HDMI DFP TMDS clock handling sorted out this
is now going to work for both native DP and DP->HDMI
converters. As with native HDMI we first check if RGB
output is possible, and if not we try YCbCr 4:2:0 instead.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220322120015.28074-10-ville.syrjala@linux.intel.com
Reviewed-by: Uma Shankar <uma.shankar@intel.com >
2022-04-05 11:17:33 +03:00
Ville Syrjälä
7299b53074
drm/i915/dp: Rework HDMI DFP TMDS clock handling
...
Rework the HDMI DFP TMDS clock checks to also check at 8bpc.
Previously we only checked the deep color cases. But I suppose
a sink could potentially declare "4:2:0 also" modes that only
actually fit within its own limits when using 4:2:0. Even if
that is too nuts to be real there is no real harm in running
through the full checks for everything.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220322120015.28074-9-ville.syrjala@linux.intel.com
Reviewed-by: Uma Shankar <uma.shankar@intel.com >
2022-04-05 11:16:41 +03:00
Ville Syrjälä
84116d8bf6
drm/i915/dp: Make intel_dp_output_format() usable for "4:2:0 also" modes
...
Hoist the drm_mode_is_420_only() from intel_dp_output_format()
into the caller. This will allow intel_dp_output_format() to be
reused for "4:2:0 also" modes.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220322120015.28074-8-ville.syrjala@linux.intel.com
Reviewed-by: Uma Shankar <uma.shankar@intel.com >
2022-04-05 11:16:26 +03:00
Ville Syrjälä
2cad4279f4
drm/i915/dp: Pass around intel_connector rather than drm_connector
...
Prefer to use intel_connector over drm_connector. Also clean
up the related variable names a bit.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220322120015.28074-7-ville.syrjala@linux.intel.com
Reviewed-by: Uma Shankar <uma.shankar@intel.com >
2022-04-05 11:16:10 +03:00
Ville Syrjälä
dd93401075
drm/i915/dp: Reorder intel_dp_compute_config() a bit
...
Consolidate the double pfit call, and reorder things so that
intel_dp_output_format() and intel_dp_compute_link_config() are
back-to-back. They are intimately related, and will need to be
called twice to properly handle the "4:2:0 also" modes.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220322120015.28074-6-ville.syrjala@linux.intel.com
Reviewed-by: Uma Shankar <uma.shankar@intel.com >
2022-04-05 11:14:29 +03:00
Ville Syrjälä
ca4ca33917
drm/i915/dp: s/intel_dp_hdmi_ycbcr420/intel_dp_is_ycbcr420/
...
intel_dp_hdmi_ycbcr420() does account for native DP 4:2:0
output as well, so lets rename it a bit.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220322120015.28074-5-ville.syrjala@linux.intel.com
Reviewed-by: Uma Shankar <uma.shankar@intel.com >
2022-04-05 11:14:14 +03:00
Ville Syrjälä
97e04764f5
drm/i915/dp: Extract intel_dp_has_audio()
...
Declutter intel_dp_compute_config() a bit by moving the
has_audio computation into a helper. HDMI already does the same thing.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20220322120015.28074-4-ville.syrjala@linux.intel.com
Reviewed-by: Uma Shankar <uma.shankar@intel.com >
2022-04-05 11:13:40 +03:00