Richard Acayan
9402cde934
drm/panel: vtdr6130: Use 16-bit brightness function
...
This panel communicates brightness in big endian. This is not a quirk of
the panels themselves, but rather, a part of the MIPI standard. Use the
new mipi_dsi_dcs_set_display_brightness_large() function that properly
handles 16-bit brightness instead of bypassing the brightness functions
entirely.
Signed-off-by: Richard Acayan <mailingradian@gmail.com >
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org >
Tested-by: Neil Armstrong <neil.armstrong@linaro.org > # on SM8550-MTP
Reviewed-by: Sam Ravnborg <sam@ravnborg.org >
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20230116224909.23884-4-mailingradian@gmail.com
2023-01-19 08:21:57 +01:00
Richard Acayan
fd40749a4f
drm/panel: sofef00: Use 16-bit brightness function
...
These panels communicate brightness in big endian. This is not a quirk
of the panels themselves, but rather, a part of the MIPI standard. Use
the new mipi_dsi_dcs_set_display_brightness_large() function that
properly handles 16-bit brightness instead of doing special processing
of the brightness values.
Signed-off-by: Richard Acayan <mailingradian@gmail.com >
Tested-by: Caleb Connolly <caleb@connolly.tech >
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org >
Reviewed-by: Sam Ravnborg <sam@ravnborg.org >
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20230116224909.23884-3-mailingradian@gmail.com
2023-01-19 08:21:57 +01:00
Daniel Mentz
c9d27c6be5
drm/mipi-dsi: Fix byte order of 16-bit DCS set/get brightness
...
The MIPI DCS specification demands that brightness values are sent in
big endian byte order. It also states that one parameter (i.e. one byte)
shall be sent/received for 8 bit wide values, and two parameters shall
be used for values that are between 9 and 16 bits wide.
Add new functions to properly handle 16-bit brightness in big endian,
since the two 8- and 16-bit cases are distinct from each other.
[richard: use separate functions instead of switch/case]
[richard: split into 16-bit component]
Fixes: 1a9d759331 ("drm/dsi: Implement DCS set/get display brightness")
Signed-off-by: Daniel Mentz <danielmentz@google.com >
Link: 754affd62d
[richard: fix 16-bit brightness_get]
Signed-off-by: Richard Acayan <mailingradian@gmail.com >
Tested-by: Caleb Connolly <caleb@connolly.tech >
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org >
Reviewed-by: Sam Ravnborg <sam@ravnborg.org >
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20230116224909.23884-2-mailingradian@gmail.com
2023-01-19 08:21:56 +01:00
Alex Deucher
a52287d66d
drm/amd/display: disable S/G display on DCN 3.1.4
...
Causes flickering or white screens in some configurations.
Disable it for now until we can fix the issue.
Cc: roman.li@amd.com
Cc: yifan1.zhang@amd.com
Acked-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Roman Li <Roman.Li@amd.com >
Reviewed-by: Yifan Zhang <yifan1.zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
Cc: stable@vger.kernel.org # 6.1.x
2023-01-18 23:23:24 -05:00
Alex Deucher
e78cc6a4c7
drm/amd/display: disable S/G display on DCN 3.1.5
...
Causes flickering or white screens in some configurations.
Disable it for now until we can fix the issue.
Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/2354
Cc: roman.li@amd.com
Cc: yifan1.zhang@amd.com
Acked-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Yifan Zhang <yifan1.zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
Cc: stable@vger.kernel.org # 6.1.x
2023-01-18 23:23:01 -05:00
Lang Yu
dc88063b87
drm/amdgpu: allow multipipe policy on ASICs with one MEC
...
Always enable multipipe policy on ASICs with GC VERSION > 9.0.0
instead of MEC number > 1.
This will allow multipipe policy on ASICs with one MEC,
e.g., gfx11 APUs.
Signed-off-by: Lang Yu <Lang.Yu@amd.com >
Reviewed-by: Aaron Liu <aaron.liu@amd.com >
Reviewed-by: Yifan Zhang <yifan1.zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
Cc: stable@vger.kernel.org # 6.1.x
2023-01-18 23:21:16 -05:00
Lang Yu
0ddadc3a22
drm/amdgpu: correct MEC number for gfx11 APUs
...
There is only one MEC on these APUs.
Signed-off-by: Lang Yu <Lang.Yu@amd.com >
Reviewed-by: Aaron Liu <aaron.liu@amd.com >
Reviewed-by: Yifan Zhang <yifan1.zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
Cc: stable@vger.kernel.org # 6.1.x
2023-01-18 23:20:31 -05:00
Hamza Mahfooz
e433adc60f
drm/amd/display: fix issues with driver unload
...
Currently, we run into a number of WARN()s when attempting to unload the
amdgpu driver (e.g. using "modprobe -r amdgpu"). These all stem from
calling drm_encoder_cleanup() too early. So, to fix this we can stop
calling drm_encoder_cleanup() from amdgpu_dm_fini() and instead have it
be called from amdgpu_dm_encoder_destroy(). Also, we don't need to free
in amdgpu_dm_encoder_destroy() since mst_encoders[] isn't explicitly
allocated by the slab allocator.
Fixes: f74367e492 ("drm/amdgpu/display: create fake mst encoders ahead of time (v4)")
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Hamza Mahfooz <hamza.mahfooz@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-01-18 23:20:16 -05:00
Christian König
74ea8e78ab
drm/amdgpu: fix amdgpu_job_free_resources v2
...
It can be that neither fence were initialized when we run out of UVD
streams for example.
v2: fix typo breaking compile
Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/2324
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
Cc: stable@vger.kernel.org # 6.1.x
2023-01-18 23:16:35 -05:00
Joshua Ashton
973a9c810c
drm/amd/display: Fix COLOR_SPACE_YCBCR2020_TYPE matrix
...
The YCC conversion matrix for RGB -> COLOR_SPACE_YCBCR2020_TYPE is
missing the values for the fourth column of the matrix.
The fourth column of the matrix is essentially just a value that is
added given that the color is 3 components in size.
These values are needed to bias the chroma from the [-1, 1] -> [0, 1]
range.
This fixes color being very green when using Gamescope HDR on HDMI
output which prefers YCC 4:4:4.
Fixes: 40df2f809e ("drm/amd/display: color space ycbcr709 support")
Reviewed-by: Melissa Wen <mwen@igalia.com >
Signed-off-by: Joshua Ashton <joshua@froggi.es >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
Cc: stable@vger.kernel.org
2023-01-18 23:15:34 -05:00
Joshua Ashton
79601b8948
drm/amd/display: Calculate output_color_space after pixel encoding adjustment
...
Code in get_output_color_space depends on knowing the pixel encoding to
determine whether to pick between eg. COLOR_SPACE_SRGB or
COLOR_SPACE_YCBCR709 for transparent RGB -> YCbCr 4:4:4 in the driver.
v2: Fixed patch being accidentally based on a personal feature branch, oops!
Fixes: ea117312ea ("drm/amd/display: Reduce HDMI pixel encoding if max clock is exceeded")
Reviewed-by: Melissa Wen <mwen@igalia.com >
Signed-off-by: Joshua Ashton <joshua@froggi.es >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
Cc: stable@vger.kernel.org
2023-01-18 23:14:26 -05:00
Christian König
4463b1eea2
drm/amdgpu: fix cleaning up reserved VMID on release
...
We need to reset this or otherwise run into list corruption later on.
Fixes: e44a0fe630 ("drm/amdgpu: rework reserved VMID handling")
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Tested-by: Candice Li <candice.li@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-01-18 23:13:14 -05:00
jie1zhan
c7bae4aaa5
drm/amdgpu: Correct the power calcultion for Renior/Cezanne.
...
From smu firmware,the value of power is transferred in units of watts.
Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/2321
Fixes: 137aac26a2 ("drm/amdgpu/smu12: fix power reporting on renoir")
Acked-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Jesse Zhang <Jesse.Zhang@amd.com >
Reviewed-by: Aaron Liu <aaron.liu@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
Cc: stable@vger.kernel.org
2023-01-18 23:10:31 -05:00
hongao
040625ab82
drm/amd/display: Fix set scaling doesn's work
...
[Why]
Setting scaling does not correctly update CRTC state. As a result
dc stream state's src (composition area) && dest (addressable area)
was not calculated as expected. This causes set scaling doesn's work.
[How]
Correctly update CRTC state when setting scaling property.
Reviewed-by: Harry Wentland <harry.wentland@amd.com >
Tested-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com >
Signed-off-by: hongao <hongao@uniontech.com >
Signed-off-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
Cc: stable@vger.kernel.org
2023-01-18 23:06:44 -05:00
Lang Yu
25959dd67d
drm/amdgpu: allow multipipe policy on ASICs with one MEC
...
Always enable multipipe policy on ASICs with GC VERSION > 9.0.0
instead of MEC number > 1.
This will allow multipipe policy on ASICs with one MEC,
e.g., gfx11 APUs.
Signed-off-by: Lang Yu <Lang.Yu@amd.com >
Reviewed-by: Aaron Liu <aaron.liu@amd.com >
Reviewed-by: Yifan Zhang <yifan1.zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-01-18 22:48:49 -05:00
Lang Yu
99761aaa1c
drm/amdgpu: correct MEC number for gfx11 APUs
...
There is only one MEC on these APUs.
Signed-off-by: Lang Yu <Lang.Yu@amd.com >
Reviewed-by: Aaron Liu <aaron.liu@amd.com >
Reviewed-by: Yifan Zhang <yifan1.zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-01-18 22:48:41 -05:00
Hamza Mahfooz
0feeb4fd4c
drm/amd/display: fix issues with driver unload
...
Currently, we run into a number of WARN()s when attempting to unload the
amdgpu driver (e.g. using "modprobe -r amdgpu"). These all stem from
calling drm_encoder_cleanup() too early. So, to fix this we can stop
calling drm_encoder_cleanup() from amdgpu_dm_fini() and instead have it
be called from amdgpu_dm_encoder_destroy(). Also, we don't need to free
in amdgpu_dm_encoder_destroy() since mst_encoders[] isn't explicitly
allocated by the slab allocator.
Fixes: f74367e492 ("drm/amdgpu/display: create fake mst encoders ahead of time (v4)")
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Hamza Mahfooz <hamza.mahfooz@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-01-18 22:46:33 -05:00
Guilherme G. Piccoli
09eb3ea391
drm/amdgpu/vcn: Remove redundant indirect SRAM HW model check
...
The HW model validation that guards the indirect SRAM checking in the
VCN code path is redundant - there's no model that's not included in the
switch, making it useless in practice [0].
So, let's remove this switch statement for good.
[0] lore.kernel.org/amd-gfx/MN0PR12MB61013D20B8A2263B22AE1BCFE2C19@MN0PR12MB6101.namprd12.prod.outlook.com
Suggested-by: Alex Deucher <Alexander.Deucher@amd.com >
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com >
Cc: James Zhu <James.Zhu@amd.com >
Cc: Lazar Lijo <Lijo.Lazar@amd.com >
Cc: Leo Liu <leo.liu@amd.com >
Cc: Sonny Jiang <sonny.jiang@amd.com >
Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-01-18 22:46:27 -05:00
Guilherme G. Piccoli
2ed9e22ed7
drm/amdgpu/vcn: Adjust firmware names indentation
...
This is an incredibly trivial fix, just for the sake of
"aesthetical" organization of the defines. Some were space based,
most were tab based and there was a lack of "alignment", now it's
all the same and aligned.
Cc: James Zhu <James.Zhu@amd.com >
Cc: Lazar Lijo <Lijo.Lazar@amd.com >
Cc: Leo Liu <leo.liu@amd.com >
Cc: Mario Limonciello <mario.limonciello@amd.com >
Cc: Sonny Jiang <sonny.jiang@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Guilherme G. Piccoli <gpiccoli@igalia.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-01-18 22:46:13 -05:00
Lucas De Marchi
ca54a9a32d
drm/i915/mtl: Fix bcs default context
...
Commit 0d0e7d1eea ("drm/i915/mtl: Define engine context layouts")
added the engine context for Meteor Lake. In a second revision of the
patch it was believed the xcs offsets were wrong due to a tagging
issue in the spec. The first version was actually correct, as shown
by the intel_lrc_live_selftests/live_lrc_layout test:
i915: Running gt_lrc
i915: Running intel_lrc_live_selftests/live_lrc_layout
bcs0: LRI command mismatch at dword 1, expected 1108101d found 11081019
[drm:drm_helper_probe_single_connector_modes [drm_kms_helper]] [CONNECTOR:236:DP-1] disconnected
bcs0: HW register image:
[0000] 00000000 1108101d 00022244 ffff0008 00022034 00000088 00022030 00000088
...
bcs0: SW register image:
[0000] 00000000 11081019 00022244 00090009 00022034 00000000 00022030 00000000
The difference in the 2 additional dwords (0x1d vs 0x19) are the offsets
0x120 / 0x124 that are indeed part of the context image.
Bspec: 45585
Fixes: 0d0e7d1eea ("drm/i915/mtl: Define engine context layouts")
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com >
Signed-off-by: Radhakrishna Sripada <radhakrishna.sripada@intel.com >
Reviewed-by: Matt Roper <matthew.d.roper@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230111235531.3353815-2-radhakrishna.sripada@intel.com
2023-01-18 17:52:39 -08:00
Matt Roper
262a6cd00c
drm/i915: Move/adjust register definitions related to Wa_22011450934
...
The implementation of Wa_22011450934 introduced three new register
definitions in i915_reg.h that didn't get moved to the GT/engine
register headers when all the other registers moved; let's move them to
the appropriate headers and tidy up their definitions now for
consistency:
- STATE_ACK_DEBUG is moved to the engine register header and converted
to a parameterized definition; the workaround only needs the RCS
instance to be programmed, but there are instances on other engines
that could be used by other workarounds in the future.
- The two CULLBIT registers move to the GT register header. Since
they belong to MMIO ranges that became MCR starting with Xe_HP,
their definitions should be defined as MCR_REG() and use an Xe_HP
prefix to keep the register semantics clear.
Note that the MCR definition is just for consistency and to prevent
accidental misuse if other workarounds related to these registers show
up in the future. There's no functional change to today's driver since
the workaround that references these registers only accesses them via
MI_LRR engine instructions. Engine-initiated register accesses do not
utilize the same steering controls as CPU-initiated accesses; they
use a different steering control register (0x20CC) which is initialized
to a non-terminated DSS target by pre-OS firmware and never changed
thereafter (i915 does not touch it and userspace does not have
permission to change that register).
Signed-off-by: Matt Roper <matthew.d.roper@intel.com >
Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230117202627.4134579-1-matthew.d.roper@intel.com
2023-01-18 12:29:10 -08:00
Nirmoy Das
2293a73ad4
drm/i915: Remove unused variable
...
Removed unused i915 var.
Fixes: a273e95721 ("drm/i915: Allow switching away via vga-switcheroo if uninitialized")
Signed-off-by: Nirmoy Das <nirmoy.das@intel.com >
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230118170624.9326-1-nirmoy.das@intel.com
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
2023-01-18 13:33:15 -05:00
Matt Atwood
afdecb2327
drm/i915/dg2: Introduce Wa_18019271663
...
Wa_18019271663 applies to all DG2 steppings and skus.
Bspec: 66622
Signed-off-by: Matt Atwood <matthew.s.atwood@intel.com >
Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com >
Signed-off-by: Matt Roper <matthew.d.roper@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20221123183648.407058-2-matthew.s.atwood@intel.com
(cherry picked from commit 900a80c583 )
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
2023-01-18 11:56:54 -05:00
Matt Atwood
ce38cb84c3
drm/i915/dg2: Introduce Wa_18018764978
...
Wa_18018764978 applies to specific steppings of DG2 (G10 C0+,
G11 and G12 A0+). Clean up style in function at the same time.
Bspec: 66622
Signed-off-by: Matt Atwood <matthew.s.atwood@intel.com >
Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com >
Signed-off-by: Matt Roper <matthew.d.roper@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20221123183648.407058-1-matthew.s.atwood@intel.com
(cherry picked from commit 468a4e630c )
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
2023-01-18 11:53:46 -05:00
Deepak R Varma
24d97468f4
drm/i915/display: Convert i9xx_pipe_crc_auto_source to void
...
Convert function i9xx_pipe_crc_auto_source() to return void instead
of int since the current implementation always returns 0 to the caller.
Issue identified using returnvar Coccinelle semantic patch.
$ make coccicheck COCCI=scripts/coccinelle/misc/returnvar.cocci \
M=drivers/gpu/drm/i915/
Signed-off-by: Deepak R Varma <drv@mailo.com >
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/Y8K2SS/zNiPAmLsS@ubun2204.myguest.virtualbox.org
2023-01-18 11:33:04 -05:00
Thomas Zimmermann
d1d5101452
drm/fb-helper: Set framebuffer for vga-switcheroo clients
...
Set the framebuffer info for drivers that support VGA switcheroo. Only
affects the amdgpu and nouveau drivers, which use VGA switcheroo and
generic fbdev emulation. For other drivers, this does nothing.
This fixes a potential regression in the console code. Both, amdgpu and
nouveau, invoked vga_switcheroo_client_fb_set() from their internal fbdev
code. But the call got lost when the drivers switched to the generic
emulation.
Fixes: 087451f372 ("drm/amdgpu: use generic fb helpers instead of setting up AMD own's.")
Fixes: 4a16dd9d18 ("drm/nouveau/kms: switch to drm fbdev helpers")
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Cc: Ben Skeggs <bskeggs@redhat.com >
Cc: Karol Herbst <kherbst@redhat.com >
Cc: Lyude Paul <lyude@redhat.com >
Cc: Thomas Zimmermann <tzimmermann@suse.de >
Cc: Javier Martinez Canillas <javierm@redhat.com >
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com >
Cc: Jani Nikula <jani.nikula@intel.com >
Cc: Dave Airlie <airlied@redhat.com >
Cc: Evan Quan <evan.quan@amd.com >
Cc: Christian König <christian.koenig@amd.com >
Cc: Alex Deucher <alexander.deucher@amd.com >
Cc: Hawking Zhang <Hawking.Zhang@amd.com >
Cc: Likun Gao <Likun.Gao@amd.com >
Cc: "Christian König" <christian.koenig@amd.com >
Cc: Stanley Yang <Stanley.Yang@amd.com >
Cc: "Tianci.Yin" <tianci.yin@amd.com >
Cc: Xiaojian Du <Xiaojian.Du@amd.com >
Cc: Andrey Grodzovsky <andrey.grodzovsky@amd.com >
Cc: YiPeng Chai <YiPeng.Chai@amd.com >
Cc: Somalapuram Amaranath <Amaranath.Somalapuram@amd.com >
Cc: Bokun Zhang <Bokun.Zhang@amd.com >
Cc: Guchun Chen <guchun.chen@amd.com >
Cc: Hamza Mahfooz <hamza.mahfooz@amd.com >
Cc: Aurabindo Pillai <aurabindo.pillai@amd.com >
Cc: Mario Limonciello <mario.limonciello@amd.com >
Cc: Solomon Chiu <solomon.chiu@amd.com >
Cc: Kai-Heng Feng <kai.heng.feng@canonical.com >
Cc: Felix Kuehling <Felix.Kuehling@amd.com >
Cc: Daniel Vetter <daniel.vetter@ffwll.ch >
Cc: "Marek Olšák" <marek.olsak@amd.com >
Cc: Sam Ravnborg <sam@ravnborg.org >
Cc: Hans de Goede <hdegoede@redhat.com >
Cc: "Ville Syrjälä" <ville.syrjala@linux.intel.com >
Cc: dri-devel@lists.freedesktop.org
Cc: nouveau@lists.freedesktop.org
Cc: <stable@vger.kernel.org > # v5.17+
Link: https://patchwork.freedesktop.org/patch/msgid/20230116115425.13484-3-tzimmermann@suse.de
2023-01-18 17:12:23 +01:00
Thomas Zimmermann
a273e95721
drm/i915: Allow switching away via vga-switcheroo if uninitialized
...
Always allow switching away via vga-switcheroo if the display is
uninitalized. Instead prevent switching to i915 if the device has
not been initialized.
This issue was introduced by commit 5df7bd1308 ("drm/i915: skip
display initialization when there is no display") protected, which
protects code paths from being executed on uninitialized devices.
In the case of vga-switcheroo, we want to allow a switch away from
i915's device. So run vga_switcheroo_process_delayed_switch() and
test in the switcheroo callbacks if the i915 device is available.
Fixes: 5df7bd1308 ("drm/i915: skip display initialization when there is no display")
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Cc: Radhakrishna Sripada <radhakrishna.sripada@intel.com >
Cc: Lucas De Marchi <lucas.demarchi@intel.com >
Cc: José Roberto de Souza <jose.souza@intel.com >
Cc: Jani Nikula <jani.nikula@intel.com >
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com >
Cc: Jani Nikula <jani.nikula@linux.intel.com >
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com >
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com >
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com >
Cc: "Ville Syrjälä" <ville.syrjala@linux.intel.com >
Cc: Manasi Navare <manasi.d.navare@intel.com >
Cc: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com >
Cc: Imre Deak <imre.deak@intel.com >
Cc: "Jouni Högander" <jouni.hogander@intel.com >
Cc: Uma Shankar <uma.shankar@intel.com >
Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com >
Cc: "Jason A. Donenfeld" <Jason@zx2c4.com >
Cc: Matt Roper <matthew.d.roper@intel.com >
Cc: Ramalingam C <ramalingam.c@intel.com >
Cc: Thomas Zimmermann <tzimmermann@suse.de >
Cc: Andi Shyti <andi.shyti@linux.intel.com >
Cc: Andrzej Hajda <andrzej.hajda@intel.com >
Cc: "José Roberto de Souza" <jose.souza@intel.com >
Cc: Julia Lawall <Julia.Lawall@inria.fr >
Cc: intel-gfx@lists.freedesktop.org
Cc: <stable@vger.kernel.org > # v5.14+
Link: https://patchwork.freedesktop.org/patch/msgid/20230116115425.13484-2-tzimmermann@suse.de
2023-01-18 17:12:23 +01:00
Chris Wilson
93eea62452
drm/i915/selftests: Unwind hugepages to drop wakeref on error
...
Make sure that upon error after we have acquired the wakeref we do
release it again.
v2: add another missing "goto out_wf"(Andi).
Fixes: 027c38b412 ("drm/i915/selftests: Grab the runtime pm in shrink_thp")
Cc: Andi Shyti <andi.shyti@linux.intel.com >
Reviewed-by: Matthew Auld <matthew.auld@intel.com >
Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com >
Signed-off-by: Chris Wilson <chris.p.wilson@linux.intel.com >
Signed-off-by: Nirmoy Das <nirmoy.das@intel.com >
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com >
Reviewed-by: Nirmoy Das <nirmoy.das@intel.com >
Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230117123234.26487-1-nirmoy.das@intel.com
(cherry picked from commit 14ec40a882 )
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
2023-01-18 10:36:21 -05:00
Sasa Dragic
67b0b4ed25
drm/i915: re-disable RC6p on Sandy Bridge
...
RC6p on Sandy Bridge got re-enabled over time, causing visual glitches
and GPU hangs.
Disabled originally in commit 1c8ecf80fd ("drm/i915: do not enable
RC6p on Sandy Bridge").
Signed-off-by: Sasa Dragic <sasa.dragic@gmail.com >
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20221219172927.9603-2-sasa.dragic@gmail.com
Fixes: fb6db0f5bf ("drm/i915: Remove unsafe i915.enable_rc6")
Fixes: 13c5a577b3 ("drm/i915/gt: Select the deepest available parking mode for rc6")
Cc: stable@vger.kernel.org
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
(cherry picked from commit 0c8a6e9ea2 )
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
2023-01-18 10:36:18 -05:00
Christian König
13acb368bf
drm/ttm/vmwgfx: move ttm_bo_wait into VMWGFX
...
Not used anymore by other drivers or TTM itself.
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Zack Rusin <zackr@vmware.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20221125102137.1801-9-christian.koenig@amd.com
2023-01-18 15:57:52 +01:00
Christian König
41d351f295
drm/nouveau: stop using ttm_bo_wait
...
TTM is just wrapping core DMA functionality here, remove the mid-layer.
No functional change.
Signed-off-by: Christian König <christian.koenig@amd.com >
Acked-by: Karol Herbst <kherbst@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20221125102137.1801-5-christian.koenig@amd.com
2023-01-18 15:57:52 +01:00
Dmitry Baryshkov
5e83f359d9
drm/bridge: lt9611: properly program the dual host mode
...
If the bridge is connected using both DSI ports, the driver should use
both of them all the time. Correct programming sequence to always use
dual-port mode if both dsi0 and dsi1 are connected.
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org >
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20230118081658.2198520-14-dmitry.baryshkov@linaro.org
2023-01-18 15:27:10 +01:00
Dmitry Baryshkov
4914cbc4fb
drm/bridge: lt9611: stop filtering modes via the table
...
The lt9611 bridge can support different modes, it makes no sense to list
them in the table. Drop the table and check the number of interfaces
using the fixed value.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org >
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20230118081658.2198520-13-dmitry.baryshkov@linaro.org
2023-01-18 15:27:09 +01:00
Dmitry Baryshkov
84cf74d99f
drm/bridge: lt9611: rework infoframes handling
...
Rework handling infoframes:
- Write full HDMI AVI infoframe instead of just fixing the VIC value
- Also send the HDMI Vendor Specific infoframe, as recommended by the
HDMI spec.
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org >
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20230118081658.2198520-12-dmitry.baryshkov@linaro.org
2023-01-18 15:27:09 +01:00
Dmitry Baryshkov
6b089d5e35
drm/bridge: lt9611: simplify video timings programming
...
Inline calculated values to simplify the calculation in
lt9611_mipi_video_setup().
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org >
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20230118081658.2198520-11-dmitry.baryshkov@linaro.org
2023-01-18 15:27:09 +01:00
Dmitry Baryshkov
0c74746948
drm/bridge: lt9611: fix sync polarity for DVI output
...
Attaching DVI sink to the lt9611 requires different setup. Fix the
register write to make the DVI displays sync onto the correct sync
pulse.
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org >
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20230118081658.2198520-10-dmitry.baryshkov@linaro.org
2023-01-18 15:27:08 +01:00
Dmitry Baryshkov
0c3997b0fe
drm/bridge: lt9611: attach to the next bridge
...
The bindings require that there is a next bridge after the lt9611. If
nothing else it can be the hdmi-connector (as used on the RB3 platform,
see sdm845-db845c.dts).
Bring in the next bridge into the drm bridges chain and attach to it.
Since lt9611 is not anymore the last bridge in the chain, this also
allows us to drop all the !DRM_BRIDGE_ATTACH_NO_CONNECTOR functionality.
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org >
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20230118081658.2198520-9-dmitry.baryshkov@linaro.org
2023-01-18 15:27:08 +01:00
Dmitry Baryshkov
fad97f2811
drm/bridge: lt9611: rework the mode_set function
...
The mode_set callback is deprectated for drm_bridges in favour of using
atomic_enable callback. Move corresponding code into the function
lt9611_bridge_atomic_enable() and turn lt9611_bridge_pre_enable() into
the proper atomic_pre_enable callback.
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org >
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20230118081658.2198520-8-dmitry.baryshkov@linaro.org
2023-01-18 15:27:07 +01:00
Dmitry Baryshkov
b0a7f87367
drm/bridge: lt9611: pass a pointer to the of node
...
Pass a pointer to the OF node while registering lt9611 MIPI device.
Fixes: 23278bf54a ("drm/bridge: Introduce LT9611 DSI to HDMI bridge")
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org >
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20230118081658.2198520-7-dmitry.baryshkov@linaro.org
2023-01-18 15:27:07 +01:00
Dmitry Baryshkov
2576eb2649
drm/bridge: lt9611: fix clock calculation
...
Instead of having several fixed values for the pcr register, calculate
it before programming. This allows the bridge to support most of the
display modes.
Fixes: 23278bf54a ("drm/bridge: Introduce LT9611 DSI to HDMI bridge")
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org >
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20230118081658.2198520-6-dmitry.baryshkov@linaro.org
2023-01-18 15:27:06 +01:00
Dmitry Baryshkov
ad188aa47e
drm/bridge: lt9611: fix programming of video modes
...
Program the upper part of the hfront_porch into the proper register.
Fixes: 23278bf54a ("drm/bridge: Introduce LT9611 DSI to HDMI bridge")
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org >
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20230118081658.2198520-5-dmitry.baryshkov@linaro.org
2023-01-18 15:27:06 +01:00
Dmitry Baryshkov
0b157efa38
drm/bridge: lt9611: fix polarity programming
...
Fix programming of hsync and vsync polarities
Fixes: 23278bf54a ("drm/bridge: Introduce LT9611 DSI to HDMI bridge")
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org >
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20230118081658.2198520-4-dmitry.baryshkov@linaro.org
2023-01-18 15:27:05 +01:00
Dmitry Baryshkov
a7790f6bd3
drm/bridge: lt9611: fix HPD reenablement
...
The driver will reset the bridge in the atomic_pre_enable(). However
this will also drop the HPD interrupt state. Instead of resetting the
bridge, properly wake it up. This fixes the HPD interrupt delivery after
the disable/enable cycle.
Fixes: 23278bf54a ("drm/bridge: Introduce LT9611 DSI to HDMI bridge")
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org >
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20230118081658.2198520-3-dmitry.baryshkov@linaro.org
2023-01-18 15:27:05 +01:00
Dmitry Baryshkov
ae2d329f10
drm/bridge: lt9611: fix sleep mode setup
...
On atomic_post_disable the bridge goes to the low power state. However
the code disables too much of the chip, so the HPD event is not being
detected and delivered to the host. Reduce the power saving in order to
get the HPD event.
Fixes: 23278bf54a ("drm/bridge: Introduce LT9611 DSI to HDMI bridge")
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org >
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20230118081658.2198520-2-dmitry.baryshkov@linaro.org
2023-01-18 15:27:04 +01:00
Christian König
5efbe6aa7a
drm/scheduler: deprecate drm_sched_resubmit_jobs
...
This interface is not working as it should.
Signed-off-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20221109095010.141189-5-christian.koenig@amd.com
2023-01-18 12:46:52 +01:00
Arnd Bergmann
6437a549ae
drm/panfrost: fix GENERIC_ATOMIC64 dependency
...
On ARMv5 and earlier, a randconfig build can still run into
WARNING: unmet direct dependencies detected for IOMMU_IO_PGTABLE_LPAE
Depends on [n]: IOMMU_SUPPORT [=y] && (ARM [=y] || ARM64 || COMPILE_TEST [=y]) && !GENERIC_ATOMIC64 [=y]
Selected by [y]:
- DRM_PANFROST [=y] && HAS_IOMEM [=y] && DRM [=y] && (ARM [=y] || ARM64 || COMPILE_TEST [=y] && !GENERIC_ATOMIC64 [=y]) && MMU [=y]
Rework the dependencies to always require a working cmpxchg64.
Fixes: db594ba3fc ("drm/panfrost: depend on !GENERIC_ATOMIC64 when using COMPILE_TEST")
Signed-off-by: Arnd Bergmann <arnd@arndb.de >
Reviewed-by: Steven Price <steven.price@arm.com >
Signed-off-by: Steven Price <steven.price@arm.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230117164456.1591901-1-arnd@kernel.org
2023-01-18 11:09:57 +00:00
Jani Nikula
e2855f8e91
drm/i915: move chv_dpll_md and bxt_phy_grc to display sub-struct under state
...
Move the display related members to the struct drm_i915_private display
sub-struct. Put them under "state", as they are related to storing
values that aren't readable from the hardware, to appease the state
checker.
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230117143946.2426043-3-jani.nikula@intel.com
2023-01-18 12:17:19 +02:00
Jani Nikula
a3f839762c
drm/i915: move pch_ssc_use to display sub-struct under dpll
...
Move the display related member to the struct drm_i915_private display
sub-struct.
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230117143946.2426043-2-jani.nikula@intel.com
2023-01-18 12:17:14 +02:00
Jani Nikula
3a7e2d58f8
drm/i915: move snps_phy_failed_calibration to display sub-struct under snps
...
Move the display related member to the struct drm_i915_private display
sub-struct.
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230117143946.2426043-1-jani.nikula@intel.com
2023-01-18 12:17:03 +02:00
Jani Nikula
378e04f7cb
drm/i915: remove a couple of superfluous i915_drm.h includes
...
Remove a couple of unnecessary includes.
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230117123856.2271720-1-jani.nikula@intel.com
2023-01-18 11:55:08 +02:00