Michael Tretter
6acb691824
drm/bridge: samsung-dsim: calculate porches in Hz
...
Calculating the byte_clk in kHz is imprecise for a hs_clock of 55687500
Hz, which may be used with a pixel clock of 74.25 MHz with mode
1920x1080-30.
Fix the calculation by using HZ instead of kHZ.
This requires to change the type to u64 to prevent overflows of the
integer type.
Reviewed-by: Adam Ford <aford173@gmail.com > #imx8mm-beacon
Tested-by: Adam Ford <aford173@gmail.com > #imx8mm-beacon
Tested-by: Frieder Schrempf <frieder.schrempf@kontron.de > # Kontron BL i.MX8MM + Waveshare 10.1inch HDMI LCD (E)
Reviewed-by: Marco Felsch <m.felsch@pengutronix.de >
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de >
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com >
Link: https://lore.kernel.org/r/20230818-samsung-dsim-v2-5-846603df0e0a@pengutronix.de
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20230818-samsung-dsim-v2-5-846603df0e0a@pengutronix.de
2023-10-09 11:06:23 +02:00
Michael Tretter
198e54282a
drm/bridge: samsung-dsim: adjust porches by rounding up
...
Rounding the porches up instead of down fixes the samsung-dsim at
some more resolutions and refresh rates:
The following resolutions are working with rounded-up porches, but don't
work when the porches are rounded down:
1920x1080-59.94
1920x1080-30.00
1920x1080-29.97
1920x1080-25.00
1680x1050-59.88
1280x1024-75.02
1200x960-59.99
1280x720-50.00
1024x768-75.03
1024x768-60.00
640x480-60.00
640x480-59.94
Reviewed-by: Adam Ford <aford173@gmail.com > #imx8mm-beacon
Tested-by: Adam Ford <aford173@gmail.com > #imx8mm-beacon
Tested-by: Frieder Schrempf <frieder.schrempf@kontron.de > # Kontron BL i.MX8MM + Waveshare 10.1inch HDMI LCD (E)
Reviewed-by: Marco Felsch <m.felsch@pengutronix.de >
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de >
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com >
Link: https://lore.kernel.org/r/20230818-samsung-dsim-v2-4-846603df0e0a@pengutronix.de
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20230818-samsung-dsim-v2-4-846603df0e0a@pengutronix.de
2023-10-09 11:06:23 +02:00
Michael Tretter
846307185f
drm/bridge: samsung-dsim: update PLL reference clock
...
The PLL requires a clock frequency in a certain platform-dependent range
after the pre-divider. The reference clock for the PLL may change due to
changes to it's parent clock. Thus, the frequency may be out of range or
unsuited for generating the high speed clock for MIPI DSI.
Try to keep the pre-devider small, and set the reference clock close to
the upper limit before recalculating the PLL configuration. Use a
divider with a power of two for the reference clock as this seems to
work best in my tests.
Reviewed-by: Marco Felsch <m.felsch@pengutronix.de >
Tested-by: Frieder Schrempf <frieder.schrempf@kontron.de > # Kontron BL i.MX8MM + Waveshare 10.1inch HDMI LCD (E)
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de >
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com >
Link: https://lore.kernel.org/r/20230818-samsung-dsim-v2-3-846603df0e0a@pengutronix.de
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20230818-samsung-dsim-v2-3-846603df0e0a@pengutronix.de
2023-10-09 11:06:22 +02:00
Michael Tretter
eb26c6ab2a
drm/bridge: samsung-dsim: reread ref clock before configuring PLL
...
The PLL reference clock may change at runtime when its parent clock
changes. For example, this may happen on the i.MX8M Nano if the
reference clock is a child of the Video PLL. If the pixel clock changes,
this may propagate to the Video PLL and as a side effect change the
reference clock. Thus, reading the clock rate during probe is not
sufficient to correctly configure the PLL for the expected hs clock.
Read the actual rate of the reference clock before calculating the PLL
configuration parameters.
Note that the "samsung,pll-clock-frequency" is always preferred and PLL
reference clock is only read from the clock tree if that device tree
property is not set.
Reviewed-by: Inki Dae <inki.dae@samsung.com >
Acked-by: Inki Dae <inki.dae@samsung.com >
Tested-by: Frieder Schrempf <frieder.schrempf@kontron.de > # Kontron BL i.MX8MM + Waveshare 10.1inch HDMI LCD (E)
Reviewed-by: Marco Felsch <m.felsch@pengutronix.de >
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de >
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com >
Link: https://lore.kernel.org/r/20230818-samsung-dsim-v2-2-846603df0e0a@pengutronix.de
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20230818-samsung-dsim-v2-2-846603df0e0a@pengutronix.de
2023-10-09 11:06:22 +02:00
Marco Felsch
3683182a72
drm/bridge: samsung-dsim: add more mipi-dsi device debug information
...
Since the MIPI configuration can be changed on demand it is very useful
to print more MIPI settings during the MIPI device attach step.
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de >
Reviewed-by: Adam Ford <aford173@gmail.com > #imx8mm-beacon
Tested-by: Adam Ford <aford173@gmail.com > #imx8mm-beacon
Reviewed-by: Inki Dae <inki.dae@samsung.com >
Acked-by: Inki Dae <inki.dae@samsung.com >
Tested-by: Frieder Schrempf <frieder.schrempf@kontron.de > # Kontron BL i.MX8MM + Waveshare 10.1inch HDMI LCD (E)
Reviewed-by: Marco Felsch <m.felsch@pengutronix.de >
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de >
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com >
Link: https://lore.kernel.org/r/20230818-samsung-dsim-v2-1-846603df0e0a@pengutronix.de
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20230818-samsung-dsim-v2-1-846603df0e0a@pengutronix.de
2023-10-09 11:06:21 +02:00
Philipp Stanner
06ab64a0d8
drm: vmwgfx_surface.c: copy user-array safely
...
Currently, there is no overflow-check with memdup_user().
Use the new function memdup_array_user() instead of memdup_user() for
duplicating the user-space array safely.
Suggested-by: David Airlie <airlied@redhat.com >
Signed-off-by: Philipp Stanner <pstanner@redhat.com >
Reviewed-by: Kees Cook <keescook@chromium.org >
Reviewed-by: Zack Rusin <zackr@vmware.com >
Signed-off-by: Dave Airlie <airlied@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230920123612.16914-7-pstanner@redhat.com
2023-10-09 17:00:05 +10:00
Philipp Stanner
f37d63e219
drm_lease.c: copy user-array safely
...
Currently, there is no overflow-check with memdup_user().
Use the new function memdup_array_user() instead of memdup_user() for
duplicating the user-space array safely.
Suggested-by: David Airlie <airlied@redhat.com >
Signed-off-by: Philipp Stanner <pstanner@redhat.com >
Reviewed-by: Kees Cook <keescook@chromium.org >
Reviewed-by: Zack Rusin <zackr@vmware.com >
Signed-off-by: Dave Airlie <airlied@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230920123612.16914-6-pstanner@redhat.com
2023-10-09 16:59:49 +10:00
Dmitry Baryshkov
6be6ece920
drm/msm/dpu: stop using raw IRQ indices in the kernel traces
...
In preparation to reworking IRQ indcies, stop using raw indices in
kernel traces. Instead use a pair of register index and bit. This
corresponds closer to the values in HW catalog.
Reviewed-by: Marijn Suijten <marijn.suijten@somainline.org >
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Patchwork: https://patchwork.freedesktop.org/patch/550935/
Link: https://lore.kernel.org/r/20230802100426.4184892-8-dmitry.baryshkov@linaro.org
2023-10-09 00:34:44 +03:00
Dmitry Baryshkov
6893199183
drm/msm/dpu: stop using raw IRQ indices in the kernel output
...
In preparation to reworking IRQ indcies, stop using raw IRQ indices in
kernel output (both printk and debugfs). Instead use a pair of register
index and bit. This corresponds closer to the values in HW catalog.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Reviewed-by: Marijn Suijten <marijn.suijten@somainline.org >
Patchwork: https://patchwork.freedesktop.org/patch/550933/
Link: https://lore.kernel.org/r/20230802100426.4184892-7-dmitry.baryshkov@linaro.org
2023-10-09 00:34:44 +03:00
Dmitry Baryshkov
56acb1b620
drm/msm/dpu: make the irq table size static
...
The size of the irq table is static, it has MDP_INTR_MAX * 32 interrupt
entries. Provide the fixed length and drop struct_size() statement.
Reviewed-by: Marijn Suijten <marijn.suijten@somainline.org >
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Patchwork: https://patchwork.freedesktop.org/patch/550927/
Link: https://lore.kernel.org/r/20230802100426.4184892-6-dmitry.baryshkov@linaro.org
2023-10-09 00:34:44 +03:00
Dmitry Baryshkov
ea4842ed62
drm/msm/dpu: add helper to get IRQ-related data
...
In preparation to reworking IRQ indices, move irq_tbl access to
a separate helper.
Reviewed-by: Marijn Suijten <marijn.suijten@somainline.org >
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Patchwork: https://patchwork.freedesktop.org/patch/550931/
Link: https://lore.kernel.org/r/20230802100426.4184892-5-dmitry.baryshkov@linaro.org
2023-10-09 00:34:44 +03:00
Dmitry Baryshkov
a652648336
drm/msm/dpu: extract dpu_core_irq_is_valid() helper
...
In preparation to reworking IRQ indices, move irq_idx validation to
a separate helper.
Reviewed-by: Marijn Suijten <marijn.suijten@somainline.org >
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Patchwork: https://patchwork.freedesktop.org/patch/550929/
Link: https://lore.kernel.org/r/20230802100426.4184892-4-dmitry.baryshkov@linaro.org
2023-10-09 00:34:44 +03:00
Dmitry Baryshkov
e75e45c25b
drm/msm/dpu: remove irq_idx argument from IRQ callbacks
...
There is no point in passing the IRQ index to IRQ callbacks, no function
uses that. Drop it at last.
Reviewed-by: Marijn Suijten <marijn.suijten@somainline.org >
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Patchwork: https://patchwork.freedesktop.org/patch/550925/
Link: https://lore.kernel.org/r/20230802100426.4184892-3-dmitry.baryshkov@linaro.org
2023-10-09 00:34:44 +03:00
Jason-JH.Lin
53412dc290
drm/mediatek: Fix iommu fault during crtc enabling
...
The difference between drm_atomic_helper_commit_tail() and
drm_atomic_helper_commit_tail_rpm() is
drm_atomic_helper_commit_tail() will commit plane first and
then enable crtc, drm_atomic_helper_commit_tail_rpm() will
enable crtc first and then commit plane.
Before mediatek-drm enables crtc, the power and clk required
by OVL have not been turned on, so the commit plane cannot be
committed before crtc is enabled. That means OVL layer should
not be enabled before crtc is enabled.
Therefore, the atomic_commit_tail of mediatek-drm is hooked with
drm_atomic_helper_commit_tail_rpm().
Another reason is that the plane_state of drm_atomic_state is not
synchronized with the plane_state stored in mtk_crtc during crtc enablng,
so just set all planes to disabled.
Fixes: 119f517362 ("drm/mediatek: Add DRM Driver for Mediatek SoC MT8173.")
Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com >
Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com >
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com >
Reviewed-by: CK Hu <ck.hu@mediatek.com >
Link: https://patchwork.kernel.org/project/linux-mediatek/patch/20230809125722.24112-3-jason-jh.lin@mediatek.com/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org >
2023-10-08 01:30:52 +00:00
Jason-JH.Lin
3ec71e05ae
drm/mediatek: Fix iommu fault by swapping FBs after updating plane state
...
According to the comment in drm_atomic_helper_async_commit(),
we should make sure FBs have been swapped, so that cleanups in the
new_state performs a cleanup in the old FB.
So we should move swapping FBs after calling mtk_plane_update_new_state(),
to avoid using the old FB which could be freed.
Fixes: 1a64a7aff8 ("drm/mediatek: Fix cursor plane no update")
Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com >
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com >
Reviewed-by: CK Hu <ck.hu@mediatek.com >
Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com >
Link: https://patchwork.kernel.org/project/linux-mediatek/patch/20230809125722.24112-2-jason-jh.lin@mediatek.com/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org >
2023-10-08 01:28:31 +00:00
Jason-JH.Lin
26fdd23ff8
drm/mediatek: Support dynamic selection of MT8188 VDOSYS0
...
Move DDP_COMPONENT_DP_INTF0 from mt8188_mtk_ddp_main
array to a connector routes array called
mt8188_mtk_ddp_main_routes and add DDP_COMPONENT_DSI0
to mt8188_mtk_ddp_main_routes to support dynamic
selection capability for mt8188.
Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com >
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com >
Signed-off-by: Nathan Lu <nathan.lu@mediatek.com >
Reviewed-by: Matthias Brugger <matthias.bgg@gmail.com >
Reviewed-by: Fei Shao <fshao@chromium.org >
Tested-by: Fei Shao <fshao@chromium.org >
Link: https://patchwork.kernel.org/project/dri-devel/patch/20231004024013.18956-8-jason-jh.lin@mediatek.com/
Link: https://patchwork.kernel.org/project/dri-devel/patch/20231004024013.18956-10-jason-jh.lin@mediatek.com/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org >
2023-10-08 01:18:06 +00:00
Jason-JH.Lin
00d035228f
drm/mediatek: dsi: Support dynamic connector selection
...
Add implementation of mtk_dsi_encoder_index to mtk_ddp_comp_func
to make mtk_dsi support dynamic connector selection.
Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com >
Reviewed-by: CK Hu <ck.hu@mediatek.com >
Reviewed-by: Fei Shao <fshao@chromium.org >
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com >
Tested-by: Fei Shao <fshao@chromium.org >
Link: https://patchwork.kernel.org/project/dri-devel/patch/20231004024013.18956-9-jason-jh.lin@mediatek.com/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org >
2023-10-08 01:11:26 +00:00
Jason-JH.Lin
f6ec9da1e7
drm/mediatek: dpi: Support dynamic connector selection
...
Add implementation of mtk_dpi_encoder_index to mtk_ddp_comp_func
to make mtk_dpi support dynamic connector selection.
Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com >
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com >
Reviewed-by: CK Hu <ck.hu@mediatek.com >
Link: https://patchwork.kernel.org/project/dri-devel/patch/20231004024013.18956-7-jason-jh.lin@mediatek.com/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org >
2023-10-08 00:59:12 +00:00
Jason-JH.Lin
01389b324c
drm/mediatek: Add connector dynamic selection capability
...
Add dynamic select available connector flow in mtk_drm_crtc_create()
and mtk_drm_crtc_atomic_enable().
In mtk_drm_crtc_create(), if there is a connector routes array in drm
driver data, all components definded in the connector routes array will
be checked and their encoder_index will be set.
In mtk_drm_crtc_atomic_enable(), crtc will check its encoder_index to
identify which componet in the connector routes array should append.
Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com >
Signed-off-by: Nancy Lin <nancy.lin@mediatek.com >
Signed-off-by: Nathan Lu <nathan.lu@mediatek.com >
Tested-by: Fei Shao <fshao@chromium.org >
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com >
Reviewed-by: CK Hu <ck.hu@mediatek.com >
Link: https://patchwork.kernel.org/project/dri-devel/patch/20231004024013.18956-6-jason-jh.lin@mediatek.com/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org >
2023-10-08 00:57:21 +00:00
Jason-JH.Lin
a260f5624d
drm/mediatek: Add encoder_index interface for mtk_ddp_comp_funcs
...
To support dynamic connector selection function, each ddp_comp need to
get their encoder_index to identify which connector should be selected.
Add encoder_index interface for mtk_ddp_comp_funcs to get the encoder
identifier by drm_encoder_index().
Then drm driver will call mtk_ddp_comp_encoder_index_set() to store the
encoder_index to each ddp_comp in connector routes.
Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com >
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com >
Reviewed-by: CK Hu <ck.hu@mediatek.com >
Link: https://patchwork.kernel.org/project/dri-devel/patch/20231004024013.18956-5-jason-jh.lin@mediatek.com/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org >
2023-10-08 00:53:24 +00:00
Jason-JH.Lin
ebba096099
drm/mediatek: Fix using wrong drm private data to bind mediatek-drm
...
According to mtk_drm_kms_init(), the all_drm_private array in each
drm private data stores all drm private data in display path order.
In mtk_drm_get_all_drm_priv(), each element in all_drm_priv should have one
display path private data, such as:
all_drm_priv[CRTC_MAIN] should only have main_path data
all_drm_priv[CRTC_EXT] should only have ext_path data
all_drm_priv[CRTC_THIRD] should only have third_path data
So we need to add the length checking for each display path before
assigning their drm private data into all_drm_priv array.
Then the all_drm_private array in each drm private data needs to be
assigned in their display path order.
Fixes: 1ef7ed4835 ("drm/mediatek: Modify mediatek-drm for mt8195 multi mmsys support")
Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com >
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com >
Reviewed-by: CK Hu <ck.hu@mediatek.com >
Tested-by: Fei Shao <fshao@chromium.org >
Link: https://patchwork.kernel.org/project/dri-devel/patch/20231004024013.18956-4-jason-jh.lin@mediatek.com/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org >
2023-10-08 00:50:46 +00:00
Jason-JH.Lin
26c35d1d16
drm/mediatek: Add crtc path enum for all_drm_priv array
...
Add mtk_drm_crtc_path enum for each display path.
Instead of using array index of all_drm_priv in mtk_drm_kms_init(),
mtk_drm_crtc_path enum can make code more readable.
Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com >
Reviewed-by: Fei Shao <fshao@chromium.org >
Reviewed-by: CK Hu <ck.hu@mediatek.com >
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com >
Tested-by: Fei Shao <fshao@chromium.org >
Link: https://patchwork.kernel.org/project/dri-devel/patch/20231004024013.18956-3-jason-jh.lin@mediatek.com/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org >
2023-10-08 00:47:58 +00:00
Jason-JH.Lin
ff64e4c31d
drm/mediatek: Add mmsys_dev_num to mt8188 vdosys0 driver data
...
Add missing mmsys_dev_num to mt8188 vdosys0 driver data.
Fixes: 54b4808027 ("drm/mediatek: Add mediatek-drm of vdosys0 support for mt8188")
Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com >
Reviewed-by: CK Hu <ck.hu@mediatek.com >
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com >
Reviewed-by: Fei Shao <fshao@chromium.org >
Tested-by: Fei Shao <fshao@chromium.org >
Link: https://patchwork.kernel.org/project/dri-devel/patch/20231004024013.18956-2-jason-jh.lin@mediatek.com/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org >
2023-10-08 00:45:14 +00:00
John Harrison
1621a8edc2
drm/i915/guc: Update 'recommended' version to 70.12.1 for DG2/ADL-S/ADL-P/MTL
...
The latest GuC has new features and new workarounds that we wish to
enable. So let the universe know that it is useful to update their
firmware.
Signed-off-by: John Harrison <John.C.Harrison@Intel.com >
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com >
Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231006145801.161868-1-John.C.Harrison@Intel.com
2023-10-07 23:06:48 +02:00
Suraj Kandpal
3385375be6
drm/i915/ddi: Remove redundant intel_connector NULL check
...
Remove redundant intel_connector NULL check. Having it here just
creates further confusion and also the variable already gets
dereferenced before the aforementioned NULL check
Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com >
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com >
Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231006072830.581487-1-suraj.kandpal@intel.com
2023-10-07 08:08:49 +02:00
Sui Jingfeng
94cfada2a9
drm/qxl: Use pci_is_vga() to identify VGA devices
...
Use pci_is_vga() to identify VGA devices instead of a private is_vga()
function.
This means qxl will use the VGA arbiter for old PCI_CLASS_NOT_DEFINED_VGA
(0x0001) devices as well as the PCI_CLASS_DISPLAY_VGA (0x0300) devices it
recognized previously.
This probably doesn't make a difference because qxl_pci_driver doesn't
claim PCI_CLASS_NOT_DEFINED_VGA devices by default, so it's mainly a code
simplification.
Link: https://lore.kernel.org/r/20230830111532.444535-6-sui.jingfeng@linux.dev
Signed-off-by: Sui Jingfeng <suijingfeng@loongson.cn >
[bhelgaas: commit log]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com >
Cc: Dave Airlie <airlied@redhat.com >
Cc: Gerd Hoffmann <kraxel@redhat.com >
Cc: David Airlie <airlied@gmail.com >
Cc: Daniel Vetter <daniel@ffwll.ch >
2023-10-06 17:19:01 -05:00
Sui Jingfeng
76432cf63e
drm/virtio: Use pci_is_vga() to identify VGA devices
...
Use pci_is_vga() to identify VGA devices instead of open-coding the class
test.
This means virtio_gpu_pci_quirk() will apply to old
PCI_CLASS_NOT_DEFINED_VGA (0x0001) devices as well as the
PCI_CLASS_DISPLAY_VGA (0x0300) devices it did previously.
Link: https://lore.kernel.org/r/20230830111532.444535-5-sui.jingfeng@linux.dev
Signed-off-by: Sui Jingfeng <suijingfeng@loongson.cn >
[bhelgaas: commit log]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com >
Cc: David Airlie <airlied@redhat.com >
Cc: Gerd Hoffmann <kraxel@redhat.com >
Cc: Gurchetan Singh <gurchetansingh@chromium.org >
Cc: Chia-I Wu <olvaffe@gmail.com >
Cc: Daniel Vetter <daniel@ffwll.ch >
2023-10-06 17:19:01 -05:00
Ville Syrjälä
ae2b1c380e
drm/i915: s/dev_priv/i915/ in the state checker
...
Switch the state checker over to using the new 'i915' variable
name insteda of the old 'dev_priv'.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231004155607.7719-13-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
2023-10-07 00:12:46 +03:00
Ville Syrjälä
3ce6ac8c5e
drm/i915: s/pipe_config/crtc_state/ in the state checker
...
Switch over to the modern variable naming in the state checker.
Ie. rename the pipe_config stuff to crtc_state.
Also make it clear which is the "software state" (ie. what the
current state should be) vs. "hardware state" (ie. what the
currnet state really is).
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231004155607.7719-12-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
2023-10-07 00:12:46 +03:00
Ville Syrjälä
4627bef626
drm/i915: Simplify the state checker calling convetions
...
We're passing in a totally random mismash of things into the state
checker. Clean it up to pass in the minimum needed.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231004155607.7719-11-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
2023-10-07 00:12:46 +03:00
Ville Syrjälä
a4e71126ac
drm/i915: Constify remainder of the state checker
...
Mark the remaining crtc states used by the state checker as const.
There is no reason to ever mutate them here.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231004155607.7719-10-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
2023-10-07 00:12:46 +03:00
Ville Syrjälä
335aa752cf
drm/i915: Simplify snps/c10x DPLL state checker calling convetion
...
Passing in the atomic state + crtc state is a bit weird. The latter
can be just the crtc (which is the normal calling convention used
in a lot of other places).
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231004155607.7719-9-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
2023-10-07 00:12:46 +03:00
Ville Syrjälä
c788479a7c
drm/i915: Constify the snps/c10x PLL state checkers
...
State checkers should never modify the crtc states, so make
them const.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231004155607.7719-8-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
2023-10-07 00:12:46 +03:00
Ville Syrjälä
8f0994d47e
drm/i915: Simplify watermark state checker calling convention
...
There is never any reason to pass in both the crtc and its state
as one can always dig out the crtc from its state. But for more
consistency across the whole state checker let's just pass the
overall atomic state+crtc here as well.
v2: Also pass state+crtc here (Jani)
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231005122713.3531-1-ville.syrjala@linux.intel.com
2023-10-07 00:12:46 +03:00
Ville Syrjälä
487a2db8bc
drm/i915: Constify watermark state checker
...
The skl+ wm state checker has no reason to modify the crtc state,
so make it const.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231004155607.7719-6-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
2023-10-07 00:12:42 +03:00
Ville Syrjälä
4d6e198a3a
drm/i915: Simplify DPLL state checker calling convention
...
Make life simpler by just passing in the atomic state + crtc
instead of plumbing in all kinds of crtc states.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231004155607.7719-5-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
2023-10-06 23:59:20 +03:00
Ville Syrjälä
cfc7109bf6
drm/i915: Constify the crtc states in the DPLL checker
...
The DPLL state checker should not be modifying the crtc states,
so make the const.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231004155607.7719-4-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
2023-10-06 23:59:00 +03:00
Ville Syrjälä
2745bdda20
drm/i915: Stop clobbering old crtc state during state check
...
The state checker overwrites the old crtc state with the
current hardware state. While that does save a kmalloc() it seems
rather dubious as there might still be something that we need
in the old crtc state.
Stop doing that and just allocate a temporary state for the state
checker. Should the extra malloc during the commit phase turn out
too annoying we could of course preallocate one for each crtc, but
let's proceed with the straightforward approch for now.
And while at it let's mark the new crtc state as const to make
sure the state checker doesn't mess it up.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231004155607.7719-3-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
2023-10-06 23:58:33 +03:00
Ville Syrjälä
12e03c8058
drm/i915/psr: Unify PSR pre/post plane update hooks
...
intel_psr_pre_plane_update() operates on a per-crtc level, whereas
intel_psr_post_plane_update() operates on the whole atomic commit,
for no real reason that I can see. Adjust intel_psr_post_plane_update()
to match the intel_psr_pre_plane_update() approach.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231004155607.7719-2-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com >
2023-10-06 23:58:16 +03:00
Uwe Kleine-König
c1698c73f4
drm: exynos: dsi: Convert to platform remove callback returning void
...
The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new() which already returns void. Eventually after all drivers
are converted, .remove_new() is renamed to .remove().
samsung_dsim_remove() returned 0 unconditionally. Make it return void
instead to convert the two related platform drivers to use
.remove_new().
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de >
Reviewed-by: Inki Dae <inki.dae@samsung.com >
Acked-by: Inki Dae <inki.dae@samsung.com >
Link: https://lore.kernel.org/r/20230919103939.1367659-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20230919103939.1367659-1-u.kleine-koenig@pengutronix.de
2023-10-06 08:58:44 +02:00
Dave Airlie
67f35a41d3
Merge tag 'drm-misc-fixes-2023-10-05' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes
...
Short summary of fixes pull:
* test: Fix kunit release
* panel-orientation: Add quirk for One Mix 25
* nouveau:
* Report IB limit via getparams
* Replace some magic numbers with constants
* Clean up
Signed-off-by: Dave Airlie <airlied@redhat.com >
From: Thomas Zimmermann <tzimmermann@suse.de >
Link: https://patchwork.freedesktop.org/patch/msgid/20231005092632.GA17332@linux-uq9g
2023-10-06 12:48:06 +10:00
Dave Airlie
62af7387cd
Merge tag 'amd-drm-fixes-6.6-2023-10-04' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes
...
amd-drm-fixes-6.6-2023-10-04:
amdgpu:
- Add missing unique_id for GC 11.0.3
- Fix memory leak in FRU error path
- Fix PCIe link reporting on some SMU 11 parts
- Fix ACPI _PR3 detection
- Fix DISPCLK WDIVIDER handling in OTG code
Signed-off-by: Dave Airlie <airlied@redhat.com >
From: Alex Deucher <alexander.deucher@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20231005034358.7824-1-alexander.deucher@amd.com
2023-10-06 12:47:24 +10:00
Kees Cook
c8e7df374b
drm/amdgpu: Annotate struct amdgpu_bo_list with __counted_by
...
Prepare for the coming implementation by GCC and Clang of the __counted_by
attribute. Flexible array members annotated with __counted_by can have
their accesses bounds-checked at run-time via CONFIG_UBSAN_BOUNDS (for
array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family
functions).
As found with Coccinelle[1], add __counted_by for struct amdgpu_bo_list.
Additionally, since the element count member must be set before accessing
the annotated flexible array member, move its initialization earlier.
Cc: Alex Deucher <alexander.deucher@amd.com >
Cc: "Christian König" <christian.koenig@amd.com >
Cc: "Pan, Xinhui" <Xinhui.Pan@amd.com >
Cc: David Airlie <airlied@gmail.com >
Cc: Daniel Vetter <daniel@ffwll.ch >
Cc: "Gustavo A. R. Silva" <gustavoars@kernel.org >
Cc: Luben Tuikov <luben.tuikov@amd.com >
Cc: Christophe JAILLET <christophe.jaillet@wanadoo.fr >
Cc: Felix Kuehling <Felix.Kuehling@amd.com >
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Cc: linux-hardening@vger.kernel.org
Link: https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci [1]
Reviewed-by: Luben Tuikov <luben.tuikov@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Kees Cook <keescook@chromium.org >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-10-05 17:59:35 -04:00
Srinivasan Shanmugam
e0a3e7bf62
drm/amdgpu: Drop unnecessary return statements
...
There is no reason to call return at the end of function that
returns void.
Fixes the below:
WARNING: void function return statements are not generally useful
Thus remove such a statement in the affected functions.
Cc: Christian König <christian.koenig@amd.com >
Cc: Alex Deucher <alexander.deucher@amd.com >
Cc: "Pan, Xinhui" <Xinhui.Pan@amd.com >
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-10-05 17:59:35 -04:00
Lijo Lazar
4798db85b7
Documentation/amdgpu: Add board info details
...
Add documentation for board info sysfs attribute.
Signed-off-by: Lijo Lazar <lijo.lazar@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-10-05 17:59:35 -04:00
Lijo Lazar
76da73f026
drm/amdgpu: Add sysfs attribute to get board info
...
Add a sysfs attribute which shows the board form factor like OAM or
CEM.
Signed-off-by: Lijo Lazar <lijo.lazar@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-10-05 17:59:35 -04:00
Lijo Lazar
b0a4553336
drm/amdgpu: Get package types for smuio v13.0
...
Add support to query package types supported in smuio v13.0 ASICs.
Signed-off-by: Lijo Lazar <lijo.lazar@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-10-05 17:59:35 -04:00
Lijo Lazar
4365d2ed09
drm/amdgpu: Add more smuio v13.0.3 package types
...
Expand support to get other board types like OAM or CEM.
Signed-off-by: Lijo Lazar <lijo.lazar@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-10-05 17:59:35 -04:00
Sathishkumar S
cbad0dd13a
drm/amdgpu: fix ip count query for xcp partitions
...
fix wrong ip count INFO on spatial partitions. update the query
to return the instance count corresponding to the partition id.
v2:
initialize variables only when required to be (Christian)
move variable declarations to the beginning of function (Christian)
Signed-off-by: Sathishkumar S <sathishkumar.sundararaju@amd.com >
Acked-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-10-05 17:59:35 -04:00
Asad Kamal
c207c36544
drm/amd/pm: Remove set df cstate for SMUv13.0.6
...
Remove set df cstate as disallow df state is
not required for SMUv13.0.6
Signed-off-by: Asad Kamal <asad.kamal@amd.com >
Reviewed-by: Lijo Lazar <lijo.lazar@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-10-05 17:59:35 -04:00