[PATCH] drm/amdkfd: use vma_lookup() instead of find_vma()

2022-10-09 Thread Deming Wang
Using vma_lookup() verifies the start address is contained in the found vma. This results in easier to read the code. Signed-off-by: Deming Wang --- drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/k

[PATCH] Revert "drm/sched: Use parent fence instead of finished"

2022-10-09 Thread hongchengwen
From: Dave Airlie This reverts commit e4dc45b1848bc6bcac31eb1b4ccdd7f6718b3c86. This is causing instability on Linus' desktop, and I'm seeing oops with VK CTS runs. netconsole got me the following oops: [ 1234.778760] BUG: kernel NULL pointer dereference, address: 0088 [ 1234.778782

Re: [PATCH] drm/sched: Fix kernel NULL pointer dereference error

2022-10-09 Thread Michal Kubecek
On Fri, Sep 30, 2022 at 09:09:56PM +0530, Yadav, Arvind wrote: > > On 9/30/2022 4:56 PM, Christian König wrote: > > Am 30.09.22 um 10:48 schrieb Arvind Yadav: > > > BUG: kernel NULL pointer dereference, address: 0088 > > >   #PF: supervisor read access in kernel mode > > >   #PF: error

[PATCH] drm/amdkfd: use vma_lookup() instead of find_vma()

2022-10-09 Thread Deming Wang
Using vma_lookup() verifies the start address is contained in the found vma. This results in easier to read the code. Signed-off-by: Deming Wang --- drivers/gpu/drm/amd/amdkfd/kfd_migrate.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kf

[GIT PULL] fbdev fixes and updates for v6.1-rc1

2022-10-09 Thread Helge Deller
Hi Linus, please pull the fbdev fixes and updates for kernel 6.1-rc1. Included is a fix for the smscufx USB graphics card to prevent a kernel crash if it's plugged in/out too fast. The other patches are mostly small cleanups, fixes in failure paths and code removal. More details are in the comm

Re: [PATCH v5 0/7] treewide cleanup of random integer usage

2022-10-09 Thread Jason A. Donenfeld
On Sat, Oct 08, 2022 at 08:41:14PM -0700, Kees Cook wrote: > On Fri, Oct 07, 2022 at 11:53:52PM -0600, Jason A. Donenfeld wrote: > > This is a five part treewide cleanup of random integer handling. The > > rules for random integers are: > > Reviewing the delta between of my .cocci rules and your v

[RFC PATCH] drm/syncobj: add IOCTL to register an eventfd for a timeline

2022-10-09 Thread Simon Ser
Introduce a new DRM_IOCTL_SYNCOBJ_TIMELINE_REGISTER_EVENTFD IOCTL which signals an eventfd when a timeline point completes. This is useful for Wayland compositors to handle wait-before-submit. Wayland clients can send a timeline point to the compositor before the point has materialized yet, then c

Re: [RFC PATCH] drm/syncobj: add IOCTL to register an eventfd for a timeline

2022-10-09 Thread Christian König
Am 09.10.22 um 16:40 schrieb Simon Ser: Introduce a new DRM_IOCTL_SYNCOBJ_TIMELINE_REGISTER_EVENTFD IOCTL which signals an eventfd when a timeline point completes. I was entertaining the same though for quite a while, but I would even go a step further and actually always base the wait before

Re: [PATCH] drm/gem: Avoid use-after-free on drm_gem_mmap_obj() failure

2022-10-09 Thread Shigeru Yoshida
ping? On Tue, 20 Sep 2022 16:24:08 +0900, Shigeru Yoshida wrote: > syzbot reported use-after-free for drm_gem_object [1]. This causes > the call trace like below: > > [ 75.327400][ T5723] Call Trace: > [ 75.327611][ T5723] > [ 75.327803][ T5723] drm_gem_object_handle_put_unlocked+0x11e/

[PATCH v3 01/10] drm/msm/dsi: Remove useless math in DSC calculations

2022-10-09 Thread Marijn Suijten
Multiplying a value by 2 and adding 1 to it always results in a value that is uneven, and that 1 gets truncated immediately when performing integer division by 2 again. There is no "rounding" possible here. After that target_bpp_x16 is used to store a multiplication of bits_per_pixel by 16 which

[PATCH v3 00/10] drm/msm: Fix math issues in MSM DSC implementation

2022-10-09 Thread Marijn Suijten
Various removals of complex yet unnecessary math, fixing all uses of drm_dsc_config::bits_per_pixel to deal with the fact that this field includes four fractional bits, and finally making sure that range_bpg_offset contains values 6-bits wide to prevent overflows in drm_dsc_pps_payload_pack(). Alt

[PATCH v3 02/10] drm/msm/dsi: Remove repeated calculation of slice_per_intf

2022-10-09 Thread Marijn Suijten
slice_per_intf is already computed for intf_width, which holds the same value as hdisplay. Fixes: 08802f515c3c ("drm/msm/dsi: Add support for DSC configuration") Signed-off-by: Marijn Suijten Reviewed-by: Bjorn Andersson Reviewed-by: Konrad Dybcio Reviewed-by: Abhinav Kumar Reviewed-by: Vinod

[PATCH v3 04/10] drm/msm/dsi: Reuse earlier computed dsc->slice_chunk_size

2022-10-09 Thread Marijn Suijten
dsi_populate_dsc_params() is called prior to dsi_update_dsc_timing() and already computes a value for slice_chunk_size, whose value doesn't need to be recomputed and re-set here. Fixes: 08802f515c3c ("drm/msm/dsi: Add support for DSC configuration") Signed-off-by: Marijn Suijten Reviewed-by: Abhi

[PATCH v3 05/10] drm/msm/dsi: Appropriately set dsc->mux_word_size based on bpc

2022-10-09 Thread Marijn Suijten
This field is currently unread but will come into effect when duplicated code below is migrated to call drm_dsc_compute_rc_parameters(), which uses the bpc-dependent value of the local variable mux_words_size in much the same way. The hardcoded constant seems to be a remnant from the `/* bpc 8 */`

[PATCH v3 03/10] drm/msm/dsi: Use DIV_ROUND_UP instead of conditional increment on modulo

2022-10-09 Thread Marijn Suijten
This exact same math is used to compute bytes_in_slice above in dsi_update_dsc_timing(), also used to fill slice_chunk_size. Fixes: b9080324d6ca ("drm/msm/dsi: add support for dsc data") Signed-off-by: Marijn Suijten Reviewed-by: Abhinav Kumar --- drivers/gpu/drm/msm/dsi/dsi_host.c | 4 +--- 1

[PATCH v3 06/10] drm/msm/dsi: Migrate to drm_dsc_compute_rc_parameters()

2022-10-09 Thread Marijn Suijten
As per the FIXME this code is entirely duplicate with what is already provided inside drm_dsc_compute_rc_parameters(), and it is yet unknown why this comment was put in place instead of resolved from the get-go. Not only does it save on duplication, it would have also spared certain issues. For ex

[PATCH v3 06/10] drm/msm/dsi: Migrate to drm_dsc_compute_rc_parameters()

2022-10-09 Thread Marijn Suijten
As per the FIXME this code is entirely duplicate with what is already provided inside drm_dsc_compute_rc_parameters(), and it is yet unknown why this comment was put in place instead of resolved from the get-go. Not only does it save on duplication, it would have also spared certain issues. For ex

[PATCH v3 07/10] drm/msm/dsi: Disallow 8 BPC DSC configuration for alternative BPC values

2022-10-09 Thread Marijn Suijten
According to the `/* bpc 8 */` comment below only values for a bits_per_component of 8 are currently hardcoded in place. This is further confirmed by downstream sources [1] containing different constants for other BPC values (and different initial_offset too, with an extra dependency on bits_per_p

Re: [PATCH v3 01/10] drm/msm/dsi: Remove useless math in DSC calculations

2022-10-09 Thread Dmitry Baryshkov
On 09/10/2022 21:48, Marijn Suijten wrote: Multiplying a value by 2 and adding 1 to it always results in a value that is uneven, and that 1 gets truncated immediately when performing integer division by 2 again. There is no "rounding" possible here. After that target_bpp_x16 is used to store a

Re: [PATCH v3 02/10] drm/msm/dsi: Remove repeated calculation of slice_per_intf

2022-10-09 Thread Dmitry Baryshkov
On 09/10/2022 21:48, Marijn Suijten wrote: slice_per_intf is already computed for intf_width, which holds the same value as hdisplay. Fixes: 08802f515c3c ("drm/msm/dsi: Add support for DSC configuration") Signed-off-by: Marijn Suijten Reviewed-by: Bjorn Andersson Reviewed-by: Konrad Dybcio Re

[PATCH v3 08/10] drm/msm/dsi: Account for DSC's bits_per_pixel having 4 fractional bits

2022-10-09 Thread Marijn Suijten
drm_dsc_config's bits_per_pixel field holds a fractional value with 4 bits, which all panel drivers should adhere to for drm_dsc_pps_payload_pack() to generate a valid payload. All code in the DSI driver here seems to assume that this field doesn't contain any fractional bits, hence resulting in t

[PATCH v3 10/10] drm/msm/dsi: Prevent signed BPG offsets from bleeding into adjacent bits

2022-10-09 Thread Marijn Suijten
The bpg_offset array contains negative BPG offsets which fill the full 8 bits of a char thanks to two's complement: this however results in those bits bleeding into the next field when the value is packed into DSC PPS by the drm_dsc_helper function, which only expects range_bpg_offset to contain 6-

[PATCH v3 09/10] drm/msm/dpu1: Account for DSC's bits_per_pixel having 4 fractional bits

2022-10-09 Thread Marijn Suijten
According to the comment this DPU register contains the bits per pixel as a 6.4 fractional value, conveniently matching the contents of bits_per_pixel in struct drm_dsc_config which also uses 4 fractional bits. However, the downstream source this implementation was copy-pasted from has its bpp fie

Re: [PATCH v3 03/10] drm/msm/dsi: Use DIV_ROUND_UP instead of conditional increment on modulo

2022-10-09 Thread Dmitry Baryshkov
On 09/10/2022 21:48, Marijn Suijten wrote: This exact same math is used to compute bytes_in_slice above in dsi_update_dsc_timing(), also used to fill slice_chunk_size. Fixes: b9080324d6ca ("drm/msm/dsi: add support for dsc data") Signed-off-by: Marijn Suijten Reviewed-by: Abhinav Kumar --- d

Re: [PATCH v3 04/10] drm/msm/dsi: Reuse earlier computed dsc->slice_chunk_size

2022-10-09 Thread Dmitry Baryshkov
On 09/10/2022 21:48, Marijn Suijten wrote: dsi_populate_dsc_params() is called prior to dsi_update_dsc_timing() and already computes a value for slice_chunk_size, whose value doesn't need to be recomputed and re-set here. Fixes: 08802f515c3c ("drm/msm/dsi: Add support for DSC configuration") Sig

Re: [PATCH v3 05/10] drm/msm/dsi: Appropriately set dsc->mux_word_size based on bpc

2022-10-09 Thread Dmitry Baryshkov
On 09/10/2022 21:48, Marijn Suijten wrote: This field is currently unread but will come into effect when duplicated code below is migrated to call drm_dsc_compute_rc_parameters(), which uses the bpc-dependent value of the local variable mux_words_size in much the same way. The hardcoded constant

Re: [PATCH v3 06/10] drm/msm/dsi: Migrate to drm_dsc_compute_rc_parameters()

2022-10-09 Thread Dmitry Baryshkov
On 09/10/2022 21:48, Marijn Suijten wrote: As per the FIXME this code is entirely duplicate with what is already provided inside drm_dsc_compute_rc_parameters(), and it is yet unknown why this comment was put in place instead of resolved from the get-go. Not only does it save on duplication, it w

Re: [PATCH v3 07/10] drm/msm/dsi: Disallow 8 BPC DSC configuration for alternative BPC values

2022-10-09 Thread Dmitry Baryshkov
On 09/10/2022 21:51, Marijn Suijten wrote: According to the `/* bpc 8 */` comment below only values for a bits_per_component of 8 are currently hardcoded in place. This is further confirmed by downstream sources [1] containing different constants for other BPC values (and different initial_offse

Re: [PATCH v3 06/10] drm/msm/dsi: Migrate to drm_dsc_compute_rc_parameters()

2022-10-09 Thread Marijn Suijten
On 2022-10-09 20:50:54, Marijn Suijten wrote: Apologies. After attempting to recover from an unexpected interruption _right as I was sending this series_, this patch got sent twice as it only later appeared to also have made its way through in the first round [1], together with the cover letter a

Re: [PATCH v3 10/10] drm/msm/dsi: Prevent signed BPG offsets from bleeding into adjacent bits

2022-10-09 Thread Dmitry Baryshkov
On 09/10/2022 21:53, Marijn Suijten wrote: The bpg_offset array contains negative BPG offsets which fill the full 8 bits of a char thanks to two's complement: this however results in those bits bleeding into the next field when the value is packed into DSC PPS by the drm_dsc_helper function, whic

Re: [PATCH v3 08/10] drm/msm/dsi: Account for DSC's bits_per_pixel having 4 fractional bits

2022-10-09 Thread Dmitry Baryshkov
On 09/10/2022 21:53, Marijn Suijten wrote: drm_dsc_config's bits_per_pixel field holds a fractional value with 4 bits, which all panel drivers should adhere to for drm_dsc_pps_payload_pack() to generate a valid payload. All code in the DSI driver here seems to assume that this field doesn't cont

[Bug 213145] AMDGPU resets, timesout and crashes after "*ERROR* Waiting for fences timed out!"

2022-10-09 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=213145 James Le Cuirot (ch...@gentoo.org) changed: What|Removed |Added CC||ch...@gentoo.org ---

[PATCH AUTOSEL 6.0 01/44] drm/nouveau/nouveau_bo: fix potential memory leak in nouveau_bo_alloc()

2022-10-09 Thread Sasha Levin
From: Jianglei Nie [ Upstream commit 6dc548745d5b5102e3c53dc5097296ac270b6c69 ] nouveau_bo_alloc() allocates a memory chunk for "nvbo" with kzalloc(). When some error occurs, "nvbo" should be released. But when WARN_ON(pi < 0)) equals true, the function return ERR_PTR without releasing the "nvbo

[PATCH AUTOSEL 6.0 02/44] drm: Use size_t type for len variable in drm_copy_field()

2022-10-09 Thread Sasha Levin
From: Javier Martinez Canillas [ Upstream commit 94dc3471d1b2b58b3728558d0e3f264e9ce6ff59 ] The strlen() function returns a size_t which is an unsigned int on 32-bit arches and an unsigned long on 64-bit arches. But in the drm_copy_field() function, the strlen() return value is assigned to an 'i

[PATCH AUTOSEL 6.0 03/44] drm: Prevent drm_copy_field() to attempt copying a NULL pointer

2022-10-09 Thread Sasha Levin
From: Javier Martinez Canillas [ Upstream commit f6ee30407e883042482ad4ad30da5eaba47872ee ] There are some struct drm_driver fields that are required by drivers since drm_copy_field() attempts to copy them to user-space via DRM_IOCTL_VERSION. But it can be possible that a driver has a bug and d

[PATCH AUTOSEL 6.0 05/44] gpu: lontium-lt9611: Fix NULL pointer dereference in lt9611_connector_init()

2022-10-09 Thread Sasha Levin
From: Zeng Jingxiang [ Upstream commit ef8886f321c5dab8124b9153d25afa2a71d05323 ] A NULL check for bridge->encoder shows that it may be NULL, but it already been dereferenced on all paths leading to the check. 812 if (!bridge->encoder) { Dereference the pointer bridge->encoder. 810 drm_

[PATCH AUTOSEL 6.0 09/44] udmabuf: Set ubuf->sg = NULL if the creation of sg table fails

2022-10-09 Thread Sasha Levin
From: Vivek Kasireddy [ Upstream commit d9c04a1b7a15b5e74b2977461d9511e497f05d8f ] When userspace tries to map the dmabuf and if for some reason (e.g. OOM) the creation of the sg table fails, ubuf->sg needs to be set to NULL. Otherwise, when the userspace subsequently closes the dmabuf fd, we'd

[PATCH AUTOSEL 6.0 06/44] drm/amd/display: fix overflow on MIN_I64 definition

2022-10-09 Thread Sasha Levin
From: David Gow [ Upstream commit 6ae0632d17759852c07e2d1e0a31c728eb6ba246 ] The definition of MIN_I64 in bw_fixed.c can cause gcc to whinge about integer overflow, because it is treated as a positive value, which is then negated. The temporary positive value is not necessarily representable. T

[PATCH AUTOSEL 6.0 04/44] drm/komeda: Fix handling of atomic commits in the atomic_commit_tail hook

2022-10-09 Thread Sasha Levin
From: Liviu Dudau [ Upstream commit eaa225b6b52233d45457fd33730e1528c604d92d ] Komeda driver relies on the generic DRM atomic helper functions to handle commits. It only implements an atomic_commit_tail hook for the mode_config_helper_funcs and even that one is pretty close to the generic implem

[PATCH AUTOSEL 6.0 11/44] drm/amd: fix potential memory leak

2022-10-09 Thread Sasha Levin
From: Bernard Zhao [ Upstream commit 6160216fd2c97107e8a9ab39863b056d677fcd85 ] This patch fix potential memory leak (clk_src) when function run into last return NULL. s/free/kfree/ - Alex Signed-off-by: Bernard Zhao Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/dr

[PATCH AUTOSEL 6.0 12/44] drm: bridge: dw_hdmi: only trigger hotplug event on link change

2022-10-09 Thread Sasha Levin
From: Lucas Stach [ Upstream commit da09daf881082266e4075657fac53c7966de8e4d ] There are two events that signal a real change of the link state: HPD going high means the sink is newly connected or wants the source to re-read the EDID, RX sense going low is a indication that the link has been dis

[PATCH AUTOSEL 6.0 13/44] drm/amd/display: Fix variable dereferenced before check

2022-10-09 Thread Sasha Levin
From: sunliming [ Upstream commit 45a92f45f4578ff89da7dc5ef50bab4ef870f3b7 ] Fixes the following smatch warning: drivers/gpu/drm/amd/amdgpu/../display/dc/dc_dmub_srv.c:311 dc_dmub_srv_p_state_delegate() warn: variable dereferenced before check 'dc' (see line 309) Reported-by: kernel test robo

[PATCH AUTOSEL 6.0 14/44] drm/amdgpu: Skip the program of MMMC_VM_AGP_* in SRIOV on MMHUB v3_0_0

2022-10-09 Thread Sasha Levin
From: Yifan Zha [ Upstream commit c1026c6f319724dc88fc08d9d9d35bcbdf492b42 ] [Why] VF should not program these registers, the value were defined in the host. [How] Skip writing them in SRIOV environment and program them on host side. Acked-by: Christian König Signed-off-by: Yifan Zha Signed-

[PATCH AUTOSEL 6.0 15/44] drm/admgpu: Skip CG/PG on SOC21 under SRIOV VF

2022-10-09 Thread Sasha Levin
From: Yifan Zha [ Upstream commit 828418259254863e0af5805bd712284e2bd88e3b ] [Why] There is no CG(Clock Gating)/PG(Power Gating) requirement on SRIOV VF. For multi VF, VF should not enable any CG/PG features. For one VF, PF will program CG/PG related registers. [How] Do not set any cg/pg flag b

[PATCH AUTOSEL 6.0 16/44] drm: hide unregistered connectors from GETCONNECTOR IOCTL

2022-10-09 Thread Sasha Levin
From: Simon Ser [ Upstream commit 981f09295687f856d5345e19c7084aca481c1395 ] When registering a connector, the kernel sends a hotplug uevent in drm_connector_register(). When unregistering a connector, drivers are expected to send a uevent as well. However, user-space has no way to figure out th

[PATCH AUTOSEL 6.0 20/44] drm: panel-orientation-quirks: Add quirk for Anbernic Win600

2022-10-09 Thread Sasha Levin
From: Maya Matuszczyk [ Upstream commit 770e19076065e079a32f33eb11be2057c87f1cde ] This device is another x86 gaming handheld, and as (hopefully) there is only one set of DMI IDs it's using DMI_EXACT_MATCH Signed-off-by: Maya Matuszczyk Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede

[PATCH AUTOSEL 6.0 18/44] drm/vc4: vec: Fix timings for VEC modes

2022-10-09 Thread Sasha Levin
From: Mateusz Kwiatkowski [ Upstream commit 30d7565be96b3946c18a1ce3fd538f7946839092 ] This commit fixes vertical timings of the VEC (composite output) modes to accurately represent the 525-line ("NTSC") and 625-line ("PAL") ITU-R standards. Previous timings were actually defined as 502 and 601

[PATCH AUTOSEL 6.0 21/44] drm: panel-orientation-quirks: Add quirk for Aya Neo Air

2022-10-09 Thread Sasha Levin
From: Maya Matuszczyk [ Upstream commit e10ea7b9b90219da305a16b3c1252169715a807b ] Yet another x86 gaming handheld. This one has many SKUs with quite a few of DMI strings, so let's just use a catchall, just as with Aya Neo Next. Signed-off-by: Maya Matuszczyk Signed-off-by: Hans de Goede Lin

[PATCH AUTOSEL 6.0 29/44] drm/amdgpu: SDMA update use unlocked iterator

2022-10-09 Thread Sasha Levin
From: Philip Yang [ Upstream commit 3913f0179ba366f7d7d160c506ce00de1602bbc4 ] SDMA update page table may be called from unlocked context, this generate below warning. Use unlocked iterator to handle this case. WARNING: CPU: 0 PID: 1475 at drivers/dma-buf/dma-resv.c:483 dma_resv_iter_next Call

[PATCH AUTOSEL 6.0 30/44] drm/amd/display: Fix urgent latency override for DCN32/DCN321

2022-10-09 Thread Sasha Levin
From: George Shen [ Upstream commit e7f2f4cd67443ce308480ca461806fcc3456e0ba ] [Why] The urgent latency override is useful when debugging issues relating to underflow. Current overridden variable is not correct and has no effect on DCN3.2 and DCN3.21 DML calculations. [How] For DCN3.2 and DCN3

[PATCH AUTOSEL 6.0 31/44] drm/amd/display: correct hostvm flag

2022-10-09 Thread Sasha Levin
From: Sherry Wang [ Upstream commit 796d6a37ff5ffaf9f2dc0f3f4bf9f4a1034c00de ] [Why] Hostvm should be enabled/disabled accordding to the status of riommu_active, but hostvm always be disabled on DCN31 which causes underflow [How] Set correct hostvm flag on DCN31 Reviewed-by: Charlene Liu Acke

[PATCH AUTOSEL 6.0 32/44] drm/amdgpu: fix initial connector audio value

2022-10-09 Thread Sasha Levin
From: hongao [ Upstream commit 4bb71fce58f30df3f251118291d6b0187ce531e6 ] This got lost somewhere along the way, This fixes audio not working until set_property was called. Signed-off-by: hongao Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/amdgpu_con

[PATCH AUTOSEL 6.0 35/44] drm/meson: reorder driver deinit sequence to fix use-after-free bug

2022-10-09 Thread Sasha Levin
From: Adrián Larumbe [ Upstream commit 31c519981eb141c7ec39bfd5be25d35f02edb868 ] Unloading the driver triggers the following KASAN warning: [ +0.006275] = [ +0.29] BUG: KASAN: use-after-free in __list_del_entry_valid+0xe0/0x1a0

[PATCH AUTOSEL 6.0 37/44] drm/meson: remove drm bridges at aggregate driver unbind time

2022-10-09 Thread Sasha Levin
From: Adrián Larumbe [ Upstream commit 09847723c12fc2753749cec3939a02ee92dac468 ] drm bridges added by meson_encoder_hdmi_init and meson_encoder_cvbs_init were not manually removed at module unload time, which caused dangling references to freed memory to remain linked in the global bridge_list.

[PATCH AUTOSEL 6.0 36/44] drm/meson: explicitly remove aggregate driver at module unload time

2022-10-09 Thread Sasha Levin
From: Adrián Larumbe [ Upstream commit 8616f2a0589a80e08434212324250eb22f6a66ce ] Because component_master_del wasn't being called when unloading the meson_drm module, the aggregate device would linger forever in the global aggregate_devices list. That means when unloading and reloading the meso

[PATCH AUTOSEL 6.0 38/44] drm/exynos: Fix return type for mixer_mode_valid and hdmi_mode_valid

2022-10-09 Thread Sasha Levin
From: Nathan Huckleberry [ Upstream commit 1261255531088208daeca818e2b486030b5339e5 ] The field mode_valid in exynos_drm_crtc_ops is expected to be of type enum drm_mode_status (*mode_valid)(struct exynos_drm_crtc *crtc, const struct drm_display_mode *mode); L

[PATCH AUTOSEL 6.0 40/44] drm/dp: Don't rewrite link config when setting phy test pattern

2022-10-09 Thread Sasha Levin
From: Khaled Almahallawy [ Upstream commit 7b4d8db657192066bc6f1f6635d348413dac1e18 ] The sequence for Source DP PHY CTS automation is [2][1]: 1- Emulate successful Link Training(LT) 2- Short HPD and change link rates and number of lanes by LT. (This is same flow for Link Layer CTS) 3- Short HPD

[PATCH AUTOSEL 6.0 41/44] drm/amd/display: Remove interface for periodic interrupt 1

2022-10-09 Thread Sasha Levin
From: Aric Cyr [ Upstream commit 97d8d6f075bd8f988589be02b91f6fa644d0b0b8 ] [why] Only a single VLINE interrupt is available so interface should not expose the second one which is used by DMU firmware. [how] Remove references to periodic_interrupt1 and VLINE1 from DC interfaces. Reviewed-by: J

[PATCH AUTOSEL 6.0 42/44] drm/amd/display: polling vid stream status in hpo dp blank

2022-10-09 Thread Sasha Levin
From: Wenjing Liu [ Upstream commit e32df0c7ecead95d70ca89f39b1b2b02a59ff691 ] [why] vid stream control is double bufferred, if we don't wait for video stream enable set to 0, we may get temporary image corruption showing on the stream when setting PIXEL_TO_SYMBOL_FIFO_ENABLE to 0. Reviewed-by:

[PATCH AUTOSEL 6.0 44/44] drm/amdkfd: Fix UBSAN shift-out-of-bounds warning

2022-10-09 Thread Sasha Levin
From: Felix Kuehling [ Upstream commit b292cafe2dd02d96a07147e4b160927e8399d5cc ] This was fixed in initialize_cpsch before, but not in initialize_nocpsch. Factor sdma bitmap initialization into a helper function to apply the correct implementation in both cases without duplicating it. v2: Adde

[PATCH AUTOSEL 6.0 43/44] drm/amd/display: fix array-bounds error in dc_stream_remove_writeback()

2022-10-09 Thread Sasha Levin
From: Hamza Mahfooz [ Upstream commit 5d8c3e836fc224dfe633e41f7f2856753b39a905 ] Address the following error: drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c: In function ‘dc_stream_remove_writeback’: drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c:527:55: error: array subs

[PATCH AUTOSEL 5.19 02/36] drm: Use size_t type for len variable in drm_copy_field()

2022-10-09 Thread Sasha Levin
From: Javier Martinez Canillas [ Upstream commit 94dc3471d1b2b58b3728558d0e3f264e9ce6ff59 ] The strlen() function returns a size_t which is an unsigned int on 32-bit arches and an unsigned long on 64-bit arches. But in the drm_copy_field() function, the strlen() return value is assigned to an 'i

[PATCH AUTOSEL 5.19 01/36] drm/nouveau/nouveau_bo: fix potential memory leak in nouveau_bo_alloc()

2022-10-09 Thread Sasha Levin
From: Jianglei Nie [ Upstream commit 6dc548745d5b5102e3c53dc5097296ac270b6c69 ] nouveau_bo_alloc() allocates a memory chunk for "nvbo" with kzalloc(). When some error occurs, "nvbo" should be released. But when WARN_ON(pi < 0)) equals true, the function return ERR_PTR without releasing the "nvbo

[PATCH AUTOSEL 5.19 04/36] drm/komeda: Fix handling of atomic commits in the atomic_commit_tail hook

2022-10-09 Thread Sasha Levin
From: Liviu Dudau [ Upstream commit eaa225b6b52233d45457fd33730e1528c604d92d ] Komeda driver relies on the generic DRM atomic helper functions to handle commits. It only implements an atomic_commit_tail hook for the mode_config_helper_funcs and even that one is pretty close to the generic implem

[PATCH AUTOSEL 5.19 05/36] gpu: lontium-lt9611: Fix NULL pointer dereference in lt9611_connector_init()

2022-10-09 Thread Sasha Levin
From: Zeng Jingxiang [ Upstream commit ef8886f321c5dab8124b9153d25afa2a71d05323 ] A NULL check for bridge->encoder shows that it may be NULL, but it already been dereferenced on all paths leading to the check. 812 if (!bridge->encoder) { Dereference the pointer bridge->encoder. 810 drm_

[PATCH AUTOSEL 5.19 03/36] drm: Prevent drm_copy_field() to attempt copying a NULL pointer

2022-10-09 Thread Sasha Levin
From: Javier Martinez Canillas [ Upstream commit f6ee30407e883042482ad4ad30da5eaba47872ee ] There are some struct drm_driver fields that are required by drivers since drm_copy_field() attempts to copy them to user-space via DRM_IOCTL_VERSION. But it can be possible that a driver has a bug and d

[PATCH AUTOSEL 5.19 10/36] drm: bridge: dw_hdmi: only trigger hotplug event on link change

2022-10-09 Thread Sasha Levin
From: Lucas Stach [ Upstream commit da09daf881082266e4075657fac53c7966de8e4d ] There are two events that signal a real change of the link state: HPD going high means the sink is newly connected or wants the source to re-read the EDID, RX sense going low is a indication that the link has been dis

[PATCH AUTOSEL 5.19 06/36] drm/amd/display: fix overflow on MIN_I64 definition

2022-10-09 Thread Sasha Levin
From: David Gow [ Upstream commit 6ae0632d17759852c07e2d1e0a31c728eb6ba246 ] The definition of MIN_I64 in bw_fixed.c can cause gcc to whinge about integer overflow, because it is treated as a positive value, which is then negated. The temporary positive value is not necessarily representable. T

[PATCH AUTOSEL 5.19 11/36] drm/amdgpu: Skip the program of MMMC_VM_AGP_* in SRIOV on MMHUB v3_0_0

2022-10-09 Thread Sasha Levin
From: Yifan Zha [ Upstream commit c1026c6f319724dc88fc08d9d9d35bcbdf492b42 ] [Why] VF should not program these registers, the value were defined in the host. [How] Skip writing them in SRIOV environment and program them on host side. Acked-by: Christian König Signed-off-by: Yifan Zha Signed-

[PATCH AUTOSEL 5.19 08/36] udmabuf: Set ubuf->sg = NULL if the creation of sg table fails

2022-10-09 Thread Sasha Levin
From: Vivek Kasireddy [ Upstream commit d9c04a1b7a15b5e74b2977461d9511e497f05d8f ] When userspace tries to map the dmabuf and if for some reason (e.g. OOM) the creation of the sg table fails, ubuf->sg needs to be set to NULL. Otherwise, when the userspace subsequently closes the dmabuf fd, we'd

[PATCH AUTOSEL 5.19 17/36] drm: panel-orientation-quirks: Add quirk for Anbernic Win600

2022-10-09 Thread Sasha Levin
From: Maya Matuszczyk [ Upstream commit 770e19076065e079a32f33eb11be2057c87f1cde ] This device is another x86 gaming handheld, and as (hopefully) there is only one set of DMI IDs it's using DMI_EXACT_MATCH Signed-off-by: Maya Matuszczyk Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede

[PATCH AUTOSEL 5.19 13/36] drm: hide unregistered connectors from GETCONNECTOR IOCTL

2022-10-09 Thread Sasha Levin
From: Simon Ser [ Upstream commit 981f09295687f856d5345e19c7084aca481c1395 ] When registering a connector, the kernel sends a hotplug uevent in drm_connector_register(). When unregistering a connector, drivers are expected to send a uevent as well. However, user-space has no way to figure out th

[PATCH AUTOSEL 5.19 12/36] drm/admgpu: Skip CG/PG on SOC21 under SRIOV VF

2022-10-09 Thread Sasha Levin
From: Yifan Zha [ Upstream commit 828418259254863e0af5805bd712284e2bd88e3b ] [Why] There is no CG(Clock Gating)/PG(Power Gating) requirement on SRIOV VF. For multi VF, VF should not enable any CG/PG features. For one VF, PF will program CG/PG related registers. [How] Do not set any cg/pg flag b

[PATCH AUTOSEL 5.19 15/36] drm/vc4: vec: Fix timings for VEC modes

2022-10-09 Thread Sasha Levin
From: Mateusz Kwiatkowski [ Upstream commit 30d7565be96b3946c18a1ce3fd538f7946839092 ] This commit fixes vertical timings of the VEC (composite output) modes to accurately represent the 525-line ("NTSC") and 625-line ("PAL") ITU-R standards. Previous timings were actually defined as 502 and 601

[PATCH AUTOSEL 5.19 18/36] drm: panel-orientation-quirks: Add quirk for Aya Neo Air

2022-10-09 Thread Sasha Levin
From: Maya Matuszczyk [ Upstream commit e10ea7b9b90219da305a16b3c1252169715a807b ] Yet another x86 gaming handheld. This one has many SKUs with quite a few of DMI strings, so let's just use a catchall, just as with Aya Neo Next. Signed-off-by: Maya Matuszczyk Signed-off-by: Hans de Goede Lin

[PATCH AUTOSEL 5.19 25/36] drm/amdgpu: SDMA update use unlocked iterator

2022-10-09 Thread Sasha Levin
From: Philip Yang [ Upstream commit 3913f0179ba366f7d7d160c506ce00de1602bbc4 ] SDMA update page table may be called from unlocked context, this generate below warning. Use unlocked iterator to handle this case. WARNING: CPU: 0 PID: 1475 at drivers/dma-buf/dma-resv.c:483 dma_resv_iter_next Call

[PATCH AUTOSEL 5.19 26/36] drm/amd/display: correct hostvm flag

2022-10-09 Thread Sasha Levin
From: Sherry Wang [ Upstream commit 796d6a37ff5ffaf9f2dc0f3f4bf9f4a1034c00de ] [Why] Hostvm should be enabled/disabled accordding to the status of riommu_active, but hostvm always be disabled on DCN31 which causes underflow [How] Set correct hostvm flag on DCN31 Reviewed-by: Charlene Liu Acke

[PATCH AUTOSEL 5.19 28/36] drm/meson: reorder driver deinit sequence to fix use-after-free bug

2022-10-09 Thread Sasha Levin
From: Adrián Larumbe [ Upstream commit 31c519981eb141c7ec39bfd5be25d35f02edb868 ] Unloading the driver triggers the following KASAN warning: [ +0.006275] = [ +0.29] BUG: KASAN: use-after-free in __list_del_entry_valid+0xe0/0x1a0

[PATCH AUTOSEL 5.19 31/36] drm/exynos: Fix return type for mixer_mode_valid and hdmi_mode_valid

2022-10-09 Thread Sasha Levin
From: Nathan Huckleberry [ Upstream commit 1261255531088208daeca818e2b486030b5339e5 ] The field mode_valid in exynos_drm_crtc_ops is expected to be of type enum drm_mode_status (*mode_valid)(struct exynos_drm_crtc *crtc, const struct drm_display_mode *mode); L

[PATCH AUTOSEL 5.19 27/36] drm/amdgpu: fix initial connector audio value

2022-10-09 Thread Sasha Levin
From: hongao [ Upstream commit 4bb71fce58f30df3f251118291d6b0187ce531e6 ] This got lost somewhere along the way, This fixes audio not working until set_property was called. Signed-off-by: hongao Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/amdgpu_con

[PATCH AUTOSEL 5.19 29/36] drm/meson: explicitly remove aggregate driver at module unload time

2022-10-09 Thread Sasha Levin
From: Adrián Larumbe [ Upstream commit 8616f2a0589a80e08434212324250eb22f6a66ce ] Because component_master_del wasn't being called when unloading the meson_drm module, the aggregate device would linger forever in the global aggregate_devices list. That means when unloading and reloading the meso

[PATCH AUTOSEL 5.19 30/36] drm/meson: remove drm bridges at aggregate driver unbind time

2022-10-09 Thread Sasha Levin
From: Adrián Larumbe [ Upstream commit 09847723c12fc2753749cec3939a02ee92dac468 ] drm bridges added by meson_encoder_hdmi_init and meson_encoder_cvbs_init were not manually removed at module unload time, which caused dangling references to freed memory to remain linked in the global bridge_list.

[PATCH AUTOSEL 5.19 32/36] drm/dp: Don't rewrite link config when setting phy test pattern

2022-10-09 Thread Sasha Levin
From: Khaled Almahallawy [ Upstream commit 7b4d8db657192066bc6f1f6635d348413dac1e18 ] The sequence for Source DP PHY CTS automation is [2][1]: 1- Emulate successful Link Training(LT) 2- Short HPD and change link rates and number of lanes by LT. (This is same flow for Link Layer CTS) 3- Short HPD

[PATCH AUTOSEL 5.19 33/36] drm/amd/display: Remove interface for periodic interrupt 1

2022-10-09 Thread Sasha Levin
From: Aric Cyr [ Upstream commit 97d8d6f075bd8f988589be02b91f6fa644d0b0b8 ] [why] Only a single VLINE interrupt is available so interface should not expose the second one which is used by DMU firmware. [how] Remove references to periodic_interrupt1 and VLINE1 from DC interfaces. Reviewed-by: J

[PATCH AUTOSEL 5.19 34/36] drm/amd/display: polling vid stream status in hpo dp blank

2022-10-09 Thread Sasha Levin
From: Wenjing Liu [ Upstream commit e32df0c7ecead95d70ca89f39b1b2b02a59ff691 ] [why] vid stream control is double bufferred, if we don't wait for video stream enable set to 0, we may get temporary image corruption showing on the stream when setting PIXEL_TO_SYMBOL_FIFO_ENABLE to 0. Reviewed-by:

[PATCH AUTOSEL 5.19 36/36] drm/amdkfd: Fix UBSAN shift-out-of-bounds warning

2022-10-09 Thread Sasha Levin
From: Felix Kuehling [ Upstream commit b292cafe2dd02d96a07147e4b160927e8399d5cc ] This was fixed in initialize_cpsch before, but not in initialize_nocpsch. Factor sdma bitmap initialization into a helper function to apply the correct implementation in both cases without duplicating it. v2: Adde

[PATCH AUTOSEL 5.19 35/36] drm/amd/display: fix array-bounds error in dc_stream_remove_writeback()

2022-10-09 Thread Sasha Levin
From: Hamza Mahfooz [ Upstream commit 5d8c3e836fc224dfe633e41f7f2856753b39a905 ] Address the following error: drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c: In function ‘dc_stream_remove_writeback’: drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c:527:55: error: array subs

[PATCH AUTOSEL 5.15 03/25] drm: Prevent drm_copy_field() to attempt copying a NULL pointer

2022-10-09 Thread Sasha Levin
From: Javier Martinez Canillas [ Upstream commit f6ee30407e883042482ad4ad30da5eaba47872ee ] There are some struct drm_driver fields that are required by drivers since drm_copy_field() attempts to copy them to user-space via DRM_IOCTL_VERSION. But it can be possible that a driver has a bug and d

[PATCH AUTOSEL 5.15 01/25] drm/nouveau/nouveau_bo: fix potential memory leak in nouveau_bo_alloc()

2022-10-09 Thread Sasha Levin
From: Jianglei Nie [ Upstream commit 6dc548745d5b5102e3c53dc5097296ac270b6c69 ] nouveau_bo_alloc() allocates a memory chunk for "nvbo" with kzalloc(). When some error occurs, "nvbo" should be released. But when WARN_ON(pi < 0)) equals true, the function return ERR_PTR without releasing the "nvbo

[PATCH AUTOSEL 5.15 02/25] drm: Use size_t type for len variable in drm_copy_field()

2022-10-09 Thread Sasha Levin
From: Javier Martinez Canillas [ Upstream commit 94dc3471d1b2b58b3728558d0e3f264e9ce6ff59 ] The strlen() function returns a size_t which is an unsigned int on 32-bit arches and an unsigned long on 64-bit arches. But in the drm_copy_field() function, the strlen() return value is assigned to an 'i

[PATCH AUTOSEL 5.15 04/25] drm/komeda: Fix handling of atomic commits in the atomic_commit_tail hook

2022-10-09 Thread Sasha Levin
From: Liviu Dudau [ Upstream commit eaa225b6b52233d45457fd33730e1528c604d92d ] Komeda driver relies on the generic DRM atomic helper functions to handle commits. It only implements an atomic_commit_tail hook for the mode_config_helper_funcs and even that one is pretty close to the generic implem

[PATCH AUTOSEL 5.15 05/25] gpu: lontium-lt9611: Fix NULL pointer dereference in lt9611_connector_init()

2022-10-09 Thread Sasha Levin
From: Zeng Jingxiang [ Upstream commit ef8886f321c5dab8124b9153d25afa2a71d05323 ] A NULL check for bridge->encoder shows that it may be NULL, but it already been dereferenced on all paths leading to the check. 812 if (!bridge->encoder) { Dereference the pointer bridge->encoder. 810 drm_

[PATCH AUTOSEL 5.15 06/25] drm/amd/display: fix overflow on MIN_I64 definition

2022-10-09 Thread Sasha Levin
From: David Gow [ Upstream commit 6ae0632d17759852c07e2d1e0a31c728eb6ba246 ] The definition of MIN_I64 in bw_fixed.c can cause gcc to whinge about integer overflow, because it is treated as a positive value, which is then negated. The temporary positive value is not necessarily representable. T

[PATCH AUTOSEL 5.15 09/25] drm: bridge: dw_hdmi: only trigger hotplug event on link change

2022-10-09 Thread Sasha Levin
From: Lucas Stach [ Upstream commit da09daf881082266e4075657fac53c7966de8e4d ] There are two events that signal a real change of the link state: HPD going high means the sink is newly connected or wants the source to re-read the EDID, RX sense going low is a indication that the link has been dis

[PATCH AUTOSEL 5.15 08/25] udmabuf: Set ubuf->sg = NULL if the creation of sg table fails

2022-10-09 Thread Sasha Levin
From: Vivek Kasireddy [ Upstream commit d9c04a1b7a15b5e74b2977461d9511e497f05d8f ] When userspace tries to map the dmabuf and if for some reason (e.g. OOM) the creation of the sg table fails, ubuf->sg needs to be set to NULL. Otherwise, when the userspace subsequently closes the dmabuf fd, we'd

[PATCH AUTOSEL 5.15 14/25] drm: panel-orientation-quirks: Add quirk for Anbernic Win600

2022-10-09 Thread Sasha Levin
From: Maya Matuszczyk [ Upstream commit 770e19076065e079a32f33eb11be2057c87f1cde ] This device is another x86 gaming handheld, and as (hopefully) there is only one set of DMI IDs it's using DMI_EXACT_MATCH Signed-off-by: Maya Matuszczyk Reviewed-by: Hans de Goede Signed-off-by: Hans de Goede

[PATCH AUTOSEL 5.15 10/25] drm: hide unregistered connectors from GETCONNECTOR IOCTL

2022-10-09 Thread Sasha Levin
From: Simon Ser [ Upstream commit 981f09295687f856d5345e19c7084aca481c1395 ] When registering a connector, the kernel sends a hotplug uevent in drm_connector_register(). When unregistering a connector, drivers are expected to send a uevent as well. However, user-space has no way to figure out th

[PATCH AUTOSEL 5.15 19/25] drm/meson: reorder driver deinit sequence to fix use-after-free bug

2022-10-09 Thread Sasha Levin
From: Adrián Larumbe [ Upstream commit 31c519981eb141c7ec39bfd5be25d35f02edb868 ] Unloading the driver triggers the following KASAN warning: [ +0.006275] = [ +0.29] BUG: KASAN: use-after-free in __list_del_entry_valid+0xe0/0x1a0

[PATCH AUTOSEL 5.15 20/25] drm/meson: explicitly remove aggregate driver at module unload time

2022-10-09 Thread Sasha Levin
From: Adrián Larumbe [ Upstream commit 8616f2a0589a80e08434212324250eb22f6a66ce ] Because component_master_del wasn't being called when unloading the meson_drm module, the aggregate device would linger forever in the global aggregate_devices list. That means when unloading and reloading the meso

[PATCH AUTOSEL 5.15 12/25] drm/vc4: vec: Fix timings for VEC modes

2022-10-09 Thread Sasha Levin
From: Mateusz Kwiatkowski [ Upstream commit 30d7565be96b3946c18a1ce3fd538f7946839092 ] This commit fixes vertical timings of the VEC (composite output) modes to accurately represent the 525-line ("NTSC") and 625-line ("PAL") ITU-R standards. Previous timings were actually defined as 502 and 601

  1   2   >