[PATCH v2 10/18] drm/qxl: move qxl_primary_apply_cursor to correct place

2018-12-13 Thread Gerd Hoffmann
The cursor must be set again after creating the primary surface. Also drop the error message. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm

[PATCH v2 08/18] drm/qxl: use QXL_GEM_DOMAIN_SURFACE for shadow bo.

2018-12-13 Thread Gerd Hoffmann
The shadow bo is used as qxl surface, so allocate it as QXL_GEM_DOMAIN_SURFACE. Should usually be allocated in PRIV ttm domain then, so this reduces VRAM memory pressure. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH v2 09/18] drm/qxl: use QXL_GEM_DOMAIN_SURFACE for dumb gem objects

2018-12-13 Thread Gerd Hoffmann
dumb buffers are used as qxl surfaces, so allocate them as QXL_GEM_DOMAIN_SURFACE. Should usually be allocated in PRIV ttm domain then, so this reduces VRAM memory pressure. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_dumb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH v2 07/18] drm/qxl: allow both PRIV and VRAM placement for QXL_GEM_DOMAIN_SURFACE

2018-12-13 Thread Gerd Hoffmann
qxl surfaces (used for framebuffers and gem objects) can live in both VRAM and PRIV ttm domains. Update placement setup to include both. Put PRIV first in the list so it is preferred, so VRAM will have more room for objects which must be allocated there. Signed-off-by: Gerd Hoffmann

[PATCH v2 06/18] drm/qxl: use separate offset spaces for the two slots / ttm memory types.

2018-12-13 Thread Gerd Hoffmann
Without that ttm offsets are not unique, they can refer to objects in both VRAM and PRIV memory (aka main and surfaces slot). One of those "why things didn't blow up without this" moments. Probably offset conflicts are rare enough by pure luck. Signed-off-by: Gerd Hoffmann ---

[PATCH v2 05/18] drm/qxl: drop unused fields from struct qxl_device

2018-12-13 Thread Gerd Hoffmann
slot_id_bits and slot_gen_bits can be read directly from qxlrom instead. va_slot_mask is never used anywhere. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_drv.h | 3 --- drivers/gpu/drm/qxl/qxl_kms.c | 10 ++ 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a

[PATCH v2 03/18] drm/qxl: simplify slot management

2018-12-13 Thread Gerd Hoffmann
Drop pointless indirection, remove the mem_slots array and index variables, drop dynamic allocation. Store memslots in qxl_device instead. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_drv.h | 15 + drivers/gpu/drm/qxl/qxl_kms.c | 72

Re: [PATCH 5/7] drm/qxl: Don't set the dpms hook

2018-12-10 Thread Gerd Hoffmann
On Mon, Dec 10, 2018 at 11:03:57AM +0100, Daniel Vetter wrote: > Doesn't do anything with atomic. > > Signed-off-by: Daniel Vetter > Cc: Dave Airlie > Cc: Gerd Hoffmann > Cc: virtualization@lists.linux-foundation.org > Cc: spice-de...@lists.freedesktop.org &g

Re: [Spice-devel] [PATCH 1/3] drm/qxl: allow both PRIV and VRAM placement for QXL_GEM_DOMAIN_SURFACE

2018-12-07 Thread Gerd Hoffmann
ains. Update placement setup to include both. Put > > > > PRIV first in the list so it is preferred, so VRAM will have more room > > > > for objects which must be allocated there. > > > > > > > > Signed-off-by: Gerd Hoffmann > > > >

Re: [Spice-devel] [PATCH] drm/qxl: use qxl_num_crtc directly

2018-12-06 Thread Gerd Hoffmann
> > qdev->monitors_config->max_allowed is effectively set by a module > > parameter. So using the module parameter variable qxl_num_crtc > > directly is better IMO. The kernel doesn't need to dereference pointers > > each time it needs the value, and when reading the code you don't have > > to tr

[PATCH v2] drm/qxl: use qxl_num_crtc directly

2018-12-06 Thread Gerd Hoffmann
e, and when reading the code you don't have to trace where and why qdev->monitors_config->max_allowed is set. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 21 + 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/qxl/qx

Re: [Spice-devel] [PATCH] drm/qxl: use qxl_num_crtc directly

2018-12-06 Thread Gerd Hoffmann
On Thu, Dec 06, 2018 at 07:53:10AM -0500, Frediano Ziglio wrote: > > > > On Thu, Dec 06, 2018 at 05:59:25AM -0500, Frediano Ziglio wrote: > > > > > > > > Just use qxl_num_crtc directly everywhere instead of using > > > > qdev->monitors_config->max_allowed. Drops pointless indirection > > > > and

Re: [Spice-devel] [PATCH] drm/qxl: use qxl_num_crtc directly

2018-12-06 Thread Gerd Hoffmann
On Thu, Dec 06, 2018 at 05:59:25AM -0500, Frediano Ziglio wrote: > > > > Just use qxl_num_crtc directly everywhere instead of using > > qdev->monitors_config->max_allowed. Drops pointless indirection > > and also is less confusing. > > > > To me is MORE confusing, why comparing number of someth

Re: [Spice-devel] [PATCH 1/3] drm/qxl: allow both PRIV and VRAM placement for QXL_GEM_DOMAIN_SURFACE

2018-12-06 Thread Gerd Hoffmann
M will have more room > > for objects which must be allocated there. > > > > Signed-off-by: Gerd Hoffmann > > I remember these kind of changes in the past made migration > fails. I proposed similar patches years ago and they were rejected > for these reasons. Point

[PATCH 1/3] drm/qxl: allow both PRIV and VRAM placement for QXL_GEM_DOMAIN_SURFACE

2018-12-06 Thread Gerd Hoffmann
qxl surfaces (used for framebuffers and gem objects) can live in both VRAM and PRIV ttm domains. Update placement setup to include both. Put PRIV first in the list so it is preferred, so VRAM will have more room for objects which must be allocated there. Signed-off-by: Gerd Hoffmann

[PATCH 2/3] drm/qxl: use QXL_GEM_DOMAIN_SURFACE for shadow bo.

2018-12-06 Thread Gerd Hoffmann
The shadow bo is used as qxl surface, so allocate it as QXL_GEM_DOMAIN_SURFACE. Should usually be allocated in PRIV ttm domain then, so this reduces VRAM memory pressure. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH 3/3] drm/qxl: use QXL_GEM_DOMAIN_SURFACE for dumb gem objects

2018-12-06 Thread Gerd Hoffmann
dumb buffers are used as qxl surfaces, so allocate them as QXL_GEM_DOMAIN_SURFACE. Should usually be allocated in PRIV ttm domain then, so this reduces VRAM memory pressure. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_dumb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH] drm/qxl: use qxl_num_crtc directly

2018-12-06 Thread Gerd Hoffmann
Just use qxl_num_crtc directly everywhere instead of using qdev->monitors_config->max_allowed. Drops pointless indirection and also is less confusing. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 21 + 1 file changed, 9 insertions(+), 12 del

[PATCH 3/3] drm/virtio: drop virtio_gpu_fence_cleanup()

2018-12-05 Thread Gerd Hoffmann
Just call drm_fence_put directly instead. Also set vgfb->fence to NULL after dropping the reference. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h | 1 - drivers/gpu/drm/virtio/virtgpu_fence.c | 8 drivers/gpu/drm/virtio/virtgpu_ioctl.c | 2 +- drivers/gpu/

[PATCH 1/3] drm/virtio: log error responses

2018-12-05 Thread Gerd Hoffmann
If we got an error response code from the host, print it to the log. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_vq.c | 12 ++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_vq.c b/drivers/gpu/drm/virtio/virtgpu_vq.c

[PATCH 2/3] drm/virtio: fix pageflip flush

2018-12-05 Thread Gerd Hoffmann
Sending the flush command only makes sense if we actually have a framebuffer attached to the scanout (handle != 0). Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_plane.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/virtio

[PATCH 2/2] drm/virtio: virtio_gpu_cmd_resource_create_3d: drop unused fence arg

2018-11-28 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h | 3 +-- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 2 +- drivers/gpu/drm/virtio/virtgpu_vq.c| 5 ++--- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h b/drivers/gpu/drm

[PATCH 1/2] drm/virtio: fence: pass plain pointer

2018-11-28 Thread Gerd Hoffmann
Since commit "9fdd90c0f4 drm/virtio: add virtio_gpu_alloc_fence()" fences are not allocated any more by virtio_gpu_fence_emit(). So there is no need to pass down a reference to the fence pointer, a plain pointer is enough now. Convert virtio_gpu_fence_emit() and callers. Signed-of

[PATCH 6/6] drm/qxl: use qxl_num_crtc directly

2018-11-28 Thread Gerd Hoffmann
Skip the pointless and slightly confusing indirection via qdev->monitors_config->max_allowed. Just use qxl_num_crtc instead. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 25 +++-- 1 file changed, 11 insertions(+), 14 deletions(-) diff -

[PATCH 4/6] drm/qxl: use shadow bo directly

2018-11-28 Thread Gerd Hoffmann
the workflow in qxl_primary_atomic_update(). Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_cmd.c | 8 +++- drivers/gpu/drm/qxl/qxl_display.c | 29 - 2 files changed, 11 insertions(+), 26 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_cmd.c b/driv

[PATCH 5/6] drm/qxl: cover all crtcs in shadow bo.

2018-11-28 Thread Gerd Hoffmann
ry surface), make it big enough that dumb bo's for all crtcs fit in side-by-side. Adjust the pageflip blits to place the heads next to each other in the shadow. With this patch in place multihead qxl works with wayland. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_drv.h | 5

[PATCH 1/6] drm/qxl: move qxl_primary_apply_cursor to correct place

2018-11-28 Thread Gerd Hoffmann
The cursor must be set again after creating the primary surface. Also drop the error message. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_display.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm

[PATCH 2/6] drm/qxl: drop unused offset parameter from qxl_io_create_primary()

2018-11-28 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_drv.h | 1 - drivers/gpu/drm/qxl/qxl_cmd.c | 7 +++ drivers/gpu/drm/qxl/qxl_display.c | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_drv.h b/drivers/gpu/drm/qxl/qxl_drv.h index

[PATCH 3/6] drm/qxl: track primary bo

2018-11-28 Thread Gerd Hoffmann
Track which bo is used as primary surface. With that in place we don't need the primary_created flag any more, we can just check the primary bo pointer instead. Also verify we don't already have a primary surface in qxl_io_create_primary(). Signed-off-by: Gerd Hoffmann --- drivers/g

Re: [PATCH v4 2/2] drm/virtio: add edid support

2018-11-21 Thread Gerd Hoffmann
On Tue, Oct 30, 2018 at 10:38:04AM +0100, Daniel Vetter wrote: > On Tue, Oct 30, 2018 at 07:32:06AM +0100, Gerd Hoffmann wrote: > > linux guest driver implementation of the VIRTIO_GPU_F_EDID feature. > > > > Signed-off-by: Gerd Hoffmann > > Like with bochs, I thin

Re: [PATCH -next] drm/cirrus: Remove set but not used variable 'bo'

2018-11-21 Thread Gerd Hoffmann
On Thu, Nov 15, 2018 at 12:10:36PM +, YueHaibing wrote: > Fixes gcc '-Wunused-but-set-variable' warning: > > drivers/gpu/drm/cirrus/cirrus_fbdev.c: In function 'cirrusfb_create': > drivers/gpu/drm/cirrus/cirrus_fbdev.c:172:20: warning: > variable 'bo' set but not used [-Wunused-but-set-variab

Re: [PATCH -next] drm/qxl: remove set but not used variable 'map'

2018-11-14 Thread Gerd Hoffmann
On Sat, Nov 10, 2018 at 03:44:46AM +, YueHaibing wrote: > Fixes gcc '-Wunused-but-set-variable' warning: > > drivers/gpu/drm/qxl/qxl_object.c: In function 'qxl_bo_kunmap_atomic_page': > drivers/gpu/drm/qxl/qxl_object.c:189:21: warning: > variable 'map' set but not used [-Wunused-but-set-varia

Re: [PATCH][drm-next] drm/virtio: fix memory leak of vfpriv on error return path

2018-11-14 Thread Gerd Hoffmann
On Wed, Nov 07, 2018 at 08:31:22PM +, Colin King wrote: > From: Colin Ian King > > The allocation for vfpriv is being leaked on an error return path, > fix this by kfree'ing it before returning. > > Detected by CoverityScan, CID#1475380 ("Resource Leak") Patches added to qemu queue, should

Re: [PATCH v5 0/4] virgl: fence fd support

2018-11-14 Thread Gerd Hoffmann
On Mon, Nov 12, 2018 at 05:51:53PM +0100, Robert Foss wrote: > > This series implements fence support for drm/virtio and > has been tested using qemu, kmscube and the below branches. > > Rob Herring solved a reference counting issue and > suggested a context check for the execbuf ioctl, his > cha

Re: [PATCH v4 3/4] drm/virtio: add in/out fence support for explicit synchronization

2018-11-12 Thread Gerd Hoffmann
On Fri, Nov 09, 2018 at 06:13:52PM +0100, Robert Foss wrote: > Hey Gerd, > > On 2018-11-09 11:13, Gerd Hoffmann wrote: > > On Mon, Nov 05, 2018 at 05:25:05PM +, Emil Velikov wrote: > > > On Mon, 5 Nov 2018 at 11:42, Robert Foss > > > wrote: > > > &g

Re: [PATCH v4 3/4] drm/virtio: add in/out fence support for explicit synchronization

2018-11-09 Thread Gerd Hoffmann
On Mon, Nov 05, 2018 at 05:25:05PM +, Emil Velikov wrote: > On Mon, 5 Nov 2018 at 11:42, Robert Foss wrote: > > > > When the execbuf call receives an in-fence it will get the dma_fence > > related to that fence fd and wait on it before submitting the draw call. > > > > On the out-fence side we

[PATCH] drm/qxl: use ttm_tt

2018-11-06 Thread Gerd Hoffmann
qxl device will not dma, so we don't need ttm_dma_tt. Go use ttm_tt instead, to avoid wasting resources (swiotlb bounce buffers for example). Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_ttm.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dr

Re: [PATCH 1/5] drm/virtio: add virtio_gpu_alloc_fence()

2018-11-04 Thread Gerd Hoffmann
> > On Thu, 25 Oct 2018 at 19:38, Robert Foss wrote: > > > > > > From: Gustavo Padovan > > > > > > Refactor fence creation to remove the potential allocation failure from > > > the cmd_submit and atomic_commit paths. Now the fence should be allocated > > > first and just after we should proceed

Re: [PATCH 2/5] drm/virtio: add uapi for in and out explicit fences

2018-10-30 Thread Gerd Hoffmann
On Tue, Oct 30, 2018 at 11:31:04AM +, Emil Velikov wrote: > HI Gerd, > > On Tue, 30 Oct 2018 at 06:11, Gerd Hoffmann wrote: > > > > Hi, > > > > > The execbuffer IOCTL is now read-write to allow the userspace to read the > > > out-fence. &g

Re: virtio-gpu without ARCH_HAS_SG_CHAIN

2018-10-30 Thread Gerd Hoffmann
On Mon, Oct 29, 2018 at 12:46:34PM -0700, Michael Forney wrote: > Hi, > > I was looking at adding virtio-gpu support to tinyemu > (https://bellard.org/tinyemu/). I got it to work on x86, but just for > fun I tried it under riscv and ran into an issue with buffer > allocations (though, this should

[PATCH v4 1/2] virtio-gpu: add VIRTIO_GPU_F_EDID feature

2018-10-29 Thread Gerd Hoffmann
. Signed-off-by: Gerd Hoffmann Reviewed-by: Dave Airlie --- include/uapi/linux/virtio_gpu.h | 18 ++ 1 file changed, 18 insertions(+) diff --git a/include/uapi/linux/virtio_gpu.h b/include/uapi/linux/virtio_gpu.h index f43c3c6171..8e88eba1fa 100644 --- a/include/uapi/linux

[PATCH v4 2/2] drm/virtio: add edid support

2018-10-29 Thread Gerd Hoffmann
linux guest driver implementation of the VIRTIO_GPU_F_EDID feature. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h | 3 ++ drivers/gpu/drm/virtio/virtgpu_display.c | 12 ++ drivers/gpu/drm/virtio/virtgpu_drv.c | 1 + drivers/gpu/drm/virtio/virtgpu_kms.c

Re: [PATCH 0/6] drm/qxl: Remove checkpatch issues

2018-10-29 Thread Gerd Hoffmann
On Fri, Oct 26, 2018 at 04:20:30PM -0300, Shayenne da Luz Moura wrote: > This series cleans the following checkpatch.pl issues: > > ERROR: trailing whitespace > WARNING: Missing a blank line after declarations > CHECK: Please don't use multiple blank lines > WARNING: Prefer 'unsigned int' to bare

Re: [PATCH 2/5] drm/virtio: add uapi for in and out explicit fences

2018-10-29 Thread Gerd Hoffmann
Hi, > The execbuffer IOCTL is now read-write to allow the userspace to read the > out-fence. > #define DRM_IOCTL_VIRTGPU_EXECBUFFER \ > - DRM_IOW(DRM_COMMAND_BASE + DRM_VIRTGPU_EXECBUFFER,\ > + DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_EXECBUFFER,\ > struct drm_virtgpu_exec

Re: [PATCH] gpu/drm/virtio/virtgpu_vq.c: Use kmem_cache_zalloc

2018-10-29 Thread Gerd Hoffmann
On Tue, Oct 23, 2018 at 12:50:36PM +0300, Jani Nikula wrote: > On Tue, 23 Oct 2018, Souptick Joarder wrote: > > On Fri, Oct 19, 2018 at 9:30 PM Sabyasachi Gupta > > wrote: > >> > >> Replaced kmem_cache_alloc + memset with kmem_cache_zalloc > > > > Put a new line gap in between these two lines and

Re: [PATCH 0/4] Improve virtio ID allocation

2018-10-29 Thread Gerd Hoffmann
On Wed, Sep 26, 2018 at 09:00:27AM -0700, Matthew Wilcox wrote: > I noticed you were using IDRs where you could be using the more efficient > IDAs, then while fixing that I noticed the lack of error handling, > and I decided to follow that up with an efficiency improvement. > > There's probably a

[PATCH v4] drm/bochs: add edid support.

2018-10-29 Thread Gerd Hoffmann
Recent qemu (latest master branch, upcoming 3.1 release) got support for EDID data. This patch adds guest driver support. EDID support in qemu is not (yet) enabled by default, so please use 'qemu -device VGA,edid=on' for testing. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/boc

Re: [PATCH v3] drm/bochs: add edid support.

2018-10-29 Thread Gerd Hoffmann
On Mon, Oct 29, 2018 at 07:44:28PM +0200, Jani Nikula wrote: > On Mon, 29 Oct 2018, Gerd Hoffmann wrote: > > Recent qemu (latest master branch, upcoming 3.1 release) got support > > for EDID data. This patch adds guest driver support. > > > > EDID support in qemu is n

[PATCH v3] drm/bochs: add edid support.

2018-10-29 Thread Gerd Hoffmann
Recent qemu (latest master branch, upcoming 3.1 release) got support for EDID data. This patch adds guest driver support. EDID support in qemu is not (yet) enabled by default, so please use 'qemu -device VGA,edid=on' for testing. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/boc

[PATCH v2 1/6] drm/virtio: track created object state

2018-10-18 Thread Gerd Hoffmann
object state. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h| 3 +++ drivers/gpu/drm/virtio/virtgpu_fb.c | 2 +- drivers/gpu/drm/virtio/virtgpu_gem.c| 3 ++- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 4 ++-- drivers/gpu/drm/virtio/virtgpu_object.c | 2 +- drivers

[PATCH v2 5/6] drm/virtio: drop resource_id argument.

2018-10-18 Thread Gerd Hoffmann
We pass the obj anyway, so obj->hw_res_handle can be used instead in virtio_gpu_object_attach() and virtio_gpu_cmd_create_resource(). Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h | 2 -- drivers/gpu/drm/virtio/virtgpu_fb.c| 4 ++-- drivers/gpu/drm/vir

[PATCH v2 3/6] drm/virtio: use virtio_gpu_object->hw_res_handle in virtio_gpu_mode_dumb_create()

2018-10-18 Thread Gerd Hoffmann
Drop pointless resid variable in virtio_gpu_mode_dumb_create(), just use the hw_res_handle field in virtio_gpu_object directly. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_gem.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm

[PATCH v2 6/6] drm/virtio: fix resource id handling

2018-10-18 Thread Gerd Hoffmann
think some error paths too. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h| 3 --- drivers/gpu/drm/virtio/virtgpu_fb.c | 1 - drivers/gpu/drm/virtio/virtgpu_gem.c| 1 - drivers/gpu/drm/virtio/virtgpu_ioctl.c | 1 - drivers/gpu/drm/virtio/virtgpu_object.c | 23

[PATCH v2 4/6] drm/virtio: use virtio_gpu_object->hw_res_handle in virtio_gpu_resource_create_ioctl()

2018-10-18 Thread Gerd Hoffmann
Drop pointless res_id variable in virtio_gpu_resource_create_ioctl(), just use the hw_res_handle field in virtio_gpu_object directly. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 24 1 file changed, 8 insertions(+), 16 deletions(-) diff

[PATCH v2 2/6] drm/virtio: use virtio_gpu_object->hw_res_handle in virtio_gpufb_create()

2018-10-18 Thread Gerd Hoffmann
Drop pointless resid variable in virtio_gpufb_create(), just use the hw_res_handle field in virtio_gpu_object directly. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_fb.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/virtio

Re: [PATCH 7/8] drm/virtio: move virtio_gpu_object_{attach, detach} calls.

2018-10-18 Thread Gerd Hoffmann
> > > This to me feels more like a bind/unbind operation rather than a > > > populate/unpopulate operation, > > > > > > bind is " Bind the backend pages into the aperture in the location" > > > > > > whereas populate is > > > > > > allocate pages for a ttm. > > > > I ran into that trap too ;) > > >

[PATCH v3] virtio-gpu: add VIRTIO_GPU_F_EDID feature

2018-10-17 Thread Gerd Hoffmann
. Signed-off-by: Gerd Hoffmann Reviewed-by: Dave Airlie --- include/uapi/linux/virtio_gpu.h | 16 1 file changed, 16 insertions(+) diff --git a/include/uapi/linux/virtio_gpu.h b/include/uapi/linux/virtio_gpu.h index f43c3c6171..68198691a6 100644 --- a/include/uapi/linux/virtio_gpu.h

Re: [PATCH 7/8] drm/virtio: move virtio_gpu_object_{attach, detach} calls.

2018-10-17 Thread Gerd Hoffmann
On Thu, Oct 18, 2018 at 11:41:52AM +1000, Dave Airlie wrote: > On Mon, 1 Oct 2018 at 20:33, Gerd Hoffmann wrote: > > > > Remove the virtio_gpu_object_{attach,detach} calls from move_notify() > > callback. Add them to the ttm_tt_{populate,unpopulate} callbacks, which > &

Re: [PATCH 5/8] drm/virtio: track created object state

2018-10-17 Thread Gerd Hoffmann
On Thu, Oct 18, 2018 at 11:25:22AM +1000, Dave Airlie wrote: > On Mon, 1 Oct 2018 at 20:33, Gerd Hoffmann wrote: > > > > Track whenever the virtio_gpu_object is already created (i.e. host knows > > about it) in a new variable. Add checks to virtio_gpu_object_attach() > &g

Re: [PATCH v2] drm/bochs: add edid support.

2018-10-17 Thread Gerd Hoffmann
Hi, > > Recent qemu (latest master branch, upcoming 3.1 release) got support > > for EDID data. This patch adds guest driver support. > > > > EDID support in qemu is not (yet) enabled by default, so please use > > 'qemu -device VGA,edid=on' for testing. > > The EDID never changes after boot?

Re: [PATCH v2] virtio-gpu: add VIRTIO_GPU_F_EDID feature

2018-10-05 Thread Gerd Hoffmann
Hi, > >>> +/* VIRTIO_GPU_RESP_OK_EDID */ > >>> +struct virtio_gpu_resp_edid { > >>> + struct virtio_gpu_ctrl_hdr hdr; > >>> + __le32 scanout; > >>> + __le32 size; > >>> + __u8 edid[1024]; > >> > >> Wouldn’t it be enough to stick to EDID 2.0 (256 bytes)? > >> > >> If not, maybe add comment to e

[PATCH v2] virtio-gpu: add VIRTIO_GPU_F_EDID feature

2018-10-05 Thread Gerd Hoffmann
. Signed-off-by: Gerd Hoffmann --- include/uapi/linux/virtio_gpu.h | 17 + 1 file changed, 17 insertions(+) diff --git a/include/uapi/linux/virtio_gpu.h b/include/uapi/linux/virtio_gpu.h index f43c3c6171..1cef1ff339 100644 --- a/include/uapi/linux/virtio_gpu.h +++ b/include/uapi/linux

[PATCH v2] drm/bochs: add edid support.

2018-10-05 Thread Gerd Hoffmann
Recent qemu (latest master branch, upcoming 3.1 release) got support for EDID data. This patch adds guest driver support. EDID support in qemu is not (yet) enabled by default, so please use 'qemu -device VGA,edid=on' for testing. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/boc

Re: [PATCH 4/4] drm/virtio: Use IDAs more efficiently

2018-10-02 Thread Gerd Hoffmann
On Wed, Sep 26, 2018 at 09:04:55AM -0700, Matthew Wilcox wrote: > On Wed, Sep 26, 2018 at 09:00:31AM -0700, Matthew Wilcox wrote: > > @@ -59,6 +59,7 @@ static int virtio_gpu_context_create(struct > > virtio_gpu_device *vgdev, > > > > if (handle < 0) > > return handle; > > + han

[PATCH v3 2/2] drm/bochs: add edid support.

2018-10-02 Thread Gerd Hoffmann
Recent qemu (latest master branch, upcoming 3.1 release) got support for EDID data. This patch adds guest driver support. EDID support in qemu is not (yet) enabled by default, so please use 'qemu -device VGA,edid=on' for testing. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/boc

[PATCH v2 2/2] drm/bochs: add edid support.

2018-10-01 Thread Gerd Hoffmann
Recent qemu (latest master branch, upcoming 3.1 release) got support for EDID data. This patch adds guest driver support. EDID support in qemu is not (yet) enabled by default, so please use 'qemu -device VGA,edid=on' for testing. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/boc

Re: [PATCH 0/3] virtio: add vmap support for prime objects

2018-09-25 Thread Gerd Hoffmann
Hi, > Having the support for vmapping dmabuf's is required to share > dmabufs to drivers that want CPU access. This is the case of > a vivid to virtio-gpu pipeline, where the virtio-gpu driver > exports dmabufs to the video4linux vivid driver. > > The first patch adds virtio_gpu_object_kunmap()

Re: [virtio-dev] [PATCH 2/2] drm/virtio: add iommu support.

2018-09-19 Thread Gerd Hoffmann
Hi, > void virtio_gpu_cmd_transfer_to_host_2d(struct virtio_gpu_device *vgdev, > uint32_t resource_id, uint64_t offset, > ... > struct virtio_gpu_fbdev *vgfbdev = vgdev->vgfbdev; > struct virtio_gpu_framebuffer *fb = &vgfbdev->vgfb; > struct

[PATCH] drm/virtio: pass virtio_gpu_object to virtio_gpu_cmd_transfer_to_host_{2d, 3d}

2018-09-19 Thread Gerd Hoffmann
Pass virtio_gpu_object down to virtio_gpu_cmd_transfer_to_host_2d and virtio_gpu_cmd_transfer_to_host_3d functions, instead of passing just the virtio resource handle. This is needed to lookup the scatter list of the object, for dma sync. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio

Re: [virtio-dev] [PATCH 2/2] drm/virtio: add iommu support.

2018-09-19 Thread Gerd Hoffmann
> >> Once display manger is kicked off for example (sudo systemctl start > >> lightdm.service) and > >> resource id 3 gets created from user space down, it still gives a blank > >> black screen. > > > > Hmm. I'd suspect there is simply a code path missing. Can you send the > > patch you have?

[PATCH v3 3/5] drm/bochs: fix DRM_FORMAT_* handling for big endian machines.

2018-09-19 Thread Gerd Hoffmann
tly in the bochs-drm.ko driver on big endian machines. Without the patch only ADDFB (which still seems to be used by the majority of userspace) works correctly. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/bochs/bochs_fbdev.c | 17 + drivers/gpu/drm/bochs/bochs_km

[PATCH v3 5/5] drm/virtio: fix DRM_FORMAT_* handling

2018-09-19 Thread Gerd Hoffmann
ADDFB and ADDFB2 ioctls work correctly in the virtio-gpu.ko driver on big endian machines. Without the patch only ADDFB (which still seems to be used by the majority of userspace) works correctly. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_display.c | 5 +++ drivers/gpu/

[PATCH v3 4/5] drm/bochs: support changing byteorder at mode set time

2018-09-19 Thread Gerd Hoffmann
Add bochs_hw_set_*_endian() helper functions, to set the framebuffer byteorder at mode set time. Support both DRM_FORMAT_XRGB and DRM_FORMAT_BGRX framebuffer formats, no matter what the native machine byte order is. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/bochs/bochs.h

Re: [virtio-dev] [PATCH 2/2] drm/virtio: add iommu support.

2018-09-18 Thread Gerd Hoffmann
Hi, > buffer. I tried to put a dma_sync_sg_for_device() on virtio_gpu_object > obj->pages-sgl > before VIRTIO_GPU_CMD_TRANSFER_TO_HOST_2D is sent. This fixes the kernel > console path. That should be the right place. > Once display manger is kicked off for example (sudo systemctl start >

[PATCH 2/3] virtio-gpu: add VIRTIO_GPU_F_EDID feature

2018-09-13 Thread Gerd Hoffmann
. Signed-off-by: Gerd Hoffmann --- include/uapi/linux/virtio_gpu.h | 17 + 1 file changed, 17 insertions(+) diff --git a/include/uapi/linux/virtio_gpu.h b/include/uapi/linux/virtio_gpu.h index f43c3c6171..7267c3d2d6 100644 --- a/include/uapi/linux/virtio_gpu.h +++ b/include/uapi/linux

[PATCH 3/3] drm/virtio: add edid support

2018-09-13 Thread Gerd Hoffmann
linux guest driver implementation of the VIRTIO_GPU_F_EDID feature. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h | 3 ++ drivers/gpu/drm/virtio/virtgpu_display.c | 6 drivers/gpu/drm/virtio/virtgpu_drv.c | 1 + drivers/gpu/drm/virtio/virtgpu_kms.c

Re: [virtio-dev] [PATCH 2/2] drm/virtio: add iommu support.

2018-09-12 Thread Gerd Hoffmann
Hi, > I attempted to fix it in the ttm layer and here is the discussion > https://lore.kernel.org/lkml/b44280d7-eb13-0996-71f5-3fbdeb466...@amd.com/ > > The ttm maintainer Christian is suggesting to map and set ttm->pages as > decrypted > right after ttm->pages are allocated. > > Just checkin

Re: [PATCH] qxl: refactor to use drm_fb_helper_fbdev_setup

2018-09-12 Thread Gerd Hoffmann
On Mon, Sep 10, 2018 at 03:21:56PM +0200, Peter Wu wrote: > Lots of code can be removed by relying on fb-helper: > - "struct drm_framebuffer" moves to fb_helper.fb. > - "struct drm_gem_object" moves to fb_helper.obj[0]. > - "struct qxl_device" can be inferred as drm_fb_helper is embedded. > - qxl_u

Re: [RFC 0/4] Virtio uses DMA API for all devices

2018-09-10 Thread Gerd Hoffmann
> > this to set the VIRTIO_F_IOMMU_PLATFORM flag. But for example > > QEMU has the use of iommu_platform attribute disabled for virtio-gpu > > device. So would also like to move towards not having to specify > > the VIRTIO_F_IOMMU_PLATFORM flag. > > Specifying VIRTIO_F_IOMMU_PLATFORM is the right

Re: [PATCH -next] drm/virtio: Remove set but not used variable 'bo'

2018-09-07 Thread Gerd Hoffmann
On Fri, Sep 07, 2018 at 02:03:57AM +, YueHaibing wrote: > Fixes gcc '-Wunused-but-set-variable' warning: > > drivers/gpu/drm/virtio/virtgpu_display.c: In function > 'virtio_gpu_framebuffer_init': > drivers/gpu/drm/virtio/virtgpu_display.c:78:28: warning: > variable 'bo' set but not used [-Wu

Re: [PATCH] bochs: convert to drm_fb_helper_fbdev_setup/teardown

2018-09-06 Thread Gerd Hoffmann
Hi, > > You can probably get rid of this one if you're refactoring even more. The > > generic fb_probe implementation (already merged) plus gem-shmem support > > for it (still in flight) from Noralf should be able to pull that off. That > > gives you the fb_mmap implementation, but with 100% gen

[PATCH v2 6/6] drm/virtio: fix DRM_FORMAT_* handling

2018-09-04 Thread Gerd Hoffmann
ADDFB and ADDFB2 ioctls work correctly in the virtio-gpu.ko driver on big endian machines. Without the patch only ADDFB (which still seems to be used by the majority of userspace) works correctly. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_display.c | 5 +++ drivers/gpu/

[PATCH v2 5/6] drm/bochs: fix DRM_FORMAT_* handling for big endian machines.

2018-09-04 Thread Gerd Hoffmann
userspace) works correctly. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/bochs/bochs_fbdev.c | 5 ++--- drivers/gpu/drm/bochs/bochs_kms.c | 34 +- drivers/gpu/drm/bochs/bochs_mm.c| 2 +- 3 files changed, 36 insertions(+), 5 deletions(-) diff --git a

[PATCH 5/5] drm/virtio: fix DRM_FORMAT_* handling

2018-09-03 Thread Gerd Hoffmann
ADDFB and ADDFB2 ioctls work correctly in the virtio-gpu.ko driver on big endian machines. Without the patch only ADDFB (which still seems to be used by the majority of userspace) works correctly. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_display.c | 4 +++ drivers/gpu/

[PATCH 4/5] drm/bochs: fix DRM_FORMAT_* handling for big endian machines.

2018-09-03 Thread Gerd Hoffmann
userspace) works correctly. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/bochs/bochs_drv.c | 3 ++- drivers/gpu/drm/bochs/bochs_fbdev.c | 5 ++--- drivers/gpu/drm/bochs/bochs_kms.c | 33 - drivers/gpu/drm/bochs/bochs_mm.c| 2 +- 4 files changed, 37

Re: [PATCH] drm/bochs: Replace ttm_bo_unref with ttm_bo_put

2018-08-30 Thread Gerd Hoffmann
On Thu, Aug 30, 2018 at 08:14:02AM +0200, Thomas Zimmermann wrote: > Hi Gerd > > Am 09.08.2018 um 17:27 schrieb Gerd Hoffmann: > >> diff --git a/drivers/gpu/drm/bochs/bochs_mm.c > >> b/drivers/gpu/drm/bochs/bochs_mm.c > >> index 39cd08416773..c9c7097030ca 100

[PATCH 2/2] drm/virtio: add iommu support.

2018-08-29 Thread Gerd Hoffmann
Use the dma mapping api and properly add iommu mappings for objects, unless virtio is in iommu quirk mode. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h | 1 + drivers/gpu/drm/virtio/virtgpu_vq.c | 46 +--- 2 files changed, 38 insertions

[PATCH 1/2] drm/virtio: add virtio_gpu_object_detach() function

2018-08-29 Thread Gerd Hoffmann
The new function balances virtio_gpu_object_attach(). Also make virtio_gpu_cmd_resource_inval_backing() static and switch call sites to the new virtio_gpu_object_attach() function. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h | 4 ++-- drivers/gpu/drm/virtio

[PATCH] drm/virtio: track virtual output state

2018-08-13 Thread Gerd Hoffmann
Track whenever an virtual output (crtc) is enabled or disabled. On atomic updates check for both framebuffer being present and crtc being enabled to figure whenever the output is active or not. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_drv.h | 1 + drivers/gpu/drm

Re: [PATCH] drm: qxl: Fix error handling at qxl_device_init

2018-08-09 Thread Gerd Hoffmann
On Fri, Jul 27, 2018 at 02:54:40PM +0300, Anton Vasilyev wrote: > If qxl_device_init fails on creating resources and does not report it, > then qxl module will catch null pointer exception on remove, or on > probe's error path. > > The patch adds error path with resources release into qxl_device_i

Re: [PATCH] drm/cirrus: Use drm_framebuffer_put to avoid kernel oops in clean-up

2018-08-09 Thread Gerd Hoffmann
On Fri, Jul 20, 2018 at 01:27:43PM +0200, Thomas Zimmermann wrote: > In the Cirrus driver, the regular clean-up code also performs the clean-up > of a failed initialization. If the fbdev's framebuffer was not initialized, > the clean-up will fail within drm_framebuffer_unregister_private. Booting >

Re: [PATCH] drm/qxl: Replace ttm_bo_unref with ttm_bo_put

2018-08-09 Thread Gerd Hoffmann
> diff --git a/drivers/gpu/drm/qxl/qxl_gem.c b/drivers/gpu/drm/qxl/qxl_gem.c > index f5c1e7872e92..89606c819d82 100644 > --- a/drivers/gpu/drm/qxl/qxl_gem.c > +++ b/drivers/gpu/drm/qxl/qxl_gem.c > @@ -40,7 +40,7 @@ void qxl_gem_object_free(struct drm_gem_object *gobj) > qxl_surface_evict(qdev

Re: [PATCH] drm/cirrus: Replace ttm_bo_unref with ttm_bo_put

2018-08-09 Thread Gerd Hoffmann
> Signed-off-by: Thomas Zimmermann > --- > drivers/gpu/drm/cirrus/cirrus_main.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/cirrus/cirrus_main.c > b/drivers/gpu/drm/cirrus/cirrus_main.c > index 60d54e10a34d..57f8fe6d020b 100644 > --- a/drivers/gpu/dr

Re: [PATCH] drm/bochs: Replace ttm_bo_unref with ttm_bo_put

2018-08-09 Thread Gerd Hoffmann
> diff --git a/drivers/gpu/drm/bochs/bochs_mm.c > b/drivers/gpu/drm/bochs/bochs_mm.c > index 39cd08416773..c9c7097030ca 100644 > --- a/drivers/gpu/drm/bochs/bochs_mm.c > +++ b/drivers/gpu/drm/bochs/bochs_mm.c > @@ -430,7 +430,7 @@ static void bochs_bo_unref(struct bochs_bo **bo) > re

[PATCH v3] drm/cirrus: flip default from 24bpp to 16bpp

2018-08-08 Thread Gerd Hoffmann
32bpp would limit the resolution to 800x600 due to hardware constrains. So lets go with 16bpp. Also use the default depth for the framebuffer console and mode_info->preferred_depth. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/cirrus/cirrus_drv.c | 4 ++-- drivers/gpu/drm/cirrus/cirrus

[PATCH v2] drm/cirrus: flip default from 24bpp to 16bpp

2018-08-08 Thread Gerd Hoffmann
32bpp would limit the resolution to 800x600 due to hardware constrains. So lets go with 16bpp. Also use the default depth for the framebuffer console. Signed-off-by: Gerd Hoffmann --- drivers/gpu/drm/cirrus/cirrus_drv.c | 4 ++-- drivers/gpu/drm/cirrus/cirrus_fbdev.c | 3 +-- 2 files chang

Re: [PATCH] drm/cirrus: flip default to 32bpp

2018-08-08 Thread Gerd Hoffmann
On Mon, Jul 09, 2018 at 09:39:24AM +0200, Daniel Vetter wrote: > On Fri, Jul 06, 2018 at 02:35:07PM -0400, Adam Jackson wrote: > > On Fri, 2018-07-06 at 11:12 +0200, Gerd Hoffmann wrote: > > > cirrus can handle 1024x768 (and slightly higher) with 24bpp depth. > > > cirr

[PATCH] drm/cirrus: flip default to 32bpp

2018-07-06 Thread Gerd Hoffmann
doesn't support it at all. Bugs in Xorg keep showing up. So using 32bpp by default is the better choice IMO, even if it comes with the drawback that the resolution is 800x600 only. But hey, better a working 800x600 display than a broken 1024x768 display ... Signed-off-by: Gerd Hof

Re: [PATCH] gpu: drm: virito: code cleanup

2018-07-02 Thread Gerd Hoffmann
On Mon, Jul 02, 2018 at 11:57:28PM +0530, Souptick Joarder wrote: > The fault handler code is commented since v4.2. > If there is no plan to enable the fault handler > code in future, we can remove this dead code. Indeed, but please without tyops in the $subject line. cheers, Gerd

Re: [PATCH] drm/qxl: Call qxl_bo_unref outside atomic context

2018-06-04 Thread Gerd Hoffmann
On Fri, Jun 01, 2018 at 04:05:32PM -0400, Jeremy Cline wrote: > "qxl_bo_unref" may sleep, but calling "qxl_release_map" causes > "preempt_disable()" to be called and "preempt_enable()" isn't called > until "qxl_release_unmap" is used. Move the call to "qxl_bo_unref" out > from in between the two to

<    4   5   6   7   8   9   10   11   12   >