Re: [PATCH] drm: Prevent modeset helpers to access an uninitialized drm_mode_config

2022-07-25 Thread Thomas Zimmermann
Hi Javier Am 24.07.22 um 20:41 schrieb Javier Martinez Canillas: Hello Thomas, Thanks for your feedback. On 7/24/22 20:24, Thomas Zimmermann wrote: Hi Javier Am 24.07.22 um 14:37 schrieb Javier Martinez Canillas: DRM drivers initialize the mode configuration with drmm_mode_config_init() and

Re: [PATCH v6 08/13] usb: typec: tcpci_mt6370: Add MediaTek MT6370 tcpci driver

2022-07-25 Thread ChiaEn Wu
On Mon, Jul 25, 2022 at 3:06 PM Chunfeng Yun wrote: > > On Fri, 2022-07-22 at 18:24 +0800, ChiaEn Wu wrote: > > From: ChiYuan Huang > > > > The MediaTek MT6370 is a highly-integrated smart power management IC, > > which includes a single cell Li-Ion/Li-Polymer switching battery > > charger, a USB

[PATCH 4/5] drm/vkms: Add ConfigFS scaffolding to VKMS

2022-07-25 Thread Jim Shargo
This change adds the basic scaffolding for ConfigFS, including setting up the default directories. It does not allow for the registration of configfs-backed devices, which is complex and provided in a follow-up commit. This CL includes docs about using ConfigFS with VKMS, but I'll summarize in bri

[PATCH 3/5] drm/vkms: Support multiple objects (crtcs, etc.) per card

2022-07-25 Thread Jim Shargo
This change supports multiple CRTCs, encoders, connectors instead of one of each per card. Since ConfigFS-based devices will support multiple crtcs, it's useful to move all of the writeback/composition data from being a per-output thing to being a per-CRTC thing. Since there's still only ever one

[PATCH] drm/msm/dpu: Fix comment typo

2022-07-25 Thread Jason Wang
The double `be' is duplicated in the comment, remove one. Signed-off-by: Jason Wang --- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalo

[PATCH 0/5] drm/vkms: Add ConfigFS Support

2022-07-25 Thread Jim Shargo
Intro = This patchset adds basic ConfigFS support to VKMS, allowing users to build new DRM devices with user-defined DRM objects and object relationships by creating, writing, and symlinking files. Usage = Modprobe VKMS and mount ConfigFS: $ mkdir -p /config/; mount -t configfs $ mo

KASAN: use-after-free Read in drm_gem_object_release

2022-07-25 Thread Dipanjan Das
Hi, We would like to report the following bug which has been found by our modified version of syzkaller. == description: KASAN: use-after-free Read in drm_gem_object_release affected file: drivers/gpu/drm/drm_gem.c kernel version: 5.4.206 kernel

[PATCH 5/5] drm/vkms: Support registering configfs devices

2022-07-25 Thread Jim Shargo
VKMS now supports creating virtual cards and registering them to create real drm devices. In addition to the registration logic, this commit also prevents users from adding new objects once a card is registered. Signed-off-by: Jim Shargo --- drivers/gpu/drm/vkms/vkms_configfs.c | 27 +++- driv

[PATCH 1/5] drm/vkms: Merge default_config and device

2022-07-25 Thread Jim Shargo
This is a small refactor to make ConfigFS support easier. vkms_config is now a member of vkms_device and we now store a top-level reference to vkms_device. This should be a no-op refactor. Signed-off-by: Jim Shargo --- drivers/gpu/drm/vkms/vkms_drv.c| 58 +- dri

[PATCH] gpu/drm: fix repeated words in comments

2022-07-25 Thread wangjianli
Delete the redundant word 'in'. Signed-off-by: wangjianli --- drivers/gpu/drm/drm_framebuffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_framebuffer.c b/drivers/gpu/drm/drm_framebuffer.c index 4562a8b86579..1ece22e7b6cb 100644 --- a/drivers/gpu/dr

[PATCH] msm/adreno: fix repeated words in comments

2022-07-25 Thread wangjianli
Delete the redundant word 'in'. Signed-off-by: wangjianli --- drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c index 9f76f5b15759..9303a011b81d 100644 --- a/dr

[PATCH 2/5] drm/vkms: VKMS now supports more than one "card"

2022-07-25 Thread Jim Shargo
This is a small refactor to make ConfigFS support easier. We now store the vkms_device statically, and maintain a list of "cards", each representing a different virtual DRM driver. We also make it clear when a card is "default", that is created at initialization, and not. This is because, due to

[PATCH] dc/dce: fix repeated words in comments

2022-07-25 Thread wangjianli
Delete the redundant word 'in'. Signed-off-by: wangjianli --- drivers/gpu/drm/amd/display/dc/dce/dce_audio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_audio.c b/drivers/gpu/drm/amd/display/dc/dce/dce_audio.c index 70eaac017624..f

[PATCH v3] drm/msm: Make .remove and .shutdown HW shutdown consistent

2022-07-25 Thread Javier Martinez Canillas
Drivers' .remove and .shutdown callbacks are executed on different code paths. The former is called when a device is removed from the bus, while the latter is called at system shutdown time to quiesce the device. This means that some overlap exists between the two, because both have to take care o

[PATCH] fbdev: Make registered_fb[] private to fbmem.c

2022-07-25 Thread Javier Martinez Canillas
From: Daniel Vetter No driver access this anymore, except for the olpc dcon fbdev driver but that has been marked as broken anyways by commit de0952f267ff ("staging: olpc_dcon: mark driver as broken"). Signed-off-by: Daniel Vetter Signed-off-by: Daniel Vetter Reviewed-by: Javier Martinez Canil

Re: [PATCH] fbdev: Make registered_fb[] private to fbmem.c

2022-07-25 Thread Thomas Zimmermann
Hi Am 25.07.22 um 09:54 schrieb Javier Martinez Canillas: From: Daniel Vetter No driver access this anymore, except for the olpc dcon fbdev driver but that has been marked as broken anyways by commit de0952f267ff ("staging: olpc_dcon: mark driver as broken"). Signed-off-by: Daniel Vetter Sig

Re: [PATCH v6 07/13] mfd: mt6370: Add MediaTek MT6370 support

2022-07-25 Thread Andy Shevchenko
On Fri, Jul 22, 2022 at 12:25 PM ChiaEn Wu wrote: > > From: ChiYuan Huang > > This adds support for the MediaTek MT6370 SubPMIC. MediaTek MT6370 is a > SubPMIC consisting of a single cell battery charger with ADC monitoring, > RGB LEDs, dual channel flashlight, WLED backlight driver, display bias

Re: [PATCH v6 08/13] usb: typec: tcpci_mt6370: Add MediaTek MT6370 tcpci driver

2022-07-25 Thread Andy Shevchenko
On Fri, Jul 22, 2022 at 12:25 PM ChiaEn Wu wrote: > > From: ChiYuan Huang > > The MediaTek MT6370 is a highly-integrated smart power management IC, > which includes a single cell Li-Ion/Li-Polymer switching battery > charger, a USB Type-C & Power Delivery (PD) controller, dual > Flash LED current

Re: [PATCH v6 09/13] iio: adc: mt6370: Add MediaTek MT6370 support

2022-07-25 Thread Andy Shevchenko
On Fri, Jul 22, 2022 at 12:25 PM ChiaEn Wu wrote: > > From: ChiaEn Wu > > MediaTek MT6370 is a SubPMIC consisting of a single cell battery charger > with ADC monitoring, RGB LEDs, dual channel flashlight, WLED backlight > driver, display bias voltage supply, one general purpose LDO, and the > USB

Re: [PATCH v5 2/2] drm/panfrost: Add support for devcoredump

2022-07-25 Thread Steven Price
On 18/07/2022 18:24, Adrián Larumbe wrote: > In the event of a job timeout, debug dump information will be written into > /sys/class/devcoredump. > > Inspired by etnaviv's similar feature. > > Signed-off-by: Adrián Larumbe LGTM Reviewed-by: Steven Price Steve > --- > drivers/gpu/drm/panfros

Re: [PATCH v5 1/2] drm/panfrost: Add specific register offset macros for JS and MMU AS

2022-07-25 Thread Steven Price
On 18/07/2022 18:24, Adrián Larumbe wrote: > Each Panfrost job has its own job slot and MMU address space set of > registers, which are selected with a job-specific index. > > Turn the shift and stride used for selection of the right register set base > into a define rather than using magic number

Re: [PATCH] fbdev: Make registered_fb[] private to fbmem.c

2022-07-25 Thread Helge Deller
On 7/25/22 09:55, Thomas Zimmermann wrote: > Hi > > Am 25.07.22 um 09:54 schrieb Javier Martinez Canillas: >> From: Daniel Vetter >> >> No driver access this anymore, except for the olpc dcon fbdev driver but >> that has been marked as broken anyways by commit de0952f267ff ("staging: >> olpc_dcon:

Re: [PATCH v6 10/13] power: supply: mt6370: Add MediaTek MT6370 charger driver

2022-07-25 Thread Andy Shevchenko
On Fri, Jul 22, 2022 at 12:25 PM ChiaEn Wu wrote: > > From: ChiaEn Wu > > MediaTek MT6370 is a SubPMIC consisting of a single cell battery charger > with ADC monitoring, RGB LEDs, dual channel flashlight, WLED backlight > driver, display bias voltage supply, one general purpose LDO, and the > USB

Re: [PATCH] drm: Prevent modeset helpers to access an uninitialized drm_mode_config

2022-07-25 Thread Javier Martinez Canillas
Hello Thomas, On 7/25/22 09:12, Thomas Zimmermann wrote: [...] Let make the DRM core more robust and prevent this to happen, by marking a struct drm_mode_config as initialized during drmm_mode_config_init(). that way helpers can check for it and not attempt to grab uninitiali

Re: [PATCH v6 07/13] mfd: mt6370: Add MediaTek MT6370 support

2022-07-25 Thread ChiaEn Wu
On Mon, Jul 25, 2022 at 4:00 PM Andy Shevchenko wrote: > ... > > > +#define MT6370_REG_DEV_INFO0x100 > > +#define MT6370_REG_CHG_IRQ10x1C0 > > +#define MT6370_REG_CHG_MASK1 0x1E0 > > + > > +#define MT6370_VENID_MASK GENMASK(7, 4) > > + > > +#define MT6370_NUM_IRQREGS 16 > > +#

Re: [PATCH v6 11/13] leds: rgb: mt6370: Add MediaTek MT6370 current sink type LED Indicator support

2022-07-25 Thread Andy Shevchenko
On Fri, Jul 22, 2022 at 12:25 PM ChiaEn Wu wrote: > > From: ChiYuan Huang (Note this and read below) > > The MediaTek MT6370 is a highly-integrated smart power management IC, > which includes a single cell Li-Ion/Li-Polymer switching battery > charger, a USB Type-C & Power Delivery (PD) co

Re: [PATCH v6 07/13] mfd: mt6370: Add MediaTek MT6370 support

2022-07-25 Thread Andy Shevchenko
On Mon, Jul 25, 2022 at 10:30 AM ChiaEn Wu wrote: > On Mon, Jul 25, 2022 at 4:00 PM Andy Shevchenko > wrote: ... > > > +#define MT6370_REG_DEV_INFO0x100 > > > +#define MT6370_REG_CHG_IRQ10x1C0 > > > +#define MT6370_REG_CHG_MASK1 0x1E0 > > > + > > > +#define MT6370_VENID_MASK GENM

Re: [PATCH v6 12/13] leds: flash: mt6370: Add MediaTek MT6370 flashlight support

2022-07-25 Thread Andy Shevchenko
On Fri, Jul 22, 2022 at 12:25 PM ChiaEn Wu wrote: > > From: Alice Chen > > The MediaTek MT6370 is a highly-integrated smart power management IC, > which includes a single cell Li-Ion/Li-Polymer switching battery > charger, a USB Type-C & Power Delivery (PD) controller, dual Flash > LED current so

Re: [PATCH v6 12/13] leds: flash: mt6370: Add MediaTek MT6370 flashlight support

2022-07-25 Thread Andy Shevchenko
On Fri, Jul 22, 2022 at 12:25 PM ChiaEn Wu wrote: Forgot to add a couple of things... ... > +#define MT6370_ITORCH_MIN_UA 25000 > +#define MT6370_ITORCH_STEP_UA 12500 > +#define MT6370_ITORCH_MAX_UA 40 > +#define MT6370_ITORCH_DOUBLE_MAX_UA80 > +#define

Re: [PATCH v6 07/13] mfd: mt6370: Add MediaTek MT6370 support

2022-07-25 Thread ChiaEn Wu
On Mon, Jul 25, 2022 at 4:43 PM Andy Shevchenko wrote: > > ... > > > > > +#define MT6370_REG_DEV_INFO0x100 > > > > +#define MT6370_REG_CHG_IRQ10x1C0 > > > > +#define MT6370_REG_CHG_MASK1 0x1E0 > > > > + > > > > +#define MT6370_VENID_MASK GENMASK(7, 4) > > > > + > > > > +#define MT63

Re: [PATCH v6 13/13] video: backlight: mt6370: Add MediaTek MT6370 support

2022-07-25 Thread Andy Shevchenko
On Fri, Jul 22, 2022 at 12:25 PM ChiaEn Wu wrote: > > From: ChiaEn Wu > > MediaTek MT6370 is a SubPMIC consisting of a single cell battery charger > with ADC monitoring, RGB LEDs, dual channel flashlight, WLED backlight > driver, display bias voltage supply, one general purpose LDO, and the > USB

Re: [PATCH v6 07/13] mfd: mt6370: Add MediaTek MT6370 support

2022-07-25 Thread Andy Shevchenko
On Mon, Jul 25, 2022 at 11:06 AM ChiaEn Wu wrote: > On Mon, Jul 25, 2022 at 4:43 PM Andy Shevchenko > wrote: ... > > > > > +#define MT6370_REG_DEV_INFO0x100 > > > > > +#define MT6370_REG_CHG_IRQ10x1C0 > > > > > +#define MT6370_REG_CHG_MASK1 0x1E0 > > > > > + > > > > > +#define MT6370_

[PATCH v5 0/7] Fixes integer overflow or integer truncation issues in page lookups, ttm place configuration and scatterlist creation

2022-07-25 Thread Gwan-gyeong Mun
This patch series fixes integer overflow or integer truncation issues in page lookups, ttm place configuration and scatterlist creation, etc. We need to check that we avoid integer overflows when looking up a page, and so fix all the instances where we have mistakenly used a plain integer instead o

[PATCH v5 1/7] drm: Move and add a few utility macros into drm util header

2022-07-25 Thread Gwan-gyeong Mun
It moves overflows_type utility macro into drm util header from i915_utils header. The overflows_type can be used to catch the truncation between data types. And it adds safe_conversion() macro which performs a type conversion (cast) of an source value into a new variable, checking that the destina

[PATCH v5 3/7] drm/i915: Check for integer truncation on scatterlist creation

2022-07-25 Thread Gwan-gyeong Mun
From: Chris Wilson There is an impedance mismatch between the scatterlist API using unsigned int and our memory/page accounting in unsigned long. That is we may try to create a scatterlist for a large object that overflows returning a small table into which we try to fit very many pages. As the o

[PATCH v5 6/7] drm/i915: Use error code as -E2BIG when the size of gem ttm object is too large

2022-07-25 Thread Gwan-gyeong Mun
The ttm_bo_init_reserved() functions returns -ENOSPC if the size is too big to add vma. The direct function that returns -ENOSPC is drm_mm_insert_node_in_range(). To handle the same error as other code returning -E2BIG when the size is too large, it converts return value to -E2BIG. Signed-off-by:

[PATCH v5 4/7] drm/i915: Check for integer truncation on the configuration of ttm place

2022-07-25 Thread Gwan-gyeong Mun
There is an impedance mismatch between the first/last valid page frame number of ttm place in unsigned and our memory/page accounting in unsigned long. As the object size is under the control of userspace, we have to be prudent and catch the conversion errors. To catch the implicit truncation as we

[PATCH v5 2/7] drm/i915/gem: Typecheck page lookups

2022-07-25 Thread Gwan-gyeong Mun
From: Chris Wilson We need to check that we avoid integer overflows when looking up a page, and so fix all the instances where we have mistakenly used a plain integer instead of a more suitable long. Be pedantic and add integer typechecking to the lookup so that we can be sure that we are safe. A

[PATCH v5 5/7] drm/i915: Check if the size is too big while creating shmem file

2022-07-25 Thread Gwan-gyeong Mun
The __shmem_file_setup() function returns -EINVAL if size is greater than MAX_LFS_FILESIZE. To handle the same error as other code that returns -E2BIG when the size is too large, it add a code that returns -E2BIG when the size is larger than the size that can be handled. v4: If BITS_PER_LONG is 32

[PATCH v5 7/7] drm/i915: Remove truncation warning for large objects

2022-07-25 Thread Gwan-gyeong Mun
From: Chris Wilson Having addressed the issues surrounding incorrect types for local variables and potential integer truncation in using the scatterlist API, we have closed all the loop holes we had previously identified with dangerously large object creation. As such, we can eliminate the warnin

RE: [PATCH v4 00/10] cover-letter: Update vfio_pin/unpin_pages API

2022-07-25 Thread Xu, Terrence
> -Original Message- > From: intel-gvt-dev On > Behalf Of Nicolin Chen > > This is a preparatory series for IOMMUFD v2 patches. It prepares for > replacing vfio_iommu_type1 implementations of vfio_pin/unpin_pages() > with IOMMUFD version. > > There's a gap between these two versions: the

RE: [PATCH 1/4] drm/amd: Add detailed GFXOFF stats to debugfs

2022-07-25 Thread Quan, Evan
[AMD Official Use Only - General] Using "uint64_t" instead of "uint32_t" for entry counter may be better. BR Evan > -Original Message- > From: amd-gfx On Behalf Of > André Almeida > Sent: Saturday, July 23, 2022 4:34 AM > To: Deucher, Alexander ; Koenig, Christian > ; Pan, Xinhui ; David

Re: [PATCH v6 13/13] video: backlight: mt6370: Add MediaTek MT6370 support

2022-07-25 Thread Daniel Thompson
On Fri, Jul 22, 2022 at 06:24:07PM +0800, ChiaEn Wu wrote: > diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig > index a003e02..846dbe7 100644 > --- a/drivers/video/backlight/Kconfig > +++ b/drivers/video/backlight/Kconfig > @@ -268,6 +268,18 @@ config BACKLIGHT_MAX8925

Re: [Intel-gfx] [PATCH 10/12] drm/i915/guc: Support larger contexts on newer hardware

2022-07-25 Thread Tvrtko Ursulin
On 22/07/2022 20:32, John Harrison wrote: On 7/19/2022 02:56, Tvrtko Ursulin wrote: On 19/07/2022 01:13, John Harrison wrote: On 7/18/2022 05:35, Tvrtko Ursulin wrote: On 13/07/2022 00:31, john.c.harri...@intel.com wrote: From: Matthew Brost The GuC needs a copy of a golden context for i

Re: [Intel-gfx] [PATCH v5 1/7] drm: Move and add a few utility macros into drm util header

2022-07-25 Thread Andrzej Hajda
On 25.07.2022 11:25, Gwan-gyeong Mun wrote: It moves overflows_type utility macro into drm util header from i915_utils header. The overflows_type can be used to catch the truncation between data types. And it adds safe_conversion() macro which performs a type conversion (cast) of an source value

[PATCH v2 1/6] drm/ttm: Add new callbacks to ttm res mgr

2022-07-25 Thread Arunpravin Paneer Selvam
We are adding two new callbacks to ttm resource manager function to handle intersection and compatibility of placement and resources. v2: move the amdgpu and ttm_range_manager changes to separate patches (Christian) Signed-off-by: Christian König Signed-off-by: Arunpravin Paneer Selvam ---

[PATCH v2 2/6] drm/ttm: Implement intersect/compatible functions

2022-07-25 Thread Arunpravin Paneer Selvam
Implemented a new intersect and compatible callback functions to ttm range manager fetching start offset from drm mm range allocator. Signed-off-by: Christian König Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/ttm/ttm_range_manager.c | 33 + 1 file changed

[PATCH v2 5/6] drm/nouveau: Implement intersect/compatible functions

2022-07-25 Thread Arunpravin Paneer Selvam
Implemented a new intersect and compatible callback function fetching the start offset from struct ttm_resource. Signed-off-by: Christian König Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/nouveau/nouveau_mem.c | 29 +++ drivers/gpu/drm/nouveau/nouveau_mem

[PATCH v2 3/6] drm/amdgpu: Implement intersect/compatible functions

2022-07-25 Thread Arunpravin Paneer Selvam
Implemented a new intersect and compatible callback function fetching start offset from backend drm buddy allocator. Signed-off-by: Christian König Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c | 38 drivers/gpu/drm/amd/amdgpu/amdgpu_vram_

[PATCH v2 4/6] drm/i915: Implement intersect/compatible functions

2022-07-25 Thread Arunpravin Paneer Selvam
Implemented a new intersect and compatible callback function fetching start offset from drm buddy allocator. Signed-off-by: Christian König Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/i915/i915_ttm_buddy_manager.c | 43 +++ 1 file changed, 43 insertions(+) diff

[PATCH v2 6/6] drm/ttm: Switch to using the new res callback

2022-07-25 Thread Arunpravin Paneer Selvam
Apply new intersect and compatible callback instead of having a generic placement range verfications. v2: Added a separate callback for compatiblilty checks (Christian) Signed-off-by: Christian König Signed-off-by: Arunpravin Paneer Selvam --- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 45 +

Re: [Intel-gfx] [PATCH v5 2/7] drm/i915/gem: Typecheck page lookups

2022-07-25 Thread Andrzej Hajda
On 25.07.2022 11:25, Gwan-gyeong Mun wrote: From: Chris Wilson We need to check that we avoid integer overflows when looking up a page, and so fix all the instances where we have mistakenly used a plain integer instead of a more suitable long. Be pedantic and add integer typechecking to the loo

Re: [Intel-gfx] [PATCH v5 3/7] drm/i915: Check for integer truncation on scatterlist creation

2022-07-25 Thread Andrzej Hajda
On 25.07.2022 11:25, Gwan-gyeong Mun wrote: From: Chris Wilson There is an impedance mismatch between the scatterlist API using unsigned int and our memory/page accounting in unsigned long. That is we may try to create a scatterlist for a large object that overflows returning a small table into

Re: [Intel-gfx] [PATCH v5 4/7] drm/i915: Check for integer truncation on the configuration of ttm place

2022-07-25 Thread Andrzej Hajda
On 25.07.2022 11:25, Gwan-gyeong Mun wrote: There is an impedance mismatch between the first/last valid page frame number of ttm place in unsigned and our memory/page accounting in unsigned long. As the object size is under the control of userspace, we have to be prudent and catch the conversion

Re: [Intel-gfx] [PATCH v5 5/7] drm/i915: Check if the size is too big while creating shmem file

2022-07-25 Thread Andrzej Hajda
On 25.07.2022 11:25, Gwan-gyeong Mun wrote: The __shmem_file_setup() function returns -EINVAL if size is greater than MAX_LFS_FILESIZE. To handle the same error as other code that returns -E2BIG when the size is too large, it add a code that returns -E2BIG when the size is larger than the size th

Re: [Intel-gfx] [PATCH v5 6/7] drm/i915: Use error code as -E2BIG when the size of gem ttm object is too large

2022-07-25 Thread Andrzej Hajda
On 25.07.2022 11:25, Gwan-gyeong Mun wrote: The ttm_bo_init_reserved() functions returns -ENOSPC if the size is too big to add vma. The direct function that returns -ENOSPC is drm_mm_insert_node_in_range(). To handle the same error as other code returning -E2BIG when the size is too large, it co

Re: [Intel-gfx] [PATCH v5 7/7] drm/i915: Remove truncation warning for large objects

2022-07-25 Thread Andrzej Hajda
On 25.07.2022 11:25, Gwan-gyeong Mun wrote: From: Chris Wilson Having addressed the issues surrounding incorrect types for local variables and potential integer truncation in using the scatterlist API, we have closed all the loop holes we had previously identified with dangerously large object

Re: [PATCH v2 2/5] soc: visconti: Add Toshiba Visconti image processing accelerator common source

2022-07-25 Thread Greg KH
On Fri, Jul 22, 2022 at 05:28:55PM +0900, Yuji Ishikawa wrote: > This commit adds common definitions shared among image processing accelerator > drivers > for Toshiba Visconti SoCs. Please wrap your changelog text lines properly at 72 columns. And you need to provide a lot more information here

Re: [PATCH v2 0/5] Add Toshiba Visconti DNN image processing accelerator driver

2022-07-25 Thread Greg KH
On Fri, Jul 22, 2022 at 05:28:53PM +0900, Yuji Ishikawa wrote: > This series is the DNN image processing accelerator driver for Toshiba's ARM > SoC, Visconti[0]. > This provides DT binding documentation, device driver, MAINTAINER files and > documents. > > Best regards, > Yuji > > [0]: > https

Re: [PATCH v2 4/5] MAINTAINERS: Add entries for Toshiba Visconti DNN image processing accelerator

2022-07-25 Thread Greg KH
On Fri, Jul 22, 2022 at 05:28:57PM +0900, Yuji Ishikawa wrote: > --- > MAINTAINERS | 2 ++ > 1 file changed, 2 insertions(+) No changelog text? No signed-off-by? Are you sure that checkpatch passed this patch? greg k-h

Re: [PATCH v2 3/5] soc: visconti: Add Toshiba Visconti DNN image processing accelerator

2022-07-25 Thread Greg KH
On Fri, Jul 22, 2022 at 05:28:56PM +0900, Yuji Ishikawa wrote: > Add support to DNN image processing accelerator on Toshiba Visconti ARM SoCs. > The accelerator is applicable to DNN inference tasks. > > Signed-off-by: Yuji Ishikawa > Reviewed-by: Nobuhiro Iwamatsu > --- > v1 -> v2: > - applied

Re: [PATCH v2 3/5] soc: visconti: Add Toshiba Visconti DNN image processing accelerator

2022-07-25 Thread Greg KH
On Fri, Jul 22, 2022 at 05:28:56PM +0900, Yuji Ishikawa wrote: > --- /dev/null > +++ b/drivers/soc/visconti/uapi/dnn.h > @@ -0,0 +1,77 @@ > +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ > +/* Toshiba Visconti DNN Accelerator Support > + * > + * (C) Copyright 2022 TOSHIBA CORPORATI

[Bug 216092] rn_vbios_smu_send_msg_with_param+0xf9/0x100 - amdgpu

2022-07-25 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=216092 Arek Ruśniak (arek.r...@gmail.com) changed: What|Removed |Added CC||arek.r...@gmail.com

[PATCH] drm/via: Add new condition to via_dma_cleanup()

2022-07-25 Thread Alisa Khabibrakhmanova
Pointer dev_priv->mmio, which was checked for NULL at via_do_init_map(), is passed to via_do_cleanup_map() and is dereferenced there without check. The patch adds the condition in via_dma_cleanup() which prevents potential NULL pointer dereference. Found by Linux Verification Center (linuxtesting

Re: [PATCH 1/4] drm/amd: Add detailed GFXOFF stats to debugfs

2022-07-25 Thread André Almeida
Às 07:27 de 25/07/22, Quan, Evan escreveu: > [AMD Official Use Only - General] > > Using "uint64_t" instead of "uint32_t" for entry counter may be better. > Indeed, it's a good idea. I'll send a v2 with that change, thanks. > BR > Evan >> -Original Message- >> From: amd-gfx On Behalf O

Re: [PATCH v2 3/8] drm/vmwgfx: Use the hotspot properties from cursor planes

2022-07-25 Thread Martin Krastev (VMware)
From: Martin Krastev On 12.07.22 г. 6:32 ч., Zack Rusin wrote: From: Zack Rusin Atomic modesetting got support for mouse hotspots via the hotspot properties. Port the legacy kms hotspot handling to the new properties on cursor planes. Signed-off-by: Zack Rusin Cc: Martin Krastev Cc: Maaz

[PATCH v4] drm/i915: stop using swiotlb

2022-07-25 Thread Robert Beckett
Calling swiotlb functions directly is nowadays considered harmful. See https://lore.kernel.org/intel-gfx/20220711082614.ga29...@lst.de/ Replace swiotlb_max_segment() calls with dma_max_mapping_size(). In i915_gem_object_get_pages_internal() no longer consider max_segment only if CONFIG_SWIOTLB is

Re: [PATCH v2 01/10] drm/simpledrm: Remove mem field from device structure

2022-07-25 Thread Javier Martinez Canillas
On 7/20/22 16:27, Thomas Zimmermann wrote: > Remove the unused mem field from struct simpledrm_device. > > Signed-off-by: Thomas Zimmermann > --- Acked-by: Javier Martinez Canillas -- Best regards, Javier Martinez Canillas Linux Engineering Red Hat

Re: [PATCH v2 02/10] drm/simpledrm: Inline device-init helpers

2022-07-25 Thread Javier Martinez Canillas
Hello Thomas, On 7/20/22 16:27, Thomas Zimmermann wrote: > Inline the helpers for initializing the hardware FB, the memory > management and the modesetting into the device-creation function. > No functional changes. > Could you please elaborate in the commit message why this change is desirable?

Re: [PATCH v2 03/10] drm/simpledrm: Remove pdev field from device structure

2022-07-25 Thread Javier Martinez Canillas
On 7/20/22 16:27, Thomas Zimmermann wrote: > Replace the remaining uses of the field pdev by upcasts from the Linux > device and remove the field. > > Signed-off-by: Thomas Zimmermann Much better indeed. Acked-by: Javier Martinez Canillas -- Best regards, Javier Martinez Canillas Linux Engi

Re: [PATCH v2 04/10] drm/simpledrm: Compute framebuffer stride if not set

2022-07-25 Thread Javier Martinez Canillas
Hello Geert, On 7/21/22 16:46, Geert Uytterhoeven wrote: > Hi Thomas, > > On Wed, Jul 20, 2022 at 4:27 PM Thomas Zimmermann wrote: >> Compute the framebuffer's scanline stride length if not given by >> the simplefb data. >> >> Signed-off-by: Thomas Zimmermann > > Thanks for your patch! > >> -

[PATCH 2/2] drm/panel/panel-sitronix-st7701: Add Densitron DMT028VGHMCMI-1A TFT

2022-07-25 Thread Marek Vasut
Add support for Densitron DMT028VGHMCMI-1A TFT matrix into this driver. This is a DSI-attached 480x640 2.83 inch panel. Signed-off-by: Marek Vasut Cc: Guido Günther Cc: Jagan Teki Cc: Laurent Pinchart Cc: Linus Walleij Cc: Sam Ravnborg Cc: Thierry Reding --- drivers/gpu/drm/panel/panel-sit

[PATCH 1/2] dt-bindings: display: panel: sitronix, st7701: Add Densitron DMT028VGHMCMI-1A TFT

2022-07-25 Thread Marek Vasut
Add compatible string for Densitron DMT028VGHMCMI-1A TFT matrix. This is a DSI-attached 480x640 2.83 inch panel. Signed-off-by: Marek Vasut Cc: Guido Günther Cc: Jagan Teki Cc: Laurent Pinchart Cc: Linus Walleij Cc: Rob Herring Cc: Sam Ravnborg Cc: Thierry Reding Cc: devicet...@vger.kernel

[PATCH v2 0/5] Move all drivers to a common dma-buf locking convention

2022-07-25 Thread Dmitry Osipenko
Hello, This series moves all drivers to a dynamic dma-buf locking specification. >From now on all dma-buf importers are made responsible for holding dma-buf's reservation lock around all operations performed over dma-bufs in accordance to the locking specification. This allows us to utilize reserv

[PATCH v2 2/5] drm/gem: Take reservation lock for vmap/vunmap operations

2022-07-25 Thread Dmitry Osipenko
The new common dma-buf locking convention will require buffer importers to hold the reservation lock around mapping operations. Make DRM GEM core to take the lock around the vmapping operations and update QXL and i915 drivers to use the locked functions for the case where DRM core now holds the loc

[PATCH v2 1/5] dma-buf: Add _unlocked postfix to function names

2022-07-25 Thread Dmitry Osipenko
Add _unlocked postfix to the dma-buf API function names in a preparation to move all non-dynamic dma-buf users over to the dynamic locking specification. This patch only renames API functions, preparing drivers to the common locking convention. Later on we will make the "unlocked" functions to take

[PATCH v2 3/5] dma-buf: Move all dma-bufs to dynamic locking specification

2022-07-25 Thread Dmitry Osipenko
This patch moves the non-dynamic dma-buf users over to the dynamic locking specification. The strict locking convention prevents deadlock situation for dma-buf importers and exporters. Previously the "unlocked" versions of the dma-buf API functions weren't taking the reservation lock and this patc

[PATCH v2 4/5] media: videobuf2: Stop using internal dma-buf lock

2022-07-25 Thread Dmitry Osipenko
All drivers that use dma-bufs have been moved to the updated locking specification and now dma-buf reservation is guaranteed to be locked by importers during the mapping operations. There is no need to take the internal dma-buf lock anymore. Remove locking from the videobuf2 memory allocators. Ack

[PATCH v2 5/5] dma-buf: Remove internal lock

2022-07-25 Thread Dmitry Osipenko
The internal dma-buf lock isn't needed anymore because the updated locking specification claims that dma-buf reservation must be locked by importers, and thus, the internal data is already protected by the reservation lock. Remove the obsoleted internal lock. Acked-by: Tomasz Figa Signed-off-by:

Re: [PATCH 1/3] Revert "drm/amdgpu: move internal vram_mgr function into the C file"

2022-07-25 Thread Tvrtko Ursulin
On 24/07/2022 19:28, Thomas Zimmermann wrote: Hi Am 22.07.22 um 17:47 schrieb Christian König: Hi Tvrtko, scratching my head what exactly is going on here. I've build tested drm-tip a couple of test in the last week and it always worked flawlessly. It looks like that some conflict resolu

[amdgpu] drm/ttm: fbdev race condition into fork()

2022-07-25 Thread Kyryl Melekhin
Hello Dri-devel, There is yet another race condition happening with ttm objects, this time with fbdev. Please consider the following simple code that shows the problem (or email attached): https://0x0.st/ojmf.c The kernel assertion: [ 2112.472011] ---[ end trace ]--- [ 2182.118

[Bug 216277] X11 doesn't wait for amdgpu driver to be up

2022-07-25 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=216277 Alex Deucher (alexdeuc...@gmail.com) changed: What|Removed |Added CC||alexdeuc...@gmail.c

Re: [PATCH v2 05/10] drm/simpledrm: Convert to atomic helpers

2022-07-25 Thread Javier Martinez Canillas
On 7/20/22 16:27, Thomas Zimmermann wrote: > Replace the simple-KMS helpers with the regular atomic helpers. The > regular helpers are better architectured and therefore allow for easier > code sharing among drivers. No functional changes. > Acked-by: Javier Martinez Canillas But I've a question

[Bug 216277] X11 doesn't wait for amdgpu driver to be up

2022-07-25 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=216277 --- Comment #4 from dark_syl...@yahoo.com.ar --- Thanks for the hint! The amdgpu driver (nor the firmware) are definitely NOT in /boot/initrd.img-5.18.11+ I will have to lookup how to include them into initrd. Though it may be worth mentioning

Re: [PATCH 1/4] drm/amd: Add detailed GFXOFF stats to debugfs

2022-07-25 Thread André Almeida
Às 10:04 de 25/07/22, André Almeida escreveu: > Às 07:27 de 25/07/22, Quan, Evan escreveu: >> [AMD Official Use Only - General] >> >> Using "uint64_t" instead of "uint32_t" for entry counter may be better. >> > > Indeed, it's a good idea. I'll send a v2 with that change, thanks. > However, SMU m

Re: [PATCH v2 06/10] drm/simpledrm: Move some functionality into fwfb helper library

2022-07-25 Thread Javier Martinez Canillas
On 7/20/22 16:27, Thomas Zimmermann wrote: > Move some of simpledrm's functionality into a helper library. Other > drivers for firmware-provided framebuffers will also need functions > to handle fixed modes and color formats, or update the back buffer. > > Signed-off-by: Thomas Zimmermann > ---

[Bug 216277] X11 doesn't wait for amdgpu driver to be up

2022-07-25 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=216277 --- Comment #5 from dark_syl...@yahoo.com.ar --- Your hint is very good. It tells me upstream kernel devs expect the amdgpu driver & firmware should be in initrd; while Ubuntu does not do that. This is starting to look more and more like an Ubun

Re: [PATCH] drm/amdgpu: remove useless condition in amdgpu_job_stop_all_jobs_on_sched()

2022-07-25 Thread Andrey Grodzovsky
Reviewed-by: Andrey Grodzovsky Andrey On 2022-07-19 06:39, Andrey Strachuk wrote: Local variable 'rq' is initialized by an address of field of drm_sched_job, so it does not make sense to compare 'rq' with NULL. Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by:

Re: [PATCH 1/3] Revert "drm/amdgpu: move internal vram_mgr function into the C file"

2022-07-25 Thread Christian König
Am 25.07.22 um 17:27 schrieb Tvrtko Ursulin: On 24/07/2022 19:28, Thomas Zimmermann wrote: Hi Am 22.07.22 um 17:47 schrieb Christian König: Hi Tvrtko, scratching my head what exactly is going on here. I've build tested drm-tip a couple of test in the last week and it always worked flawless

Re: [PATCH] component: try_module_get() to prevent unloading while in use

2022-07-25 Thread Greg KH
On Mon, Jul 25, 2022 at 05:08:59PM +0100, Richard Fitzgerald wrote: > Call try_module_get() on a component before attempting to call its > bind() function, to ensure that a loadable module cannot be > unloaded while we are executing its bind(). How can bind be called while the module is unloaded?

[PATCH 1/2] drm/amd/display: change variables type

2022-07-25 Thread Magali Lemes
As "dcn3_15_soc" and "dcn3_16_soc" are of type "struct _vcs_dpi_soc_bounding_box_st", change their types accordingly. Signed-off-by: Magali Lemes --- drivers/gpu/drm/amd/display/dc/dcn315/dcn315_resource.h | 2 +- drivers/gpu/drm/amd/display/dc/dcn316/dcn316_resource.h | 2 +- 2 files changed, 2

[PATCH 2/2] drm/amd/display: include missing headers

2022-07-25 Thread Magali Lemes
Add missing headers to solve the following warnings from sparse: drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn20/dcn20_fpu.c:656:17: warning: symbol 'ddr4_wm_table_gs' was not declared. Should it be static? drivers/gpu/drm/amd/amdgpu/../display/dc/dml/dcn20/dcn20_fpu.c:693:17: warning: symbol

Re: [PATCH] drm/i915/guc: Check for ct enabled while waiting for response

2022-07-25 Thread Dixit, Ashutosh
On Fri, 15 Jul 2022 14:13:13 -0700, Zhanjun Dong wrote: > > -static int wait_for_ct_request_update(struct ct_request *req, u32 *status) > +static int wait_for_ct_request_update(struct intel_guc_ct *ct, struct > ct_request *req, u32 *status) > { > int err; > + bool ct_enabled; > >

[PATCH libdrm v1 0/2] Add Writeback Support for Modetest

2022-07-25 Thread Rohith Iyer
Add writeback support to modetest with the below options: - Passing in -c will now also show the writeback connector - Test a built-in mode on writeback connector - Test a custom mode from user input on writeback connector Usage: "./modetest -M msm -x : -a -P @:+0+0@RG24." Refer

Re: [PATCH] drm/meson: Fix refcount bugs in meson_vpu_has_available_connectors()

2022-07-25 Thread Martin Blumenstingl
Hello, On Fri, Jul 15, 2022 at 3:22 PM Liang He wrote: > > In this function, there are two refcount leak bugs: > (1) when breaking out of for_each_endpoint_of_node(), we need call > the of_node_put() for the 'ep'; > (2) we should call of_node_put() for the reference returned by > of_graph_get_rem

[PATCH 0/2] Sanitycheck PCI BARs

2022-07-25 Thread Piorkowski, Piotr
From: Piotr Piórkowski When initializing the i915, we want to be sure that the PCI BARs have been properly initialized. As part of this series, I have prepared two patches, one that introduces BARs names to use in code instead of numbers, and another that adds function to validate BARs before use

[PATCH 2/2] drm/i915: Sanitycheck PCI BARs

2022-07-25 Thread Piorkowski, Piotr
From: Piotr Piórkowski For proper operation of i915 we need usable PCI GTTMMADDR BAR 0 (1 for GEN2). In most cases we also need usable PCI GFXMEM BAR 2. Let's add functions to check if BARs are set, and that it have a size greater than 0. In case GTTMMADDR BAR, let's validate at the beginning of

[PATCH 1/2] drm/i915: Use of BARs names instead of numbers

2022-07-25 Thread Piorkowski, Piotr
From: Piotr Piórkowski At the moment, when we refer to some PCI BAR we use the number of this BAR in the code. The meaning of BARs between different platforms may be different. Therefore, in order to organize the code, let's start using defined names instead of numbers. Signed-off-by: Piotr Piór

Re: [PATCH 1/2] drm/amd/display: change variables type

2022-07-25 Thread André Almeida
Hi Magali, Às 15:15 de 25/07/22, Magali Lemes escreveu: > As "dcn3_15_soc" and "dcn3_16_soc" are of type "struct > _vcs_dpi_soc_bounding_box_st", change their types accordingly. > I can see that indeed this type change sense for those variables, but isn't a bit strange that the type was wrong in

[PATCH libdrm v1 2/2] tests/modetest: Add support for writeback connector

2022-07-25 Thread Rohith Iyer
Add writeback support to modetest with the below options: - Passing in -c will now also show the writeback connector - Test a built-in mode on writeback connector - Test a custom mode from user input on writeback connector Usage: "./modetest -M msm -x : -a -P @:+0+0@RG24." Refer

  1   2   >