Re: [PATCH] drm/virtgpu: Replace dev_private by helper function

2023-06-21 Thread Gerd Hoffmann
on will help with a later removal. No functional changes. > > Signed-off-by: Thomas Zimmermann Acked-by: Gerd Hoffmann ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH v5 09/44] drm: handle HAS_IOPORT dependencies

2023-05-22 Thread Gerd Hoffmann
Hi, > > There is also a direct and hard coded use in cirrus.c which according to > > the comment is only necessary during resume. Let's just skip this as > > for example s390 which doesn't have I/O port support also doesen't > > support suspend/resume. > > I think we should consider making

Re: [PATCH v6 0/3] Add sync object UAPI support to VirtIO-GPU driver

2023-05-03 Thread Gerd Hoffmann
Can't spot any issues, but I also don't follow drm close enough to be able to review the sync object logic in detail. Acked-by: Gerd Hoffmann take care, Gerd ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH vhost v6 08/11] virtio_ring: introduce virtqueue_dma_dev()

2023-04-11 Thread Gerd Hoffmann
On Tue, Apr 11, 2023 at 12:54:46PM +0800, Jason Wang wrote: > On Tue, Apr 11, 2023 at 12:10 PM Christoph Hellwig wrote: > > > > On Tue, Apr 11, 2023 at 11:56:47AM +0800, Jason Wang wrote: > > > > The DMA device for virtio_pci is the underlying PCI device, always. > > > > !VIRTIO_F_ACCESS_PLATFORM

Re: [PATCH] drm/virtio: Enable fb damage clips property for the primary plane

2023-03-13 Thread Gerd Hoffmann
t; Don't enable it for the cursor plane, because its .atomic_update callback > doesn't handle damage clips. > > Reported-by: Christian Hergert > Signed-off-by: Javier Martinez Canillas Acked-by: Gerd Hoffmann ___ Virtualization mailing list

Re: [PATCH v2] drm/virtio: Fix handling CONFIG_DRM_VIRTIO_GPU_KMS option

2023-03-06 Thread Gerd Hoffmann
"has_edid" under the "num_scanouts" condition, like was > suggested by Gerd Hoffmann. Acked-by: Gerd Hoffmann ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH v1] drm/virtio: Fix handling CONFIG_DRM_VIRTIO_GPU_KMS option

2023-03-05 Thread Gerd Hoffmann
> +++ b/drivers/gpu/drm/virtio/virtgpu_kms.c > @@ -45,9 +45,11 @@ static void virtio_gpu_config_changed_work_func(struct > work_struct *work) > if (events_read & VIRTIO_GPU_EVENT_DISPLAY) { > if (vgdev->has_edid) > virtio_gpu_cmd_get_edids(vgdev); > -

Re: [PATCH v6] drm/virtio: Add option to disable KMS support

2023-03-02 Thread Gerd Hoffmann
-out of > it's init/fini fxns instead Reviewed-by: Gerd Hoffmann ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH v5] drm/virtio: Add option to disable KMS support

2023-03-01 Thread Gerd Hoffmann
On Thu, Mar 02, 2023 at 12:39:33AM +0300, Dmitry Osipenko wrote: > On 3/1/23 21:54, Rob Clark wrote: > > /* virtgpu_display.c */ > > +#if defined(CONFIG_DRM_VIRTIO_GPU_KMS) > > int virtio_gpu_modeset_init(struct virtio_gpu_device *vgdev); > > void virtio_gpu_modeset_fini(struct

Re: [PATCH v5] drm/virtio: Add option to disable KMS support

2023-03-01 Thread Gerd Hoffmann
Hi, > + if (vgdev->num_scanouts) { > + ret = virtio_gpu_modeset_init(vgdev); The call to virtio_gpu_modeset_fini() in the unregister code path needs this too. Otherwise the patch looks good to me, so with that fixed: Acked-by: Gerd Hoffmann take car

Re: [PATCH v4] drm/virtio: Add option to disable KMS support

2023-02-28 Thread Gerd Hoffmann
On Wed, Mar 01, 2023 at 03:37:24AM +0300, Dmitry Osipenko wrote: > On 2/28/23 18:54, Rob Clark wrote: > > From: Rob Clark > > > > Add a build option to disable modesetting support. This is useful in > > cases where the guest only needs to use the GPU in a headless mode, or > > (such as in the

Re: [PATCH v3] drm/virtio: Add option to disable KMS support

2023-02-28 Thread Gerd Hoffmann
Hi, > + if (!vgdev->num_scanouts) { > + /* > + * Having an EDID but no scanouts is non-sensical, > + * but it is permitted to have no scanouts and no > + * EDID (in which case DRIVER_MODESET and > +

Re: [PATCH] drm/virtio: Add option to disable KMS support

2023-02-27 Thread Gerd Hoffmann
On Mon, Feb 27, 2023 at 07:40:11AM -0800, Rob Clark wrote: > On Sun, Feb 26, 2023 at 10:38 PM Gerd Hoffmann wrote: > > > > On Fri, Feb 24, 2023 at 10:02:24AM -0800, Rob Clark wrote: > > > From: Rob Clark > > > > > > Add a build option to di

Re: [PATCH] drm/virtio: Add option to disable KMS support

2023-02-26 Thread Gerd Hoffmann
On Fri, Feb 24, 2023 at 10:02:24AM -0800, Rob Clark wrote: > From: Rob Clark > > Add a build option to disable modesetting support. This is useful in > cases where the guest only needs to use the GPU in a headless mode, or > (such as in the CrOS usage) window surfaces are proxied to a host >

Re: [PATCH 17/17] drm/cirrus: Use VGA macro constants to unblank

2023-02-20 Thread Gerd Hoffmann
On Mon, Feb 20, 2023 at 03:22:03PM +0100, Thomas Zimmermann wrote: > Hi > > Am 16.02.23 um 12:33 schrieb Gerd Hoffmann: > > On Wed, Feb 15, 2023 at 05:15:17PM +0100, Thomas Zimmermann wrote: > > > Set the VGA bit for unblanking with macro constants instead of magic >

Re: [PATCH 17/17] drm/cirrus: Use VGA macro constants to unblank

2023-02-16 Thread Gerd Hoffmann
On Thu, Feb 16, 2023 at 02:52:51PM +0200, Ville Syrjälä wrote: > On Thu, Feb 16, 2023 at 01:03:02PM +0100, Thomas Zimmermann wrote: > > Hi, > > > > thanks for taking a look at the patches. > > > > Am 16.02.23 um 12:33 schrieb Gerd Hoffmann: > > > On Wed

Re: [PATCH 17/17] drm/cirrus: Use VGA macro constants to unblank

2023-02-16 Thread Gerd Hoffmann
On Thu, Feb 16, 2023 at 01:03:02PM +0100, Thomas Zimmermann wrote: > Hi, > > thanks for taking a look at the patches. > > Am 16.02.23 um 12:33 schrieb Gerd Hoffmann: > > On Wed, Feb 15, 2023 at 05:15:17PM +0100, Thomas Zimmermann wrote: > > > Set the VGA bit for u

Re: [PATCH 17/17] drm/cirrus: Use VGA macro constants to unblank

2023-02-16 Thread Gerd Hoffmann
On Wed, Feb 15, 2023 at 05:15:17PM +0100, Thomas Zimmermann wrote: > Set the VGA bit for unblanking with macro constants instead of magic > values. No functional changes. blank/unblank should work simliar to bochs (see commit 250e743915d4), that is maybe a nice thing to add of you modernize the

Re: [PATCH v10 00/11] Add generic memory shrinker to VirtIO-GPU and Panfrost DRM drivers

2023-01-27 Thread Gerd Hoffmann
that are making minor fixes, > > for consistency. > > Do you have comments on this version? Otherwise ack will be appreciated. > Thanks in advance! Don't feel like signing off on the locking changes, I'm not that familiar with the drm locking rules. So someone else lo

Re: [PATCH v10 06/11] drm/shmem-helper: Don't use vmap_use_count for dma-bufs

2023-01-27 Thread Gerd Hoffmann
On Thu, Jan 26, 2023 at 03:24:30PM +0300, Dmitry Osipenko wrote: > On 1/26/23 15:17, Gerd Hoffmann wrote: > > On Mon, Jan 09, 2023 at 12:04:40AM +0300, Dmitry Osipenko wrote: > >> its own refcounting of vmaps, use it instead of drm-shmem > >> counting. This change prep

Re: [PATCH v10 10/11] drm/virtio: Support memory shrinking

2023-01-27 Thread Gerd Hoffmann
marked BOs on > OOM, the shrinker will also evict unpurgeable shmem BOs from memory if > guest supports SWAP file or partition. > > Signed-off-by: Daniel Almeida > Signed-off-by: Dmitry Osipenko Acked-by: Gerd Hoffmann ___ Virtuali

Re: [PATCH v10 06/11] drm/shmem-helper: Don't use vmap_use_count for dma-bufs

2023-01-26 Thread Gerd Hoffmann
On Mon, Jan 09, 2023 at 12:04:40AM +0300, Dmitry Osipenko wrote: > its own refcounting of vmaps, use it instead of drm-shmem > counting. This change prepares drm-shmem for addition of memory shrinker > support where drm-shmem will use a single dma-buf reservation lock for > all operations

Re: [PATCH v10 05/11] drm/shmem: Switch to use drm_* debug helpers

2023-01-26 Thread Gerd Hoffmann
On Mon, Jan 09, 2023 at 12:04:39AM +0300, Dmitry Osipenko wrote: > f a multi-GPU system by using drm_WARN_*() and > drm_dbg_kms() helpers that print out DRM device name corresponding > to shmem GEM. That commit message looks truncated ... take care, Gerd

Re: [PATCH] drm/qxl: fix the suspend/resume issue on qxl device

2022-09-07 Thread Gerd Hoffmann
On Wed, Sep 07, 2022 at 05:44:23PM +0800, Zongmin Zhou wrote: > > From: Zongmin Zhou > > Details: > Currently, when trying to suspend and resume with qxl device, > there are some error messages after resuming, > eventually caused to black screen and can't be recovered. [ analysis snipped ] >

Re: [PATCH] drm/virtio: set fb_modifiers_not_supported

2022-09-07 Thread Gerd Hoffmann
On Wed, Aug 31, 2022 at 12:06:01PM -0700, Chia-I Wu wrote: > Without this, the drm core advertises LINEAR modifier which is > incorrect. > > Also userspace virgl does not support modifiers. For example, it causes > chrome on ozone/drm to fail with "Failed to create scanout buffer". > > Fixes:

[PATCH] drm/bochs: fix blanking

2022-09-06 Thread Gerd Hoffmann
versions (edk2 fix is on the way too). Doesn't happen in BIOS mode because in that case the vgabios already flips the bit. Fixes: 250e743915d4 ("drm/bochs: Add screen blanking support") Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/tiny/bochs.c | 2 ++ 1 file changed, 2 insertions(+)

Re: [PATCH] drm/virtio: Fix same-context optimization

2022-08-25 Thread Gerd Hoffmann
On Fri, Aug 12, 2022 at 03:40:00PM -0700, Rob Clark wrote: > From: Rob Clark > > When VIRTGPU_EXECBUF_RING_IDX is used, we should be considering the > timeline that the EB if running on rather than the global driver fence > context. > > Fixes: 85c83ea915ed ("drm/virtio: implement context init:

Re: [PATCH v7 7/9] drm/virtio: Improve DMA API usage for shmem BOs

2022-07-19 Thread Gerd Hoffmann
On Wed, Jul 06, 2022 at 10:22:52AM +0300, Dmitry Osipenko wrote: > On 7/6/22 10:13, Gerd Hoffmann wrote: > > Hi, > > > >> Gerd, thank you very much! It's was indeed unclear to me how to test the > >> MMIO GPU, but yours variant with microvm works! I wa

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

2022-07-12 Thread Gerd Hoffmann
n > Cc: David Airlie > Cc: Gerd Hoffmann > Cc: Gurchetan Singh > Cc: Chia-I Wu > Cc: Daniel Vetter > Cc: virtualization@lists.linux-foundation.org Reviewed-by: Gerd Hoffmann ___ Virtualization mailing list Virtuali

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

2022-07-12 Thread Gerd Hoffmann
in > Cc: Dave Airlie > Cc: Gerd Hoffmann > Cc: Daniel Vetter > Cc: virtualization@lists.linux-foundation.org > Cc: spice-de...@lists.freedesktop.org Reviewed-by: Gerd Hoffmann ___ Virtualization mailing list Virtualizat

Re: [PATCH v7 7/9] drm/virtio: Improve DMA API usage for shmem BOs

2022-07-06 Thread Gerd Hoffmann
Hi, > Gerd, thank you very much! It's was indeed unclear to me how to test the > MMIO GPU, but yours variant with microvm works! I was looking for trying > aarch64 in the past, but it also was unclear how to do it since there is > no DT support for the VirtIO-GPU, AFAICS. aarch64 uses acpi by

Re: [PATCH v7 7/9] drm/virtio: Improve DMA API usage for shmem BOs

2022-07-05 Thread Gerd Hoffmann
Hi, > > Also note that pci is not the only virtio transport we have. > > The VirtIO indeed has other transports, but only PCI is really supported > in case of the VirtIO-GPU in kernel and in Qemu/crosvm, AFAICT. Hence > only the PCI transport was tested. qemu -M microvm \ -global

Re: [PATCH v7 7/9] drm/virtio: Improve DMA API usage for shmem BOs

2022-07-05 Thread Gerd Hoffmann
Hi, > - * So for the moment keep things as-is, with a bulky comment > - * for the next person who feels like removing this > - * drm_dev_set_unique() quirk. Dragons lurking here. It's not the first attempt to ditch this, and so far all have been rolled back due to regressions.

Re: 回复: Re: 回复: Re: 回复: Re: 回复: Re: [PATCH v1 1/2] drm/qxl: replace ioremap by ioremap_cache on arm64

2022-03-24 Thread Gerd Hoffmann
On Thu, Mar 24, 2022 at 06:34:02PM +0800, liuco...@kylinos.cn wrote: >ok, thanks, a lot of our customer use qxl on x86 before, so it still need >to supoort qxl on arm64. Well, qxl isn't the best choice even on x86. The main advantage it offers (2d acceleration) is basically useless today

Re: 回复: Re: 回复: Re: 回复: Re: [PATCH v1 1/2] drm/qxl: replace ioremap by ioremap_cache on arm64

2022-03-24 Thread Gerd Hoffmann
On Thu, Mar 24, 2022 at 10:20:40AM +0100, Christian König wrote: > Hi Cong, > > when I understand Robin correctly all mapping (host, guest, kernel, > userspace etc..) must have the same caching attributes unless you use the > S2FWB feature introduced with Armv8.4. > > If you don't follow those

Re: [PATCH v1 1/2] drm/qxl: replace ioremap by ioremap_cache on arm64

2022-03-23 Thread Gerd Hoffmann
On Wed, Mar 23, 2022 at 09:45:13AM +, Robin Murphy wrote: > On 2022-03-23 07:15, Christian König wrote: > > Am 22.03.22 um 10:34 schrieb Cong Liu: > > > qxl use ioremap to map ram_header and rom, in the arm64 implementation, > > > the device is mapped as DEVICE_nGnRE, it can not support

Re: [PATCH] drm/virtio: Ensure that objs is not NULL in virtio_gpu_array_put_free()

2022-01-17 Thread Gerd Hoffmann
On Mon, Dec 13, 2021 at 07:31:22PM +0100, Roberto Sassu wrote: > If virtio_gpu_object_shmem_init() fails (e.g. due to fault injection, as it > happened in the bug report by syzbot), virtio_gpu_array_put_free() could be > called with objs equal to NULL. > > Ensure that objs is not NULL in

Re: [RFC 26/32] drm: handle HAS_IOPORT dependencies

2022-01-02 Thread Gerd Hoffmann
On Mon, Dec 27, 2021 at 05:43:11PM +0100, Niklas Schnelle wrote: > In a future patch HAS_IOPORT=n will result in inb()/outb() and friends > not being declared. We thus need to add HAS_IOPORT as dependency for > those drivers using them. There is also a direct and hard coded use in > cirrus.c which

Re: [PATCH v3 03/10] drm/bochs: Replace module-init boiler-plate code with DRM helpers

2021-12-22 Thread Gerd Hoffmann
On Wed, Dec 22, 2021 at 09:28:24AM +0100, Javier Martinez Canillas wrote: > -static int __init bochs_init(void) > -{ > - if (drm_firmware_drivers_only() && bochs_modeset == -1) > - return -EINVAL; Also cleanup bochs_modeset? I guess its not used any more after this patch ...

Re: [RFC] hypercall-vsock: add a new vsock transport

2021-11-25 Thread Gerd Hoffmann
On Thu, Nov 25, 2021 at 08:43:55AM +, Wang, Wei W wrote: > On Thursday, November 25, 2021 2:38 PM, Jason Wang wrote: > > > We thought about virtio-mmio. There are some barriers: > > > 1) It wasn't originally intended for x86 machines. The only machine > > > type in QEMU that supports it (to

Re: Kvm virtual machine uses virtio graphics card, the rotating screen is stuck

2021-11-23 Thread Gerd Hoffmann
On Tue, Nov 23, 2021 at 03:49:28PM +0800, Jason Wang wrote: > On Tue, Nov 23, 2021 at 3:00 PM 苟浩 wrote: > > > > Hello, > > > > I use `xrandr -o left` to rotate the screen in the kvm virtual machine. > > When configured as a Virtio graphics card, the screen will freeze after > > rotating the

Re: [PATCH] drm/virtio: delay pinning the pages till first use

2021-11-03 Thread Gerd Hoffmann
On Tue, Nov 02, 2021 at 08:58:55AM -0700, Chia-I Wu wrote: > On Tue, Nov 2, 2021 at 6:07 AM Gerd Hoffmann wrote: > > > > On Tue, Nov 02, 2021 at 12:31:39PM +0100, Maksym Wezdecki wrote: > > > From: mwezdeck > > > > > > The idea behind the c

Re: [PATCH] drm/virtio: delay pinning the pages till first use

2021-11-02 Thread Gerd Hoffmann
On Tue, Nov 02, 2021 at 12:31:39PM +0100, Maksym Wezdecki wrote: > From: mwezdeck > > The idea behind the commit: > 1. not pin the pages during resource_create ioctl > 2. pin the pages on the first use during: > - transfer_*_host ioctl > - map ioctl i.e. basically lazy

Re: drm/virtio: not pin pages on demand

2021-10-27 Thread Gerd Hoffmann
so scripts/get_maintainer.pl will Cc you on patches submitted. thanks, Gerd > > Maksym > > > On 10/22/21 10:44 AM, Maksym Wezdecki wrote: > > > Once again with all lists and receivers. I'm sorry for that. > > > > On 10/21/21 6:42 PM, Chia-I Wu wrote: > &

Re: drm/virtio: not pin pages on demand

2021-10-21 Thread Gerd Hoffmann
On Thu, Oct 21, 2021 at 11:55:47AM +0200, Maksym Wezdecki wrote: > I get your point. However, we need to make resource_create ioctl, > in order to create corresponding resource on the host. That used to be the case but isn't true any more with the new blob resources. virglrenderer allows to

Re: drm/virtio: not pin pages on demand

2021-10-21 Thread Gerd Hoffmann
On Thu, Oct 21, 2021 at 09:44:45AM +0200, Maksym Wezdecki wrote: > From: mwezdeck > > The idea behind the commit: > 1. when resource is created, let user space decide > if resource should be pinned or not > 2. transfer_*_host needs pinned memory. If it is not > pinned, then pin it.

Re: [PATCH] drm/virtio: fix the missed drm_gem_object_put() in virtio_gpu_user_framebuffer_create()

2021-10-11 Thread Gerd Hoffmann
On Sat, Oct 09, 2021 at 05:09:20PM +0800, Jing Xiangfeng wrote: > virtio_gpu_user_framebuffer_create() misses to call drm_gem_object_put() > in an error path. Add the missed function call to fix it. Pushed to drm-misc-next. thanks, Gerd ___

Re: [PATCH 2/2] drm/qxl: Add qxl dma fence release function

2021-09-15 Thread Gerd Hoffmann
On Tue, Sep 14, 2021 at 02:23:52AM -0400, bibo mao wrote: > Add qxl dma fence release function, previously default dma fence > release function is used, and fence pointer is used to free > the memory. With this patch, actual qxl release pointer is used > to free memory, so that dma fence can put

Re: [PATCH 1/2] drm/qxl: User page size macro for qxl release bo

2021-09-15 Thread Gerd Hoffmann
On Tue, Sep 14, 2021 at 02:23:51AM -0400, bibo mao wrote: > Some architectures have different default page size, this patch > replaces hardcoded 4096 with PAGE_SIZE macro, since cmd bo size > is page aligned. > > Signed-off-by: bibo mao Pushed to drm-misc-next. thanks, Gerd

Re: [PATCH] drm/bochs: add Bochs PCI ID for Simics model

2021-09-15 Thread Gerd Hoffmann
On Thu, Sep 09, 2021 at 06:06:55PM -0700, H. Peter Anvin (Intel) wrote: > Current (and older) Simics models for the Bochs VGA used the wrong PCI > vendor ID (0x4321 instead of 0x1234). Although this can hopefully be > fixed in the future, it is a problem for users of the current version, > not

Re: [PATCH] drm/qxl: Remove empty qxl_gem_prime_mmap()

2021-06-24 Thread Gerd Hoffmann
m_prime_mmap in qxl and remove qxl_gem_prime_mmap(). Reviewed-by: Gerd Hoffmann ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [PATCH] drm: qxl: ensure surf.data is ininitialized

2021-06-09 Thread Gerd Hoffmann
On Tue, Jun 08, 2021 at 05:13:13PM +0100, Colin King wrote: > From: Colin Ian King > > The object surf is not fully initialized and the uninitialized > field surf.data is being copied by the call to qxl_bo_create > via the call to qxl_gem_object_create. Set surf.data to zero > to ensure garbage

Re: [PATCH 1/3] drm/virtio: Fixes a potential NULL pointer dereference on probe failure

2021-05-18 Thread Gerd Hoffmann
On Mon, May 17, 2021 at 04:49:11PM +0800, Xie Yongji wrote: > The dev->dev_private might not be allocated if virtio_gpu_pci_quirk() > or virtio_gpu_init() failed. In this case, we should avoid the cleanup > in virtio_gpu_release(). Pushed all three to drm-misc-next. thanks, Gerd

[PATCH 2/2] drm/qxl: balance dumb_shadow_bo pin

2021-05-11 Thread Gerd Hoffmann
The shadow bo is created in pinned state, so we have to unpin it when dropping the reference. Otherwise ttm is unhappy and throws a WARN() on release. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/qxl

[PATCH 1/2] drm/qxl: drop redundant code

2021-05-11 Thread Gerd Hoffmann
Not needed, qxl_io_destroy_primary() does that for us. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c index a7637e79cb42

Re: [PATCH v2] drm/bochs: Add screen blanking support

2021-04-27 Thread Gerd Hoffmann
> > I'm fine to change in any better way, of course, so feel free to > > modify the patch. > > If no one objects, I'll merge it as-is. It's somewhat wrong wrt to VGA, but > apparently what qemu wants. No objections. Acked-by: Gerd Hoffmann FYI: cirrus is in the same situa

Re: [PATCH] drm/bochs: Add screen blanking support

2021-04-21 Thread Gerd Hoffmann
> > However, a tricky part is that the QEMU vga code does treat VGA_ATT_IW > > register always as "flip-flop"; the first write is for index and the > > second write is for the data like palette. Meanwhile, in the current > > bochs DRM driver, the flip-flop wasn't considered, and it calls only > >

Re: [PATCH v4 0/9] drm: Support simple-framebuffer devices and firmware fbs

2021-04-20 Thread Gerd Hoffmann
Hi, > > > Patches 4 to 8 add the simpledrm driver. It's build on simple DRM helpers > > > and SHMEM. It supports 16-bit, 24-bit and 32-bit RGB framebuffers. During > > > > if support for 8-bit frame buffers would be added? > > Is that 8-bit greyscale or 8-bit indexed with 256 entry

Re: [PATCH] qxl: Fix uninitialised struct field head.surface_id

2021-03-05 Thread Gerd Hoffmann
On Thu, Mar 04, 2021 at 09:49:28AM +, Colin King wrote: > From: Colin Ian King > > The surface_id struct field in head is not being initialized and > static analysis warns that this is being passed through to > dev->monitors_config->heads[i] on an assignment. Clear up this > warning by

Re: [PATCH v2 10/11] drm/qxl: rework cursor plane

2021-02-18 Thread Gerd Hoffmann
Hi, > > Well. I suspect I could easily spend a month cleaning up and party > > redesign the qxl driver (specifically qxl_draw.c + qxl_image.c). > > > > I'm not sure I'll find the time to actually do that anytime soon. > > I have plenty of other stuff on my TODO list, and given that the > >

Re: [PATCH v2 10/11] drm/qxl: rework cursor plane

2021-02-18 Thread Gerd Hoffmann
Hi, > I'm still trying to wrap my head around the qxl cursor code. > > Getting vmap out of the commit tail is good, but I feel like this isn't > going in the right direction overall. > > In ast, these helper functions were only good when converting the drvier to > atomic modesetting. So I

[PATCH v2 10/11] drm/qxl: rework cursor plane

2021-02-17 Thread Gerd Hoffmann
Add helper functions to create and move the cursor. Create the cursor_bo in prepare_fb callback, in the atomic_commit callback we only send the update command to the host. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 248 -- 1 file changed

[PATCH v2 08/11] drm/qxl: fix monitors object vmap

2021-02-17 Thread Gerd Hoffmann
Use the correct vmap variant. We don't hold a reservation here, so we can't use the _locked variant. We can drop the pin because qxl_bo_vmap will do that for us. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions

[PATCH v2 06/11] drm/qxl: add qxl_bo_vmap/qxl_bo_vunmap

2021-02-17 Thread Gerd Hoffmann
Add vmap/vunmap variants which reserve (and pin) the bo. They can be used in case the caller doesn't hold a reservation for the bo. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_object.h | 2 ++ drivers/gpu/drm/qxl/qxl_object.c | 36 2 files changed

[PATCH v2 09/11] drm/qxl: move shadow handling to new qxl_prepare_shadow()

2021-02-17 Thread Gerd Hoffmann
Pure code motion, no functional change. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 61 +-- 1 file changed, 34 insertions(+), 27 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c index

[PATCH v2 07/11] drm/qxl: fix prime vmap

2021-02-17 Thread Gerd Hoffmann
Use the correct vmap variant. We don't have a reservation here, so we can't use the _locked version. Signed-off-by: Gerd Hoffmann Acked-by: Thomas Zimmermann --- drivers/gpu/drm/qxl/qxl_prime.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/qxl

[PATCH v2 11/11] drm/qxl: add lock asserts to qxl_bo_vmap_locked + qxl_bo_vunmap_locked

2021-02-17 Thread Gerd Hoffmann
Try avoid re-introducing locking bugs. Signed-off-by: Gerd Hoffmann Acked-by: Thomas Zimmermann --- drivers/gpu/drm/qxl/qxl_object.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/qxl/qxl_object.c b/drivers/gpu/drm/qxl/qxl_object.c index 82c3bf195ad6..6e26d70f2f07

[PATCH v2 05/11] drm/qxl: rename qxl_bo_kmap -> qxl_bo_vmap_locked

2021-02-17 Thread Gerd Hoffmann
Append _locked to Make clear that these functions should be called with reserved bo's only. While being at it also rename kmap -> vmap. No functional change. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_object.h | 4 ++-- drivers/gpu/drm/qxl/qxl_display.c |

[PATCH v2 03/11] drm/qxl: use ttm bo priorities

2021-02-17 Thread Gerd Hoffmann
() picks something which can't be evicted and throws an error after waiting a while without success. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_object.h | 1 + drivers/gpu/drm/qxl/qxl_cmd.c | 2 +- drivers/gpu/drm/qxl/qxl_display.c | 4 ++-- drivers/gpu/drm/qxl/qxl_gem.c | 2

[PATCH v2 01/11] drm/qxl: properly handle device init failures

2021-02-17 Thread Gerd Hoffmann
Specifically do not try release resources which where not allocated in the first place. Cc: Tong Zhang Tested-by: Tong Zhang Signed-off-by: Gerd Hoffmann Acked-by: Thomas Zimmermann --- drivers/gpu/drm/qxl/qxl_display.c | 3 +++ drivers/gpu/drm/qxl/qxl_kms.c | 4 2 files changed, 7

[PATCH v2 04/11] drm/qxl: fix lockdep issue in qxl_alloc_release_reserved

2021-02-17 Thread Gerd Hoffmann
Call qxl_bo_unpin (which does a reservation) without holding the release_mutex lock. Fixes lockdep (correctly) warning on a possible deadlock. Fixes: 65ffea3c6e73 ("drm/qxl: unpin release objects") Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_release.c | 13 ++-

[PATCH v2 02/11] drm/qxl: more fence wait rework

2021-02-17 Thread Gerd Hoffmann
Move qxl_io_notify_oom() call into wait condition. That way the driver will call it again if one call wasn't enough. Also allows to remove the extra dma_fence_is_signaled() check and the goto. Fixes: 5a838e5d5825 ("drm/qxl: simplify qxl_fence_wait") Signed-off-by: Gerd Hoffmann --- d

Re: [PATCH 09/10] drm/qxl: map/unmap framebuffers in prepare_fb+cleanup_fb callbacks.

2021-02-17 Thread Gerd Hoffmann
On Tue, Feb 16, 2021 at 02:46:21PM +0100, Thomas Zimmermann wrote: > > > Am 16.02.21 um 14:27 schrieb Thomas Zimmermann: > > Hi > > > > this is a shadow-buffered plane. Did you consider using the new helpers > > for shadow-buffered planes? They will map the user BO for you and > > provide the

[PATCH 09/10] drm/qxl: map/unmap framebuffers in prepare_fb+cleanup_fb callbacks.

2021-02-16 Thread Gerd Hoffmann
We don't have to map in atomic_update callback then, making locking a bit less complicated. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm

[PATCH 03/10] drm/qxl: use ttm bo priorities

2021-02-16 Thread Gerd Hoffmann
() picks something which can't be evicted and throws an error after waiting a while without success. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_object.h | 1 + drivers/gpu/drm/qxl/qxl_cmd.c | 2 +- drivers/gpu/drm/qxl/qxl_display.c | 4 ++-- drivers/gpu/drm/qxl/qxl_gem.c | 2

[PATCH 06/10] drm/qxl: add qxl_bo_kmap/qxl_bo_kunmap

2021-02-16 Thread Gerd Hoffmann
Add kmap/kunmap variants which reserve (and pin) the bo. They can be used in case the caller doesn't hold a reservation for the bo. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_object.h | 2 ++ drivers/gpu/drm/qxl/qxl_object.c | 36 2 files changed

[PATCH 08/10] drm/qxl: fix monitors object kmap

2021-02-16 Thread Gerd Hoffmann
Use the correct kmap variant. We don't hold a reservation here, so we can't use the _locked variant. We can drop the pin because qxl_bo_kmap will do that for us. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions

[PATCH 05/10] drm/qxl: rename qxl_bo_kmap -> qxl_bo_kmap_locked

2021-02-16 Thread Gerd Hoffmann
Make clear that these functions should be called with reserved bo's only. No functional change. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_object.h | 4 ++-- drivers/gpu/drm/qxl/qxl_display.c | 14 +++--- drivers/gpu/drm/qxl/qxl_draw.c| 8 drivers/gpu/drm

[PATCH 10/10] drm/qxl: add lock asserts to qxl_bo_kmap_locked + qxl_bo_kunmap_locked

2021-02-16 Thread Gerd Hoffmann
Try avoid re-introducing locking bugs. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_object.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/qxl/qxl_object.c b/drivers/gpu/drm/qxl/qxl_object.c index 22748b9566af..90d5e5b7f927 100644 --- a/drivers/gpu/drm/qxl

[PATCH 07/10] drm/qxl: fix prime kmap

2021-02-16 Thread Gerd Hoffmann
Use the correct kmap variant. We don't have a reservation here, so we can't use the _locked version. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_prime.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_prime.c b/drivers/gpu/drm/qxl

[PATCH 01/10] drm/qxl: properly handle device init failures

2021-02-16 Thread Gerd Hoffmann
Specifically do not try release resources which where not allocated in the first place. Cc: Tong Zhang Tested-by: Tong Zhang Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 3 +++ drivers/gpu/drm/qxl/qxl_kms.c | 4 2 files changed, 7 insertions(+) diff --git

[PATCH 04/10] drm/qxl: fix lockdep issue in qxl_alloc_release_reserved

2021-02-16 Thread Gerd Hoffmann
Call qxl_bo_unpin (which does a reservation) without holding the release_mutex lock. Fixes lockdep (correctly) warning on a possible deadlock. Fixes: 65ffea3c6e73 ("drm/qxl: unpin release objects") Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_release.c | 13 ++-

[PATCH 02/10] drm/qxl: more fence wait rework

2021-02-16 Thread Gerd Hoffmann
Move qxl_io_notify_oom() call into wait condition. That way the driver will call it again if one call wasn't enough. Also allows to remove the extra dma_fence_is_signaled() check and the goto. Fixes: 5a838e5d5825 ("drm/qxl: simplify qxl_fence_wait") Signed-off-by: Gerd Hoffmann --- d

Re: [RFC v3 2/3] virtio: Introduce Vdmabuf driver

2021-02-12 Thread Gerd Hoffmann
On Fri, Feb 12, 2021 at 08:15:12AM +, Kasireddy, Vivek wrote: > Hi Gerd, > > > > > You don't have to use the rendering pipeline. You can let the i915 > > > > gpu render into a dma-buf shared with virtio-gpu, then use > > > > virtio-gpu only for buffer sharing with the host. > [Kasireddy,

Re: [RFC v3 2/3] virtio: Introduce Vdmabuf driver

2021-02-12 Thread Gerd Hoffmann
Hi, > This is because of the fundamental concept of DMA-buf that the exporter > needs to setup mappings (both CPU page tables as well as stuff like IOMMU). > When the guest exports something it would mean that you give the guest > control over the IOMMU and/or host page tables. And that is not

Re: [RFC v3 2/3] virtio: Introduce Vdmabuf driver

2021-02-10 Thread Gerd Hoffmann
> > You don't have to use the rendering pipeline. You can let the i915 gpu > > render into a dma-buf shared with virtio-gpu, then use virtio-gpu only for > > buffer sharing with the host. > [Kasireddy, Vivek] Is this the most viable path forward? I am not sure how > complex or > feasible it

Re: [PATCH] drm/qxl: properly handle device init failures

2021-02-09 Thread Gerd Hoffmann
On Mon, Feb 08, 2021 at 12:07:01PM -0500, Tong Zhang wrote: > Does this patch fix an issue raised previously? Or should they be used > together? > https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg2466541.html > > IMHO using this patch alone won’t fix the issue This patch on top of

Re: [PATCH 0/6] drm: Move vmap out of commit tail for SHMEM-based drivers

2021-02-08 Thread Gerd Hoffmann
On Sun, Feb 07, 2021 at 07:33:24PM +0100, Thomas Zimmermann wrote: > Hi > > Am 05.02.21 um 10:05 schrieb Gerd Hoffmann: > >Hi, > > > > > I smoke-tested the code by running fbdev, Xorg and weston with the > > > converted mgag200 driver. > > &g

[PATCH] drm/qxl: properly handle device init failures

2021-02-08 Thread Gerd Hoffmann
Specifically do not try release resources which where not allocated in the first place. Cc: Tong Zhang Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 3 +++ drivers/gpu/drm/qxl/qxl_kms.c | 4 2 files changed, 7 insertions(+) diff --git a/drivers/gpu/drm/qxl

Re: [RFC v3 2/3] virtio: Introduce Vdmabuf driver

2021-02-07 Thread Gerd Hoffmann
Hi, > > +/* extract pages referenced by sgt */ > > +static struct page **extr_pgs(struct sg_table *sgt, int *nents, int > > *last_len) > > Nack, this doesn't work on dma-buf. And it'll blow up at runtime when you > enable the very recently merged CONFIG_DMABUF_DEBUG (would be good to test >

Re: [PATCH 0/6] drm: Move vmap out of commit tail for SHMEM-based drivers

2021-02-05 Thread Gerd Hoffmann
Hi, > I smoke-tested the code by running fbdev, Xorg and weston with the > converted mgag200 driver. Looks sane to me. Survived cirrus smoke test too. Tested-by: Gerd Hoffmann Acked-by: Gerd Hoffmann take care, Gerd ___ Virtualization m

Re: [PATCH v2] drm/qxl: do not run release if qxl failed to init

2021-02-04 Thread Gerd Hoffmann
On Thu, Feb 04, 2021 at 11:30:50AM -0500, Tong Zhang wrote: > if qxl_device_init() fail, drm device will not be registered, > in this case, do not run qxl_drm_release() How do you trigger this? take care, Gerd ___ Virtualization mailing list

[PATCH v6 06/10] drm/qxl: properly pin/unpin shadow

2021-02-04 Thread Gerd Hoffmann
Suggested-by: Thomas Zimmermann Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c index 60331e31861a..d25fd3acc891 100644 --- a/drivers/gpu/drm/qxl

[PATCH v6 05/10] drm/qxl: release shadow on shutdown

2021-02-04 Thread Gerd Hoffmann
In case we have a shadow surface on shutdown release it so it doesn't leak. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c index 38d6b596094d

[PATCH v6 09/10] drm/qxl: simplify qxl_fence_wait

2021-02-04 Thread Gerd Hoffmann
Now that we have the new release_event wait queue we can just use that in qxl_fence_wait() and simplify the code alot. Signed-off-by: Gerd Hoffmann Acked-by: Thomas Zimmermann --- drivers/gpu/drm/qxl/qxl_release.c | 44 +++ 1 file changed, 4 insertions(+), 40

[PATCH v6 08/10] drm/qxl: properly free qxl releases

2021-02-04 Thread Gerd Hoffmann
Reorganize qxl_device_fini() a bit. Add missing unpin() calls. Count releases. Add wait queue for releases. That way qxl_device_fini() can easily wait until everything is ready for proper shutdown. Signed-off-by: Gerd Hoffmann Acked-by: Thomas Zimmermann --- drivers/gpu/drm/qxl/qxl_drv.h

[PATCH v6 03/10] drm/qxl: use drmm_mode_config_init

2021-02-04 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann Reviewed-by: Daniel Vetter Acked-by: Thomas Zimmermann --- drivers/gpu/drm/qxl/qxl_display.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c index 012bce0cdb65

[PATCH v6 10/10] drm/qxl: allocate dumb buffers in ram

2021-02-04 Thread Gerd Hoffmann
dumb buffers are shadowed anyway, so there is no need to store them in device memory. Use QXL_GEM_DOMAIN_CPU (TTM_PL_SYSTEM) instead. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_dumb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/qxl

[PATCH v6 07/10] drm/qxl: handle shadow in primary destroy

2021-02-04 Thread Gerd Hoffmann
qxl_primary_atomic_disable must check whenever the framebuffer bo has a shadow surface and in case it has check the shadow primary status. Signed-off-by: Gerd Hoffmann Acked-by: Thomas Zimmermann --- drivers/gpu/drm/qxl/qxl_display.c | 2 ++ 1 file changed, 2 insertions(+) diff --git

[PATCH v6 04/10] drm/qxl: unpin release objects

2021-02-04 Thread Gerd Hoffmann
Balances the qxl_create_bo(..., pinned=true, ...); call in qxl_release_bo_alloc(). Signed-off-by: Gerd Hoffmann Acked-by: Thomas Zimmermann --- drivers/gpu/drm/qxl/qxl_release.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/qxl/qxl_release.c b/drivers/gpu/drm/qxl

  1   2   3   4   5   6   7   8   9   10   >