Re: [PATCH] drivers: gpu: drm: xen_drm_front_drm_info is declared twice

2021-03-25 Thread Oleksandr Andrushchenko
Hi, On 3/25/21 8:19 AM, Wan Jiabing wrote: > struct xen_drm_front_drm_info has been declared. > Remove the duplicate. > > Signed-off-by: Wan Jiabing Thank you for the patch, Reviewed-by: Oleksandr Andrushchenko Will apply to drm-misc-next-fixes Thank you, Oleksandr > ---

Re: [PATCH] gpu/xen: Fix a use after free in xen_drm_drv_init

2021-03-25 Thread Oleksandr Andrushchenko
iled and still free the drm_info. > Second sets front_info->drm_info to NULL to avoid uaf. > > Signed-off-by: Lv Yunlong Thank you for the patch, Reviewed-by: Oleksandr Andrushchenko Will apply to drm-misc-next-fixes Thank you, Oleksandr > --- > drivers/gpu/drm/xen/xen_d

Re: [PATCH] drivers: gpu: drm: xen_drm_front_drm_info is declared twice

2021-03-25 Thread Oleksandr Andrushchenko
Hi, Daniel! On 3/25/21 11:16 AM, Daniel Vetter wrote: > On Thu, Mar 25, 2021 at 7:53 AM Oleksandr Andrushchenko > wrote: >> Hi, >> >> On 3/25/21 8:19 AM, Wan Jiabing wrote: >>> struct xen_drm_front_drm_info has been declared. >>> Remove the duplicate. &g

Re: [PATCH] drm/xen: adjust Kconfig

2021-02-24 Thread Oleksandr Andrushchenko
"depends on" to the other, real option, and "select"ing > the dummy one. > > Signed-off-by: Jan Beulich Reviewed-by: Oleksandr Andrushchenko > --- a/drivers/gpu/drm/xen/Kconfig > +++ b/drivers/gpu/drm/xen/Kconfig > @@ -1,15 +1,11 @@ > # SPDX-License-Ide

Re: [PATCH] drm/xen: adjust Kconfig

2021-03-01 Thread Oleksandr Andrushchenko
On 2/24/21 6:17 PM, Daniel Vetter wrote: > On Wed, Feb 24, 2021 at 8:55 AM Oleksandr Andrushchenko > wrote: >> Hello, Jan! >> >> On 2/23/21 6:41 PM, Jan Beulich wrote: >>> By having selected DRM_XEN, I was assuming I would build the frontend >>> driv

Re: [PATCH 2/5] xen: flag xen_drm_front to be not essential for system boot

2021-10-22 Thread Oleksandr Andrushchenko
Hi, Juergen! On 22.10.21 09:47, Juergen Gross wrote: > Similar to the virtual frame buffer (vfb) the pv display driver is not > essential for booting the system. Set the respective flag. > > Signed-off-by: Juergen Gross Reviewed-by: Oleksandr Andrushchenko > --- > d

Re: [PATCH 2/3] drm/xen: Implement mmap as GEM object function

2021-11-08 Thread Oleksandr Andrushchenko
created by the helper macro > DEFINE_DRM_GEM_FOPS(). > > Signed-off-by: Thomas Zimmermann Reviewed-by: Oleksandr Andrushchenko > --- > drivers/gpu/drm/xen/xen_drm_front.c | 16 +--- > drivers/gpu/drm/xen/xen_drm_front_gem.c | 108 +--- > drivers/g

Re: [PATCH] drm/xen: fix potential memleak in error branch

2021-11-15 Thread Oleksandr Andrushchenko
Hi, Bernard! On 15.11.21 05:45, Bernard Zhao wrote: > In function xen_drm_front_gem_import_sg_table, if in error branch, > there maybe potential memleak if not call gem_free_pages_array. > > Signed-off-by: Bernard Zhao > --- > drivers/gpu/drm/xen/xen_drm_front_gem.c | 8 ++-- > 1 file chan

Re: [PATCH 59/60] drm/xen: Add support for the nomodeset kernel parameter

2021-12-14 Thread Oleksandr Andrushchenko
return -ENODEV; > + > DRM_INFO("Creating %s\n", xen_drm_driver.desc); > > drm_info = kzalloc(sizeof(*drm_info), GFP_KERNEL); With the commit message fixed: Reviewed-by: Oleksandr Andrushchenko Thank you, Oleksandr

Re: [PATCH] drm/cma-helper: Fix drm_gem_cma_free_object()

2019-05-07 Thread Oleksandr Andrushchenko
the if ladder and first check if the buffer is imported. Fixes: b9068cde51ee ("drm/cma-helper: Add DRM_GEM_CMA_VMAP_DRIVER_OPS") Cc: sta...@vger.kernel.org Reported-by: "Li, Tingqian" Signed-off-by: Noralf Trønnes Reviewed-by: Oleksandr Andrushchenko --

Re: [Xen-devel] [PATCH v2] drm/xen-front: Make shmem backed display buffer coherent

2019-01-22 Thread Oleksandr Andrushchenko
On 1/18/19 1:43 PM, Julien Grall wrote: > (+ Stefano) > > Hi, > > Sorry for jumping late in the conversation. > > On 18/01/2019 09:40, Oleksandr Andrushchenko wrote: >> On 1/17/19 11:18 AM, Christoph Hellwig wrote: >>> On Wed, Jan 16, 2019 at 06:43:29AM +

Re: [Xen-devel] [PATCH v2] drm/xen-front: Make shmem backed display buffer coherent

2019-01-23 Thread Oleksandr Andrushchenko
Hello, Julien! On 1/21/19 7:09 PM, Julien Grall wrote: > Hello, > > On 21/01/2019 12:43, Oleksandr Andrushchenko wrote: >> On 1/18/19 1:43 PM, Julien Grall wrote: >>> On 18/01/2019 09:40, Oleksandr Andrushchenko wrote: >>>> On 1/17/19 11:18 AM, Christoph Hellw

Re: [Xen-devel] [PATCH v2] drm/xen-front: Make shmem backed display buffer coherent

2019-01-25 Thread Oleksandr Andrushchenko
Hello, Julien! Sorry for the late reply - it took quite some time to collect the data requested. On 1/22/19 1:44 PM, Julien Grall wrote: > > > On 1/22/19 10:28 AM, Oleksandr Andrushchenko wrote: >> Hello, Julien! > > Hi, > >> On 1/21/19 7:09 PM, Julien Grall wr

Re: [PATCH -next] drm/xen-front: Drop pointless static qualifier in fb_destroy()

2019-01-28 Thread Oleksandr Andrushchenko
On 1/26/19 2:05 PM, YueHaibing wrote: > There is no need to have the 'struct drm_framebuffer *fb' variable > static since new value always be assigned before use it. > > Signed-off-by: YueHaibing Good catch, thank you! Reviewed-by: Oleksandr Andrushchenko > --

[Xen-devel][PATCH] drm/xen-front: Fix mmap attributes for display buffers

2019-01-29 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko When GEM backing storage is allocated those are normal pages, so there is no point using pgprot_writecombine while mmaping. This fixes mismatch of buffer pages' memory attributes between the frontend and backend which may cause screen artifacts. Fixes: c575b7e

Re: [Xen-devel] [PATCH v2] drm/xen-front: Make shmem backed display buffer coherent

2019-01-30 Thread Oleksandr Andrushchenko
On 1/24/19 5:02 PM, Julien Grall wrote: > > > On 24/01/2019 14:34, Oleksandr Andrushchenko wrote: >> Hello, Julien! > > Hi, > >> On 1/22/19 1:44 PM, Julien Grall wrote: >>> >>> >>> On 1/22/19 10:28 AM, Oleksandr Andrushchenko wrote: &g

Re: [Xen-devel] [PATCH v2] drm/xen-front: Make shmem backed display buffer coherent

2019-01-30 Thread Oleksandr Andrushchenko
Dropped in favor of https://lkml.org/lkml/2019/1/29/910 On 1/24/19 5:02 PM, Julien Grall wrote: > > > On 24/01/2019 14:34, Oleksandr Andrushchenko wrote: >> Hello, Julien! > > Hi, > >> On 1/22/19 1:44 PM, Julien Grall wrote: >>> >>> >&g

Re: [Xen-devel][PATCH] drm/xen-front: Fix mmap attributes for display buffers

2019-01-30 Thread Oleksandr Andrushchenko
On 1/29/19 9:07 PM, Julien Grall wrote: > Hi Oleksandr, > > On 1/29/19 3:04 PM, Oleksandr Andrushchenko wrote: >> From: Oleksandr Andrushchenko >> >> When GEM backing storage is allocated those are normal pages, >> so there is no point using pgprot_writecom

Re: [Xen-devel][PATCH] drm/xen-front: Fix mmap attributes for display buffers

2019-02-01 Thread Oleksandr Andrushchenko
On 1/30/19 11:09 AM, Oleksandr Andrushchenko wrote: > On 1/29/19 9:07 PM, Julien Grall wrote: >> Hi Oleksandr, >> >> On 1/29/19 3:04 PM, Oleksandr Andrushchenko wrote: >>> From: Oleksandr Andrushchenko >>> >>> When GEM backing storage is allocated

Re: [PATCH -next] drm/xen-front: Drop pointless static qualifier in fb_destroy()

2019-02-01 Thread Oleksandr Andrushchenko
On 1/28/19 8:36 AM, Oleksandr Andrushchenko wrote: > On 1/26/19 2:05 PM, YueHaibing wrote: >> There is no need to have the 'struct drm_framebuffer *fb' variable >> static since new value always be assigned before use it. >> >> Signed-off-by: YueHaibing &

Re: [Xen-devel][PATCH] drm/xen-front: Fix mmap attributes for display buffers

2019-02-04 Thread Oleksandr Andrushchenko
On 1/29/19 9:07 PM, Julien Grall wrote: > Hi Oleksandr, > > On 1/29/19 3:04 PM, Oleksandr Andrushchenko wrote: >> From: Oleksandr Andrushchenko >> >> When GEM backing storage is allocated those are normal pages, >> so there is no point using pgprot_writecom

Re: [Xen-devel] [PATCH -next] drm/xen-front: Drop pointless static qualifier in fb_destroy()

2019-02-04 Thread Oleksandr Andrushchenko
On 1/26/19 2:05 PM, YueHaibing wrote: > There is no need to have the 'struct drm_framebuffer *fb' variable > static since new value always be assigned before use it. > > Signed-off-by: YueHaibing > --- > drivers/gpu/drm/xen/xen_drm_front_kms.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletio

Re: [PATCH 5/6] drm/xen: Use drm_dev_unregister()

2019-02-05 Thread Oleksandr Andrushchenko
er the check. > > Cc: Oleksandr Andrushchenko > Signed-off-by: Noralf Trønnes > --- > drivers/gpu/drm/xen/xen_drm_front.c | 7 ++- > 1 file changed, 2 insertions(+), 5 deletions(-) > > diff --git a/drivers/gpu/drm/xen/xen_drm_front.c > b/drivers/gpu/drm/xen/xen

Re: [PATCH 6/6] drm/drv: Remove drm_dev_unplug()

2019-02-05 Thread Oleksandr Andrushchenko
On 2/3/19 5:42 PM, Noralf Trønnes wrote: > There are no users left. > > Signed-off-by: Noralf Trønnes Reviewed-by: Oleksandr Andrushchenko > --- > drivers/gpu/drm/drm_drv.c | 17 - > include/drm/drm_drv.h | 1 - > 2 files changed, 18 deletions(-) >

Re: [PATCH 2/6] drm/drv: Prepare to remove drm_dev_unplug()

2019-02-05 Thread Oleksandr Andrushchenko
On 2/3/19 5:41 PM, Noralf Trønnes wrote: > The only thing now that makes drm_dev_unplug() special is that it sets > drm_device->unplugged. Move this code to drm_dev_unregister() so that we > can remove drm_dev_unplug(). > > Signed-off-by: Noralf Trønnes Reviewed-by: Oleks

Re: [PATCH 1/6] drm: Fix drm_release() and device unplug

2019-02-05 Thread Oleksandr Andrushchenko
s there's open fd(s) > - The driver holds a ref on drm_device as long as it's bound to the >struct device > > When both sides are done with drm_device, it is released. > > Signed-off-by: Noralf Trønnes Reviewed-by: Oleksandr Andrushchenko > --- > dri

Re: [PATCH v2 2/2] drm/drv: drm_dev_unplug(): Move out drm_dev_put() call

2019-02-08 Thread Oleksandr Andrushchenko
rs/gpu/drm/xen/xen_drm_front.c +++ b/drivers/gpu/drm/xen/xen_drm_front.c @@ -582,6 +582,7 @@ static void xen_drm_drv_fini(struct xen_drm_front_info *front_info) drm_kms_helper_poll_fini(dev); drm_dev_unplug(dev); + drm_dev_put(dev); Acked-by: Oleksandr Andrushchenko front_

Re: [Xen-devel] [PATCH v2 2/3] drm/xen-front: Use Xen common shared buffer implementation

2018-12-18 Thread Oleksandr Andrushchenko
On 12/17/18 5:26 PM, Boris Ostrovsky wrote: On 12/17/18 10:03 AM, Oleksandr Andrushchenko wrote: On 12/17/18 4:52 PM, Boris Ostrovsky wrote: On 12/17/18 5:19 AM, Oleksandr Andrushchenko wrote: Hello, Juergen, Boris! As this DRM part of the series is the only one which needs ack/nack (and it

Re: [Xen-devel][PATCH v2 2/3] drm/xen-front: Use Xen common shared buffer implementation

2018-12-18 Thread Oleksandr Andrushchenko
On 12/18/18 20:31, Boris Ostrovsky wrote: On 12/18/18 11:15 AM, Noralf Trønnes wrote: Den 30.11.2018 08.42, skrev Oleksandr Andrushchenko: From: Oleksandr Andrushchenko Use page directory based shared buffer implementation now available as common code for Xen frontend drivers. Remove

Re: [PATCH] drm/xen-front: Make shmem backed display buffer coherent

2018-12-19 Thread Oleksandr Andrushchenko
On 12/18/18 9:20 PM, Noralf Trønnes wrote: Den 27.11.2018 11.32, skrev Oleksandr Andrushchenko: From: Oleksandr Andrushchenko When GEM backing storage is allocated with drm_gem_get_pages the backing pages may be cached, thus making it possible that the backend sees only partial content of

Re: [PATCH] drm/xen-front: Make shmem backed display buffer coherent

2018-12-19 Thread Oleksandr Andrushchenko
On 12/19/18 3:14 PM, Gerd Hoffmann wrote: Hi, +    mapping = xen_obj->base.filp->f_mapping; +    mapping_set_gfp_mask(mapping, GFP_USER | __GFP_DMA32); Let's see if I understand what you're doing: Here you say that the pages should be DMA accessible for devices that can only see 4GB. Yes,

Re: [PATCH] drm/bochs: add edid present check

2018-12-19 Thread Oleksandr Andrushchenko
ointer arithmetic here? + return -1; + kfree(bochs->edid); bochs->edid = drm_do_get_edid(&bochs->connector, bochs_get_edid_block, bochs); With the above fixed: Reviewed-by: Oleksandr Andrushchenko ___

Re: [PATCH 01/14] drm/bochs: encoder cleanup

2018-12-19 Thread Oleksandr Andrushchenko
*dev) encoder->possible_crtcs = 0x1; drm_encoder_init(dev, encoder, &bochs_encoder_encoder_funcs, DRM_MODE_ENCODER_DAC, NULL); - drm_encoder_helper_add(encoder, &bochs_encoder_helper_funcs); } Reviewed-by: Oleksand

Re: [PATCH 02/14] drm/bochs: split bochs_hw_setmode

2018-12-19 Thread Oleksandr Andrushchenko
if (WARN_ON(crtc->primary->fb == NULL)) return -EINVAL; - bochs_hw_setmode(bochs, mode, crtc->primary->fb->format); + bochs_hw_setmode(bochs, mode); + bochs_hw_setformat(bochs, crtc->primary->fb->format); I was about to suggest that you

Re: [PATCH 03/14] drm/bochs: atomic: add atomic_flush+atomic_enable callbacks.

2018-12-19 Thread Oleksandr Andrushchenko
Hi, Gerd! On 12/19/18 1:51 PM, Gerd Hoffmann wrote: Conversion to atomic modesetting, step one. Add atomic crtc helper callbacks. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/bochs/bochs_kms.c | 25 + 1 file changed, 25 insertions(+) diff --git a/drivers/gpu/drm

Re: [PATCH] drm/bochs: add edid present check

2018-12-19 Thread Oleksandr Andrushchenko
On 12/19/18 5:21 PM, Gerd Hoffmann wrote: Hi, You could probably have a comment here explaining the magic below (just like in the commit message to ease the task of understanding while reading the code why 2 of 8 bytes of the EDID header is checked and why it is all needed). Of course one ca

Re: [PATCH] drm/xen-front: Make shmem backed display buffer coherent

2018-12-20 Thread Oleksandr Andrushchenko
On 12/19/18 4:10 PM, Gerd Hoffmann wrote: Hi, Sure this actually helps? It's below 4G in guest physical address space, so it can be backed by pages which are actually above 4G in host physical address space ... Yes, you are right here. This is why I wrote about the IOMMU and other conditio

Re: [PATCH] drm/xen-front: Make shmem backed display buffer coherent

2018-12-20 Thread Oleksandr Andrushchenko
On 12/19/18 6:14 PM, Noralf Trønnes wrote: Den 19.12.2018 09.18, skrev Oleksandr Andrushchenko: On 12/18/18 9:20 PM, Noralf Trønnes wrote: Den 27.11.2018 11.32, skrev Oleksandr Andrushchenko: From: Oleksandr Andrushchenko When GEM backing storage is allocated with drm_gem_get_pages the

Re: [PATCH v3] drm/bochs: add edid present check

2018-12-20 Thread Oleksandr Andrushchenko
/bochs: add edid support. Signed-off-by: Gerd Hoffmann Reviewed-by: Daniel Vetter Reviewed-by: Oleksandr Andrushchenko --- drivers/gpu/drm/bochs/bochs_hw.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/bochs/bochs_hw.c b/drivers/gpu/drm/bochs/bochs_hw.c index

Re: [PATCH 04/14] drm/bochs: atomic: add mode_set_nofb callback.

2018-12-20 Thread Oleksandr Andrushchenko
On 12/19/18 1:51 PM, Gerd Hoffmann wrote: Conversion to atomic modesetting, step two. Add mode_set_nofb crtc helper callback. Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko --- drivers/gpu/drm/bochs/bochs_kms.c | 9 + 1 file changed, 9 insertions(+) diff

Re: [PATCH 05/14] drm/bochs: atomic: switch planes to atomic, wire up helpers.

2018-12-20 Thread Oleksandr Andrushchenko
tc->primary->state, fb); Taking into account that crtc->primary access goes away in the series: Reviewed-by: Oleksandr Andrushchenko bochs_crtc_mode_set_base(crtc, 0, 0, old_fb); if (event) { spin_lock_irqsave(&bochs->dev->event_lock, irqflags)

Re: [PATCH 06/14] drm/bochs: atomic: use atomic set_config helper

2018-12-20 Thread Oleksandr Andrushchenko
On 12/19/18 1:51 PM, Gerd Hoffmann wrote: Conversion to atomic modesetting, step four. Use atomic set_config helper for crtc. Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko --- drivers/gpu/drm/bochs/bochs_kms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

Re: [PATCH 07/14] drm/bochs: atomic: use atomic page_flip helper

2018-12-20 Thread Oleksandr Andrushchenko
On 12/19/18 1:51 PM, Gerd Hoffmann wrote: Conversion to atomic modesetting, step five. Use atomic page_flip helper for crtc. Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko --- drivers/gpu/drm/bochs/bochs_kms.c | 23 +-- 1 file changed, 1 insertion

Re: [PATCH 08/14] drm/bochs: atomic: set DRIVER_ATOMIC

2018-12-20 Thread Oleksandr Andrushchenko
On 12/19/18 1:51 PM, Gerd Hoffmann wrote: Conversion to atomic modesetting, final step. Set the DRIVER_ATOMIC flag. Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko --- drivers/gpu/drm/bochs/bochs_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a

Re: [PATCH 09/14] drm/bochs: remove old bochs_crtc_* functions

2018-12-20 Thread Oleksandr Andrushchenko
On 12/19/18 1:51 PM, Gerd Hoffmann wrote: Remove the old, now unused crtc callbacks. Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko --- drivers/gpu/drm/bochs/bochs_kms.c | 81 --- 1 file changed, 81 deletions(-) diff --git a/drivers

Re: [PATCH 10/14] drm/bochs: drop unused gpu_addr arg from bochs_bo_pin()

2018-12-20 Thread Oleksandr Andrushchenko
On 12/19/18 1:51 PM, Gerd Hoffmann wrote: It's always NULL, so just remove it. Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko --- drivers/gpu/drm/bochs/bochs.h | 2 +- drivers/gpu/drm/bochs/bochs_fbdev.c | 2 +- drivers/gpu/drm/bochs/bochs_kms.c

Re: [PATCH 11/14] drm/bochs: add basic prime support

2018-12-20 Thread Oleksandr Andrushchenko
t *vma) +{ + struct bochs_bo *bo = gem_to_bochs_bo(obj); + + return ttm_fbdev_mmap(vma, &bo->bo); +} With the above fixed: Reviewed-by: Oleksandr Andrushchenko ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel

Re: [PATCH 12/14] drm/bochs: switch to generic drm fbdev emulation

2018-12-20 Thread Oleksandr Andrushchenko
On 12/19/18 1:51 PM, Gerd Hoffmann wrote: Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/bochs/bochs_drv.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/gpu/drm/bochs/bochs_drv.c b/drivers/gpu/drm/bochs/bochs_drv.c index a9c7140e3b..f1f65324bb 100644 --- a

Re: [PATCH 13/14] drm/bochs: drop old fbdev emulation code

2018-12-20 Thread Oleksandr Andrushchenko
On 12/19/18 1:51 PM, Gerd Hoffmann wrote: Not needed any more, bochs uses the generic emulation now. Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko --- drivers/gpu/drm/bochs/bochs.h | 9 --- drivers/gpu/drm/bochs/bochs_drv.c | 6 -- drivers/gpu/drm/bochs

Re: [PATCH 14/14] drm/bochs: move remaining fb bits to kms

2018-12-20 Thread Oleksandr Andrushchenko
On 12/19/18 1:51 PM, Gerd Hoffmann wrote: bochs_fbdev.c is almost empty now. Move the remaining framebuffer bits over to bochs_kms.c. Pure code motion. No functional change. Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko --- drivers/gpu/drm/bochs/bochs_fbdev.c | 29

Re: drm_gem_get_pages and proper flushing/coherency

2018-12-20 Thread Oleksandr Andrushchenko
community help understand the right way to flush those pages, so I don't need to use DMA for that? Thank you, Oleksandr On 11/26/18 2:15 PM, Oleksandr Andrushchenko wrote: Hello, all! My driver (Xen para-virtualized frontend) in some scenarios uses drm_gem_get_pages for allocating backing storag

Re: [PATCH] drm/xen-front: Make shmem backed display buffer coherent

2018-12-20 Thread Oleksandr Andrushchenko
On 12/20/18 5:36 PM, Christoph Hellwig wrote: On Tue, Dec 18, 2018 at 08:20:22PM +0100, Noralf Trønnes wrote: + if (!dma_map_sg(dev->dev, xen_obj->sgt->sgl, xen_obj->sgt->nents, + DMA_BIDIRECTIONAL)) { Are you using the DMA streaming API as a way to flush the caches

Re: [PATCH] drm/xen-front: Make shmem backed display buffer coherent

2018-12-21 Thread Oleksandr Andrushchenko
On 12/20/18 8:38 PM, Christoph Hellwig wrote: On Thu, Dec 20, 2018 at 07:35:15PM +0100, Daniel Vetter wrote: Err, with streaming DMA buffer sharing is trivial. The coherent DMA allocator is what causes all kinds of horrible hacks that can't actually work on various platforms. Hm, I thought the

Re: [PATCH 01/10] drm/virtio: log error responses

2018-12-21 Thread Oleksandr Andrushchenko
On 12/19/18 2:26 PM, Gerd Hoffmann wrote: If we got an error response code from the host, print it to the log. Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko --- drivers/gpu/drm/virtio/virtgpu_vq.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions

Re: [PATCH] drm/virtio: drop prime import/export callbacks

2019-01-11 Thread Oleksandr Andrushchenko
On 1/10/19 1:15 PM, Gerd Hoffmann wrote: Also set prime_handle_to_fd and prime_fd_to_handle to NULL, so drm will not advertive DRM_PRIME_CAP_{IMPORT,EXPORT} to userspace. Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko --- drivers/gpu/drm/virtio/virtgpu_drv.h | 4

Re: [PATCH v4 08/16] drm/bochs: atomic: use suspend/resume helpers

2019-01-11 Thread Oleksandr Andrushchenko
On 1/11/19 7:37 AM, Gerd Hoffmann wrote: Switch to atomic helpers: drm_mode_config_helper_suspend/resume(). Signed-off-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko --- drivers/gpu/drm/bochs/bochs_drv.c | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff

Re: [PATCH 5/9] drm/xen/xen_drm_front_gem.c: Convert to use vm_insert_range

2019-01-11 Thread Oleksandr Andrushchenko
On 1/11/19 5:10 PM, Souptick Joarder wrote: Convert to use vm_insert_range() to map range of kernel memory to user vma. Signed-off-by: Souptick Joarder Reviewed-by: Oleksandr Andrushchenko --- drivers/gpu/drm/xen/xen_drm_front_gem.c | 18 +- 1 file changed, 5 insertions

[PATCH v2] drm/xen-front: Make shmem backed display buffer coherent

2019-01-15 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko When GEM backing storage is allocated with drm_gem_get_pages the backing pages may be cached, thus making it possible that the backend sees only partial content of the buffer which may lead to screen artifacts. Make sure that the frontend's memory is coheren

Re: [PATCH] drm: Split out drm_probe_helper.h

2019-01-15 Thread Oleksandr Andrushchenko
t_conn.c | 2 +- drivers/gpu/drm/xen/xen_drm_front_gem.c | 2 +- drivers/gpu/drm/xen/xen_drm_front_kms.c | 2 +- For Xen: Acked-by: Oleksandr Andrushchenko drivers/gpu/drm/zte/zx_drm_drv.c | 2 +- drivers/gpu/drm/zte/zx_hdmi.c | 2 +-

Re: [PATCH v2] drm/xen-front: Make shmem backed display buffer coherent

2019-01-16 Thread Oleksandr Andrushchenko
On 1/16/19 8:30 AM, Gerd Hoffmann wrote: >Hi, > >> +if (!dma_map_sg(dev->dev, xen_obj->sgt->sgl, xen_obj->sgt->nents, >> +DMA_BIDIRECTIONAL)) { >> +ret = -EFAULT; >> +goto fail_free_sgt; >> +} > Hmm, so it seems the arm guys could not come up

Re: [PATCH v2] drm/xen-front: Make shmem backed display buffer coherent

2019-01-16 Thread Oleksandr Andrushchenko
On 1/16/19 8:36 AM, Christoph Hellwig wrote: > On Wed, Jan 16, 2019 at 07:30:02AM +0100, Gerd Hoffmann wrote: >>Hi, >> >>> + if (!dma_map_sg(dev->dev, xen_obj->sgt->sgl, xen_obj->sgt->nents, >>> + DMA_BIDIRECTIONAL)) { >>> + ret = -EFAULT; >>> + goto fail

Re: [PATCH v2] drm/xen-front: Make shmem backed display buffer coherent

2019-01-20 Thread Oleksandr Andrushchenko
On 1/17/19 11:18 AM, Christoph Hellwig wrote: > On Wed, Jan 16, 2019 at 06:43:29AM +0000, Oleksandr Andrushchenko wrote: >>> This whole issue keeps getting more and more confusing. >> Well, I don't really do DMA here, but instead the buffers in >> question are sha

Re: [PATCH] xen, fbfront: mark expected switch fall-through

2019-02-28 Thread Oleksandr Andrushchenko
+Xen-devel list On 2/27/19 10:53 PM, Gustavo A. R. Silva wrote: In preparation to enabling -Wimplicit-fallthrough, mark switch cases where we are expecting to fall through. This patch fixes the following warning: drivers/video/fbdev/xen-fbfront.c: In function ‘xenfb_backend_changed’: drivers/v

Re: [Xen-devel] [PATCH 38/59] drm/xen: Drop drm_gem_prime_export/import

2019-06-17 Thread Oleksandr Andrushchenko
On 6/14/19 11:35 PM, Daniel Vetter wrote: They're the default. Aside: Would be really nice to switch the others over to drm_gem_object_funcs. Signed-off-by: Daniel Vetter Cc: Oleksandr Andrushchenko Cc: xen-de...@lists.xenproject.org Reviewed-by: Oleksandr Andrushchenko --- driver

Re: [PATCH v1 02/33] drm/xen: drop use of drmP.h

2019-06-30 Thread Oleksandr Andrushchenko
On 6/30/19 9:18 AM, Sam Ravnborg wrote: The drmP.h header is deprecated. Drop all uses. Added includes/forwards to the header files and then fixed fallout in the .c files. Signed-off-by: Sam Ravnborg Cc: Oleksandr Andrushchenko Cc: xen-de...@lists.xenproject.org --- The list of cc: was too

Re: [PATCH] drm/xen: Add missing VM_DONTEXPAND flag in mmap callback

2022-06-19 Thread Oleksandr Andrushchenko
hich triggers the WARNING. > > Signed-off-by: Oleksandr Tyshchenko Reviewed-by: Oleksandr Andrushchenko > --- > This patch eliminates a WARNING which occurs during running any user space > application over drm (weston, modetest, etc) using PV Display frontend > in Xen guest (i

Re: [Xen-devel] [PATCH hmm 08/15] xen/gntdev: Use select for DMA_SHARED_BUFFER

2019-10-27 Thread Oleksandr Andrushchenko
On 10/21/19 10:12 PM, Jason Gunthorpe wrote: On Wed, Oct 16, 2019 at 06:35:15AM +, Oleksandr Andrushchenko wrote: On 10/16/19 8:11 AM, Jürgen Groß wrote: On 15.10.19 20:12, Jason Gunthorpe wrote: From: Jason Gunthorpe DMA_SHARED_BUFFER can not be enabled by the user (it represents a

Re: [PATCH 6/8] drm/xen: Simplify fb_create

2019-11-17 Thread Oleksandr Andrushchenko
s a full reference for us. > > Might as well take the real pointer ins't of complicated games that > baffle. > > Signed-off-by: Daniel Vetter > Cc: Oleksandr Andrushchenko > Cc: xen-de...@lists.xenproject.org Reviewed-by: Oleksandr Andrushchenko > --- > drivers/gpu/drm

Re: [Xen-devel] [PATCH 13/15] xen/gntdev-dmabuf: Ditch dummy map functions

2019-11-18 Thread Oleksandr Andrushchenko
On 11/18/19 12:35 PM, Daniel Vetter wrote: There's no in-kernel users for the k(un)map stuff. And the mmap one is actively harmful - return 0 and then _not_ actually mmaping can't end well. Signed-off-by: Daniel Vetter Reviewed-by: Oleksandr Andrushchenko Cc: Boris Ostrovsky C

Re: [PATCH hmm 08/15] xen/gntdev: Use select for DMA_SHARED_BUFFER

2019-10-16 Thread Oleksandr Andrushchenko
>> symbols so they are turned on implicitly when the user enables a kconfig >> that needs them. >> >> Otherwise the XEN_GNTDEV_DMABUF kconfig is overly difficult to enable. >> >> Fixes: 932d6562179e ("xen/gntdev: Add initial support for dma-buf UA

Re: [PATCH 04/52] drm: Set final_kfree in drm_dev_alloc

2020-02-19 Thread Oleksandr Andrushchenko
patch here fixes that leak. > > Same for virtio, started leaking with > > commit b1df3a2b24a917f8853d43fe9683c0e360d2c33a > Author: Gerd Hoffmann > Date: Tue Feb 11 14:58:04 2020 +0100 > > drm/virtio: add drm_driver.release callback. > > Cc: Gerd Hoffmann >

Re: [PATCH v4 15/15] drm/xen: Explicitly disable automatic sending of vblank event

2020-01-28 Thread Oleksandr Andrushchenko
On 1/27/20 1:59 PM, Thomas Zimmermann wrote: > Hi > > Am 27.01.20 um 10:53 schrieb Oleksandr Andrushchenko: >> Sorry for jumping in late >> >> On 1/23/20 11:21 AM, Thomas Zimmermann wrote: >>> The atomic helpers automatically send out fake VBLANK events if n

Re: [PATCH v4 15/15] drm/xen: Explicitly disable automatic sending of vblank event

2020-01-28 Thread Oleksandr Andrushchenko
> disable automatic vblank events explictly. > > v4: > * separate commit from core vblank changes > > Signed-off-by: Thomas Zimmermann > Acked-by: Gerd Hoffmann Reviewed-by: Oleksandr Andrushchenko > --- > drivers/gpu/drm/xen/xen_drm_front_kms.c | 13 +++

Re: [PATCH v5 15/15] drm/xen: Explicitly disable automatic sending of vblank event

2020-01-29 Thread Oleksandr Andrushchenko
blank events explicitly. > > v5: > * update comment > v4: > * separate commit from core vblank changes > > Signed-off-by: Thomas Zimmermann > Acked-by: Gerd Hoffmann > Reviewed-by: Daniel Vetter Thank you for your work, Reviewed-by: Oleksandr Andrushchenko > --- &

Re: [Xen-devel] [PATCH] drm/xen-front: Make structure fb_funcs constant

2019-08-13 Thread Oleksandr Andrushchenko
modified. Therefore make fb_funcs constant to protect it from further modification. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta Reviewed-by: Oleksandr Andrushchenko --- drivers/gpu/drm/xen/xen_drm_front_kms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a

Re: [Xen-devel] [PATCH] drm/xen-front: Make structure fb_funcs constant

2019-08-18 Thread Oleksandr Andrushchenko
On 8/14/19 8:26 PM, Daniel Vetter wrote: On Tue, Aug 13, 2019 at 10:32:00AM +0300, Oleksandr Andrushchenko wrote: On 8/13/19 9:27 AM, Nishka Dasgupta wrote: Static structure fb_funcs, of type drm_framebuffer_funcs, is used only when it is passed to drm_gem_fb_create_with_funcs() as its last

Re: [PATCH 11/11] drm/tiny: drm_gem_simple_display_pipe_prepare_fb is the default

2021-05-21 Thread Oleksandr Andrushchenko
On 5/21/21 12:09 PM, Daniel Vetter wrote: > Goes through all the drivers and deletes the default hook since it's > the default now. > > Signed-off-by: Daniel Vetter Acked-by: Oleksandr Andrushchenko

[PATCH] drm/prime: Clarify DMA-BUF/GEM Object lifetime

2017-01-26 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko From the description of the "DMA-BUF/GEM Object references and lifetime overview" it is not clear when exactly dma_buf gets destroyed and memory freed: only driver .release function mentioned which makes confusion on the real buffer's lifetime. Add m

Re: [PATCH] drm/prime: Clarify DMA-BUF/GEM Object lifetime

2017-01-26 Thread Oleksandr Andrushchenko
On 01/26/2017 12:45 PM, Chris Wilson wrote: On Thu, Jan 26, 2017 at 11:36:05AM +0100, Daniel Vetter wrote: On Thu, Jan 26, 2017 at 09:22:46AM +0200, Oleksandr Andrushchenko wrote: From: Oleksandr Andrushchenko From the description of the "DMA-BUF/GEM Object references and lif

Re: [PATCH] drm/prime: Clarify DMA-BUF/GEM Object lifetime

2017-01-26 Thread Oleksandr Andrushchenko
Thank you for comments, I will update the patch and send v1. On 01/26/2017 12:36 PM, Daniel Vetter wrote: On Thu, Jan 26, 2017 at 09:22:46AM +0200, Oleksandr Andrushchenko wrote: From: Oleksandr Andrushchenko From the description of the "DMA-BUF/GEM Object references and lifetime ove

[PATCH v1] drm/prime: Clarify DMA-BUF/GEM Object lifetime

2017-01-29 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko From the description of the "DMA-BUF/GEM Object references and lifetime overview" it is not clear when exactly dma_buf gets destroyed and memory freed: only driver .release function mentioned which makes confusion on the real buffer's lifetime. Add m

Re: [PATCH v1] drm/prime: Clarify DMA-BUF/GEM Object lifetime

2017-01-29 Thread Oleksandr Andrushchenko
On 01/27/2017 04:00 PM, Daniel Vetter wrote: On Fri, Jan 27, 2017 at 09:04:25AM +0200, Oleksandr Andrushchenko wrote: From: Oleksandr Andrushchenko From the description of the "DMA-BUF/GEM Object references and lifetime overview" it is not clear when exactly dma_buf gets destroyed

GEM allocation for para-virtualized DRM driver

2017-03-17 Thread Oleksandr Andrushchenko
Hello, I am writing a para-virtualized DRM driver for Xen hypervisor and it now works with DRM CMA helpers, but I would also like to make it work with non-contigous memory: virtual machine that the driver runs in can't guarantee that CMA is actually physically contigous (that is not a problem beca

Re: GEM allocation for para-virtualized DRM driver

2017-03-19 Thread Oleksandr Andrushchenko
On 03/18/2017 04:50 PM, Rob Clark wrote: On Sat, Mar 18, 2017 at 10:44 AM, Oleksandr Andrushchenko wrote: then TTM might be useful. I was looking into it, but it seems to be an overkill in my case And isn't it that GEM should be used for new drivers, not TTM? Not really, it's

Re: GEM allocation for para-virtualized DRM driver

2017-03-19 Thread Oleksandr Andrushchenko
On 03/18/2017 04:06 PM, Rob Clark wrote: On Sat, Mar 18, 2017 at 9:25 AM, Oleksandr Andrushchenko wrote: Hi, Rob On 03/18/2017 02:22 PM, Rob Clark wrote: On Fri, Mar 17, 2017 at 1:39 PM, Oleksandr Andrushchenko wrote: Hello, I am writing a para-virtualized DRM driver for Xen hypervisor and

Re: GEM allocation for para-virtualized DRM driver

2017-03-19 Thread Oleksandr Andrushchenko
Hi, Rob On 03/18/2017 02:22 PM, Rob Clark wrote: On Fri, Mar 17, 2017 at 1:39 PM, Oleksandr Andrushchenko wrote: Hello, I am writing a para-virtualized DRM driver for Xen hypervisor and it now works with DRM CMA helpers, but I would also like to make it work with non-contigous memory: virtual

Re: GEM allocation for para-virtualized DRM driver

2017-03-20 Thread Oleksandr Andrushchenko
On 03/20/2017 07:38 PM, Rob Clark wrote: On Mon, Mar 20, 2017 at 1:18 PM, Oleksandr Andrushchenko wrote: On 03/18/2017 02:22 PM, Rob Clark wrote: On Fri, Mar 17, 2017 at 1:39 PM, Oleksandr Andrushchenko wrote: Hello, I am writing a para-virtualized DRM driver for Xen hypervisor and it now

Re: GEM allocation for para-virtualized DRM driver

2017-03-20 Thread Oleksandr Andrushchenko
On 03/18/2017 02:22 PM, Rob Clark wrote: On Fri, Mar 17, 2017 at 1:39 PM, Oleksandr Andrushchenko wrote: Hello, I am writing a para-virtualized DRM driver for Xen hypervisor and it now works with DRM CMA helpers, but I would also like to make it work with non-contigous memory: virtual

Re: GEM allocation for para-virtualized DRM driver

2017-03-20 Thread Oleksandr Andrushchenko
On 03/20/2017 08:17 PM, Rob Clark wrote: On Mon, Mar 20, 2017 at 2:01 PM, Oleksandr Andrushchenko wrote: On 03/20/2017 07:38 PM, Rob Clark wrote: On Mon, Mar 20, 2017 at 1:18 PM, Oleksandr Andrushchenko wrote: On 03/18/2017 02:22 PM, Rob Clark wrote: On Fri, Mar 17, 2017 at 1:39 PM

Re: GEM allocation for para-virtualized DRM driver

2017-03-20 Thread Oleksandr Andrushchenko
On 03/20/2017 08:52 PM, Rob Clark wrote: On Mon, Mar 20, 2017 at 2:25 PM, Oleksandr Andrushchenko wrote: On 03/20/2017 08:17 PM, Rob Clark wrote: On Mon, Mar 20, 2017 at 2:01 PM, Oleksandr Andrushchenko wrote: On 03/20/2017 07:38 PM, Rob Clark wrote: On Mon, Mar 20, 2017 at 1:18 PM

Re: GEM allocation for para-virtualized DRM driver

2017-03-21 Thread Oleksandr Andrushchenko
On 03/20/2017 08:52 PM, Rob Clark wrote: On Mon, Mar 20, 2017 at 2:25 PM, Oleksandr Andrushchenko wrote: On 03/20/2017 08:17 PM, Rob Clark wrote: On Mon, Mar 20, 2017 at 2:01 PM, Oleksandr Andrushchenko wrote: On 03/20/2017 07:38 PM, Rob Clark wrote: On Mon, Mar 20, 2017 at 1:18 PM

Re: [bug report] drm/xen-front: Add support for Xen PV display frontend

2020-04-22 Thread Oleksandr Andrushchenko
On 4/21/20 13:45, Dan Carpenter wrote: > Hi Kernel Janitors, Hi > > Here is another idea that someone could work on, fixing the > IS_ERR_OR_NULL() checks in the xen driver. > > The patch c575b7eeb89f: "drm/xen-front: Add support for Xen PV > display frontend" from Apr 3, 2018, leads to the followin

Re: [bug report] drm/xen-front: Add support for Xen PV display frontend

2020-04-22 Thread Oleksandr Andrushchenko
On 4/21/20 14:51, Dan Carpenter wrote: > It turns out there aren't that many of these in xen. > > $ grep IS_ERR_OR_NULL drivers/gpu/drm/xen/ -Rn > drivers/gpu/drm/xen/xen_drm_front_kms.c:63: if (IS_ERR_OR_NULL(fb)) > drivers/gpu/drm/xen/xen_drm_front_gem.c:86: if (IS_ERR_OR_NULL(xen_obj)) >

Re: [bug report] drm/xen-front: Add support for Xen PV display frontend

2020-05-08 Thread Oleksandr Andrushchenko
On 4/21/20 2:51 PM, Dan Carpenter wrote: > It turns out there aren't that many of these in xen. > > $ grep IS_ERR_OR_NULL drivers/gpu/drm/xen/ -Rn > drivers/gpu/drm/xen/xen_drm_front_kms.c:63: if (IS_ERR_OR_NULL(fb)) > drivers/gpu/drm/xen/xen_drm_front_gem.c:86: if (IS_ERR_OR_NULL(xen_obj

Re: [Xen-devel] [PATCH] drm/xen: fix passing zero to 'PTR_ERR' warning

2020-03-31 Thread Oleksandr Andrushchenko
On 3/30/20 12:59, Ding Xiang wrote: Fix a static code checker warning: drivers/gpu/drm/xen/xen_drm_front.c:404 xen_drm_drv_dumb_create() warn: passing zero to 'PTR_ERR' Signed-off-by: Ding Xiang Reviewed-by: Oleksandr Andrushchenko --- drivers/gpu/drm/xen/xen_drm_f

Re: [PATCH v2 2/5] drm/xen-front: Fix misused IS_ERR_OR_NULL checks

2020-08-21 Thread Oleksandr Andrushchenko
Hi, On 8/20/20 2:56 AM, Sasha Levin wrote: > Hi > > [This is an automated email] > > This commit has been processed because it contains a "Fixes:" tag > fixing commit: c575b7eeb89f ("drm/xen-front: Add support for Xen PV display > frontend"). > > The bot has tested the following trees: v5.8.1, v5

[PATCH] drm/xen-front: Add support for EDID based configuration

2020-08-26 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko Version 2 of the Xen displif protocol adds XENDISPL_OP_GET_EDID request which allows frontends to request EDID structure per connector. This request is optional and if not supported by the backend then visible area is still defined by the relevant XenStore&#

[PATCH 5/6] drm/xen-front: Pass dumb buffer data offset to the backend

2020-07-31 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko While importing a dmabuf it is possible that the data of the buffer is put with offset which is indicated by the SGT offset. Respect the offset value and forward it to the backend. Signed-off-by: Oleksandr Andrushchenko --- drivers/gpu/drm/xen/xen_drm_front.c

[PATCH 1/6] xen/gntdev: Fix dmabuf import with non-zero sgt offset

2020-07-31 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko It is possible that the scatter-gather table during dmabuf import has non-zero offset of the data, but user-space doesn't expect that. Fix this by failing the import, so user-space doesn't access wrong data. Fixes: 37ccb44d0b00 ("xen/gntdev: Im

[PATCH 4/6] xen: Sync up with the canonical protocol definition in Xen

2020-07-31 Thread Oleksandr Andrushchenko
From: Oleksandr Andrushchenko This is the sync up with the canonical definition of the display protocol in Xen. 1. Add protocol version as an integer Version string, which is in fact an integer, is hard to handle in the code that supports different protocol versions. To simplify that also add

  1   2   3   4   5   >