Re: [PATCH] Add virtio gpu driver.

2015-03-25 Thread Gerd Hoffmann
Hi, diff --git a/drivers/virtio/virtio_pci_common.c b/drivers/virtio/virtio_pci_common.c index e894eb2..a3167fa 100644 --- a/drivers/virtio/virtio_pci_common.c +++ b/drivers/virtio/virtio_pci_common.c @@ -510,7 +510,7 @@ static int virtio_pci_probe(struct pci_dev *pci_dev,

Re: [PATCH] Add virtio gpu driver.

2015-03-25 Thread Gerd Hoffmann
Hi, BTW can we teach virtio-gpu to look for framebuffer using virtio pci caps? The virtio-gpu driver doesn't matter much here, it doesn't use it anyway. Or are there limitations such as only using IO port BARs, or compatibility with BIOS code etc that limit us to specific BARs anyway?

Re: [PATCH] Add virtio gpu driver.

2015-03-25 Thread Gerd Hoffmann
Signed-off-by: Dave Airlie airl...@redhat.com Signed-off-by: Gerd Hoffmann kra...@redhat.com Standard request from my side for new drm drivers (especially if they're this simple): Can you please update the drivers to latest drm internal interfaces, i.e. using universal planes and atomic

Re: [PATCH] Add virtio gpu driver.

2015-03-25 Thread Gerd Hoffmann
On Di, 2015-03-24 at 22:50 +, Daniel Stone wrote: Hi, On 24 March 2015 at 16:07, Gerd Hoffmann kra...@redhat.com wrote: +static int virtio_gpu_crtc_page_flip(struct drm_crtc *crtc, +struct drm_framebuffer *fb

Re: [virtio-dev] Re: [PATCH] Add virtio gpu driver.

2015-03-26 Thread Gerd Hoffmann
Hi, And is it possible to use offset within BAR and/or memory BARs? If yes I'd strongly prefer this. What is the point? Do you want place virtio regions and vga framebuffer in the same pci bar? Why? virtio is mmio and traps into qemu on access, whereas the vga framebuffer is memory-backed

[PATCH v5] Add virtio-input driver.

2015-03-26 Thread Gerd Hoffmann
virtio-input is basically evdev-events-over-virtio, so this driver isn't much more than reading configuration from config space and forwarding incoming events to the linux input layer. Signed-off-by: Gerd Hoffmann kra...@redhat.com --- MAINTAINERS | 6 + drivers/virtio

Re: [virtio-dev] Re: [PATCH] Add virtio gpu driver.

2015-03-26 Thread Gerd Hoffmann
Hi, Absolutely, it's pretty common to mix regions in a BAR. For example, we have virtio kick (ioeventfd backed, handled in kernel) in same BAR as common and device specific configuration. We did the same thing you are now doing with the virtio BAR, and now we have to maintain two code

Re: [PATCH] Add virtio gpu driver.

2015-03-30 Thread Gerd Hoffmann
Hi, Signed-off-by: Dave Airlie airl...@redhat.com Signed-off-by: Gerd Hoffmann kra...@redhat.com Standard request from my side for new drm drivers (especially if they're this simple): Can you please update the drivers to latest drm internal interfaces, i.e. using universal planes

[PATCH v2 4/4] Add virtio-vga bits.

2015-04-01 Thread Gerd Hoffmann
--- drivers/gpu/drm/virtio/virtgpu_drm_bus.c | 32 ++-- drivers/virtio/virtio_pci_common.c | 7 ++- 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_drm_bus.c b/drivers/gpu/drm/virtio/virtgpu_drm_bus.c index

Re: [virtio-dev] Re: [PATCH] Add virtio gpu driver.

2015-03-27 Thread Gerd Hoffmann
Hi, Completely different thing crossing my mind: I think we can make virtio-vga fully compatible with stdvga. stdvga has two bars, memory (#0) and mmio (#2). We can make the mmio bar larger and place all the virtio regions there. Full compatibility with some standard sounds

Re: [PATCH 1/1] Add virtio-input driver.

2015-03-23 Thread Gerd Hoffmann
On Mo, 2015-03-23 at 15:54 +0100, Michael S. Tsirkin wrote: On Mon, Mar 23, 2015 at 03:27:35PM +0100, Gerd Hoffmann wrote: Hi, You are doing leXXX everywhere, that's VERSION_1 dependency. virtio_cread will do byteswaps differently without VERSION_1. Just don't go

Re: [PATCH 1/1] Add virtio-input driver.

2015-03-23 Thread Gerd Hoffmann
Hi, You are doing leXXX everywhere, that's VERSION_1 dependency. virtio_cread will do byteswaps differently without VERSION_1. Just don't go there. So to clarify, you dislike using __virtio32 in virtio input header? Well, as I understand things __virtio32 implies byteorder

Re: [PATCH 1/1] Add virtio-input driver.

2015-03-23 Thread Gerd Hoffmann
Hi, At least, this needs a comment explaining what the function does, and maybe wrap it in a helper like virtio_input_bitmap_copy or virtio_bitmap_or. Can do that, sure. Well, the function where this is in already cares about the bitmap copy only. Can add a comment though. You are

[PATCH v3] Add virtio-input driver.

2015-03-24 Thread Gerd Hoffmann
virtio-input is basically evdev-events-over-virtio, so this driver isn't much more than reading configuration from config space and forwarding incoming events to the linux input layer. Signed-off-by: Gerd Hoffmann kra...@redhat.com --- MAINTAINERS | 6 + drivers/virtio

Re: [PATCH] Add virtio gpu driver.

2015-03-26 Thread Gerd Hoffmann
On Mi, 2015-03-25 at 18:09 +0100, Michael S. Tsirkin wrote: On Wed, Mar 25, 2015 at 04:37:16PM +0100, Gerd Hoffmann wrote: Hi, BTW can we teach virtio-gpu to look for framebuffer using virtio pci caps? The virtio-gpu driver doesn't matter much here, it doesn't use it anyway

Re: [virtio-dev] Re: [PATCH] Add virtio gpu driver.

2015-03-26 Thread Gerd Hoffmann
Hi, I don't know. This seems exactly like the kind of thing we had in mind when we added the virtio pci capability. For example, we have text in spec that requires drivers to skip unknown capabilities. And yes, if bios pokes at a specific bar then we do need to list this info in the

Re: [PATCH 1/1] Add virtio-input driver.

2015-03-23 Thread Gerd Hoffmann
Hi, + if (cfg (1 (bit % 8))) + set_bit(bit, bits); what if not set? does something clear the mask? kzalloc? So you are really just reading in array of bytes? All this set bit trickery is just to convert things from LE? Trickery?

Re: [PATCH v2 3/4] Add virtio gpu driver.

2015-04-07 Thread Gerd Hoffmann
On Do, 2015-04-02 at 17:52 +0200, Marc-André Lureau wrote: Perhaps that condition should be changed: + BUG_ON(size = MAX_INLINE_CMD_SIZE); Done. thanks, Gerd ___ Virtualization mailing list Virtualization@lists.linux-foundation.org

[PATCH] virtio-pci: alloc only resources actually used.

2015-06-23 Thread Gerd Hoffmann
Move resource allocation from common code to legacy and modern code. Only request resources actually used, i.e. bar0 in legacy mode and the bar(s) specified by capabilities in modern mode. Signed-off-by: Gerd Hoffmann kra...@redhat.com --- drivers/virtio/virtio_pci_common.c | 7 --- drivers

[PATCH] virtio-pci: alloc only resources actually used.

2015-06-23 Thread Gerd Hoffmann
Move resource allocation from common code to legacy and modern code. Only request resources actually used, i.e. bar0 in legacy mode and the bar(s) specified by capabilities in modern mode. Signed-off-by: Gerd Hoffmann kra...@redhat.com --- drivers/virtio/virtio_pci_common.c | 7 --- drivers

[PATCH] virtio-pci: alloc only resources actually used.

2015-06-16 Thread Gerd Hoffmann
Move resource allocation from common code to legacy and modern code. Only request resources actually used, i.e. bar0 in legacy mode and the regions specified by capabilities in modern mode. Signed-off-by: Gerd Hoffmann kra...@redhat.com --- drivers/virtio/virtio_pci_common.c | 7 - drivers

Re: [PATCH] virtio-pci: alloc only resources actually used.

2015-06-18 Thread Gerd Hoffmann
Hi, +static struct resource *request_capability(struct pci_dev *dev, int off, + const char *name) +{ + u8 bar; + u32 offset, length; + + pci_read_config_byte(dev, off + offsetof(struct virtio_pci_cap, +

[PATCH v2] virtio-pci: alloc only resources actually used.

2015-06-18 Thread Gerd Hoffmann
Move resource allocation from common code to legacy and modern code. Only request resources actually used, i.e. bar0 in legacy mode and the regions specified by capabilities in modern mode. Signed-off-by: Gerd Hoffmann kra...@redhat.com --- drivers/virtio/virtio_pci_common.c | 7 drivers

Re: [PATCH v2] virtio-pci: alloc only resources actually used.

2015-06-18 Thread Gerd Hoffmann
Hi, + if (offset + length offset || + offset + length pci_resource_len(dev, bar)) { + dev_err(dev-dev, + virtio_pci: virtio capability %u@%u + out of range on bar %i length %lu\n, + length, offset, bar, +

[PATCH 1/3] Add virtio-vga bits.

2015-06-16 Thread Gerd Hoffmann
--- drivers/gpu/drm/virtio/virtgpu_drm_bus.c | 44 +--- 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_drm_bus.c b/drivers/gpu/drm/virtio/virtgpu_drm_bus.c index f4ec816..88a3916 100644 ---

[PATCH 3/3] virtio-gpu: add locking for vbuf pool

2015-06-16 Thread Gerd Hoffmann
From: Dave Airlie airl...@redhat.com Signed-off-by: Dave Airlie airl...@redhat.com Signed-off-by: Gerd Hoffmann kra...@redhat.com --- drivers/gpu/drm/virtio/virtgpu_drv.h | 1 + drivers/gpu/drm/virtio/virtgpu_vq.c | 7 +++ 2 files changed, 8 insertions(+) diff --git a/drivers/gpu/drm

[PATCH 2/3] drm/virtgpu: initialise fbdev after getting initial display info

2015-06-16 Thread Gerd Hoffmann
From: Dave Airlie airl...@redhat.com This should avoid issues with the fbdev path trying to render before we've gotten the display info. Signed-off-by: Dave Airlie airl...@redhat.com [ kraxel: wait for display-info reply ] Signed-off-by: Gerd Hoffmann kra...@redhat.com --- drivers/gpu/drm

Re: [patch] drm/virtio: remove some dead code

2015-06-11 Thread Gerd Hoffmann
On Mi, 2015-06-10 at 22:27 +0300, Dan Carpenter wrote: The goto is correct, and we never reach the return statement so just delete the dead code. Signed-off-by: Dan Carpenter dan.carpen...@oracle.com Reviewed-by: Gerd Hoffmann kra...@redhat.com

Re: [patch] drm/virtio: checking for NULL instead of IS_ERR

2015-06-11 Thread Gerd Hoffmann
On Mi, 2015-06-10 at 22:27 +0300, Dan Carpenter wrote: virtio_gpu_alloc_object() returns an error pointer, it never returns NULL. Fixes: dc5698e80cf7 ('Add virtio gpu driver.') Signed-off-by: Dan Carpenter dan.carpen...@oracle.com Reviewed-by: Gerd Hoffmann kra...@redhat.com

[PATCH v3 4/4] Add virtio gpu driver.

2015-05-22 Thread Gerd Hoffmann
) support requires some more work on the qemu side and will be added later. Signed-off-by: Dave Airlie airl...@redhat.com Signed-off-by: Gerd Hoffmann kra...@redhat.com --- drivers/gpu/drm/Kconfig | 2 + drivers/gpu/drm/Makefile | 1 + drivers/gpu/drm/virtio/Kconfig

Re: [RFC] kvmtool: add support for modern virtio-pci

2015-11-18 Thread Gerd Hoffmann
Hi, > Thanks for testing! I didn't even thing about seabios as a testing target. Not surprising, support isn't upstream, ran into a bunch of issues[1][2] last time I tried to combine the two, ran into some issues and nobody seemed to care, so the seabios patches where just sitting in a branch

Re: [PATCH] virtio-gpu: fix compilation warnings

2015-09-07 Thread Gerd Hoffmann
On Mi, 2015-09-02 at 12:30 +0300, Mike Rapoport wrote: > Update snprintf format in virtgpu_fence.c and virtgpu_debugfs.c to fix the > following compilation warnings: > > C [M] drivers/gpu/drm/virtio/virtgpu_fence.o > drivers/gpu/drm/virtio/virtgpu_fence.c: In function >

Re: [PATCH 1/5] virtio-gpu: add virtio_gpu_queue_ctrl_buffer_nolock

2015-09-10 Thread Gerd Hoffmann
On Do, 2015-09-10 at 09:39 +0100, Emil Velikov wrote: > Hi Gerd, > > On 9 September 2015 at 12:42, Gerd Hoffmann <kra...@redhat.com> wrote: > > Add virtio_gpu_queue_ctrl_buffer_nolock function, which does the same as > > virtio_gpu_queue_ctrl_buffer but does

Re: [PATCH 3/5] update virtio gpu driver: add 3d/virgl support

2015-09-10 Thread Gerd Hoffmann
Hi, > Just a FYI - Daniel Vetter has a series in flight which deprecates > DRM_UNLOCKED for KMS drivers. Thanks for the heads up. > > > --- /dev/null > > +++ b/include/uapi/drm/virtgpu_drm.h > > @@ -0,0 +1,163 @@ > > > + > > +struct drm_virtgpu_3d_box { > > + uint32_t x, y, z; > > +

Re: [PATCH 5/5] virtgpu: mark as a render gpu

2015-09-10 Thread Gerd Hoffmann
Hi, > > Dave? Looking at the ioctls they are all fine for render nodes, there > > isn't anything modesetting related in the device-specific ioctls. > > > > Correct? > > > Unless I've overdone the coffee this time - modesetting is done via > the card# node, while render via either card# or

Re: [PATCH 5/5] virtgpu: mark as a render gpu

2015-09-10 Thread Gerd Hoffmann
On Do, 2015-09-10 at 09:59 +0100, Emil Velikov wrote: > On 9 September 2015 at 12:42, Gerd Hoffmann <kra...@redhat.com> wrote: > > From: Dave Airlie <airl...@redhat.com> > > > > Signed-off-by: Gerd Hoffmann <kra...@redhat.com> > > --- > > driv

Re: [PATCH 5/5] virtgpu: mark as a render gpu

2015-09-11 Thread Gerd Hoffmann
On Fr, 2015-09-11 at 16:32 +1000, Dave Airlie wrote: > doh, yes we need to add DRM_RENDER_ALLOW to the ioctls, can you do > that? Done. cheers, Gerd ___ Virtualization mailing list Virtualization@lists.linux-foundation.org

[PATCH v3 4/7] virtio-gpu: add 3d/virgl support

2015-10-02 Thread Gerd Hoffmann
Add the bits needed for opengl rendering support: query capabilities, new virtio commands, drm ioctls. Signed-off-by: Dave Airlie <airl...@redhat.com> Signed-off-by: Gerd Hoffmann <kra...@redhat.com> --- drivers/gpu/drm/virtio/Makefile| 3 +- drivers/gpu/drm/virtio/v

[PATCH v3 5/7] virtio-gpu: add basic prime support

2015-10-02 Thread Gerd Hoffmann
From: Dave Airlie <airl...@redhat.com> This is enough to enable DRI3. Signed-off-by: Dave Airlie <airl...@redhat.com> Signed-off-by: Gerd Hoffmann <kra...@redhat.com> --- drivers/gpu/drm/virtio/Makefile| 2 +- drivers/gpu/drm/virtio/virtgpu_drv.c | 13 ++- driv

[PATCH v3 3/7] virtio-gpu: wait for cursor updates finish

2015-10-02 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann <kra...@redhat.com> --- drivers/gpu/drm/virtio/virtgpu_display.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/gpu/drm/virtio/virtgpu_display.c b/drivers/gpu/drm/virtio/virtgpu_display.c index 4e160ef..c9c1427 100644 --- a/drivers/gpu/drm/

[PATCH v3 2/7] virtio-gpu: add & use virtio_gpu_queue_fenced_ctrl_buffer

2015-10-02 Thread Gerd Hoffmann
Add helper function to handle the submission of fenced control requests. Make sure we initialize the fence while holding the virtqueue lock, so requests can't be reordered. Signed-off-by: Gerd Hoffmann <kra...@redhat.com> --- drivers/gpu/drm/virtio/virtgpu_fence.c | 2 +- drivers/gpu/drm/

[PATCH v3 7/7] [wip] virtio-gpu: add page flip support

2015-10-02 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann <kra...@redhat.com> --- drivers/gpu/drm/virtio/virtgpu_display.c | 49 ++-- 1 file changed, 46 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_display.c b/drivers/gpu/drm/virtio/virtgpu_display.c index c

[PATCH v3 1/7] virtio-gpu: add virtio_gpu_queue_ctrl_buffer_locked

2015-10-02 Thread Gerd Hoffmann
Add virtio_gpu_queue_ctrl_buffer_locked function, which does the same as virtio_gpu_queue_ctrl_buffer but does not take the virtqueue lock. The caller must hold the lock instead. Signed-off-by: Gerd Hoffmann <kra...@redhat.com> --- drivers/gpu/drm/virtio/virtgpu_vq.c | 17 +-

[PATCH v3 6/7] virtio-gpu: mark as a render gpu

2015-10-02 Thread Gerd Hoffmann
From: Dave Airlie <airl...@redhat.com> Also add DRM_RENDER_ALLOW to the ioctls. Signed-off-by: Gerd Hoffmann <kra...@redhat.com> --- drivers/gpu/drm/virtio/virtgpu_drv.c | 2 +- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 18 +- 2 files changed, 10 insertions(+),

[PATCH 3/5] update virtio gpu driver: add 3d/virgl support

2015-09-09 Thread Gerd Hoffmann
Add the bits needed for opengl rendering support: query capabilities, new virtio commands, drm ioctls. Signed-off-by: Dave Airlie <airl...@redhat.com> Signed-off-by: Gerd Hoffmann <kra...@redhat.com> --- drivers/gpu/drm/virtio/Makefile| 3 +- drivers/gpu/drm/virtio/v

[PATCH 2/5] virtio-gpu: add & use virtio_gpu_queue_fenced_ctrl_buffer

2015-09-09 Thread Gerd Hoffmann
Add helper function to handle the submission of fenced control requests. Make sure we initialize the fence while holding the virtqueue lock, so requests can't be reordered. Signed-off-by: Gerd Hoffmann <kra...@redhat.com> --- drivers/gpu/drm/virtio/virtgpu_fence.c | 2 +- drivers/gpu/drm/

Re: [PATCH v2 4/6] virtio-gpu: add 3d/virgl support

2015-09-22 Thread Gerd Hoffmann
Hi, > > static unsigned int features[] = { > > +#ifdef __LITTLE_ENDIAN > > + VIRTIO_GPU_FEATURE_VIRGL, > > +#endif > > }; > > Why is virgl LE specific? Just curious. gallium command stream is native endian, and we only support little endian guests on little endian hosts for that reason.

Re: [PATCH v2 5/6] virtio-gpu: add basic prime support

2015-09-22 Thread Gerd Hoffmann
> > +int virtgpu_gem_prime_mmap(struct drm_gem_object *obj, > > + struct vm_area_struct *area) > > +{ > > + WARN_ONCE(1, "not implemented"); > > + return ENOSYS; > > This can get called by userspace, so please don't WARN here. Also missing > negate sign: > > return

[PATCH v2 1/6] virtio-gpu: add virtio_gpu_queue_ctrl_buffer_locked

2015-09-21 Thread Gerd Hoffmann
Add virtio_gpu_queue_ctrl_buffer_locked function, which does the same as virtio_gpu_queue_ctrl_buffer but does not take the virtqueue lock. The caller must hold the lock instead. Signed-off-by: Gerd Hoffmann <kra...@redhat.com> --- drivers/gpu/drm/virtio/virtgpu_vq.c | 17 +-

[PATCH v2 6/6] virtio-gpu: mark as a render gpu

2015-09-21 Thread Gerd Hoffmann
From: Dave Airlie <airl...@redhat.com> Also add DRM_RENDER_ALLOW to the ioctls. Signed-off-by: Gerd Hoffmann <kra...@redhat.com> --- drivers/gpu/drm/virtio/virtgpu_drv.c | 2 +- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 18 +- 2 files changed, 10 insertions(+),

[PATCH v2 3/6] virtio-gpu: wait for cursor updates finish

2015-09-21 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann <kra...@redhat.com> --- drivers/gpu/drm/virtio/virtgpu_display.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/virtio/virtgpu_display.c b/drivers/gpu/drm/virtio/virtgpu_display.c index 4e160ef..97e5274 100644 --- a/drivers/gpu/drm/

[PATCH v2 4/6] virtio-gpu: add 3d/virgl support

2015-09-21 Thread Gerd Hoffmann
Add the bits needed for opengl rendering support: query capabilities, new virtio commands, drm ioctls. Signed-off-by: Dave Airlie <airl...@redhat.com> Signed-off-by: Gerd Hoffmann <kra...@redhat.com> --- drivers/gpu/drm/virtio/Makefile| 3 +- drivers/gpu/drm/virtio/v

[PATCH v2 2/6] virtio-gpu: add & use virtio_gpu_queue_fenced_ctrl_buffer

2015-09-21 Thread Gerd Hoffmann
Add helper function to handle the submission of fenced control requests. Make sure we initialize the fence while holding the virtqueue lock, so requests can't be reordered. Signed-off-by: Gerd Hoffmann <kra...@redhat.com> --- drivers/gpu/drm/virtio/virtgpu_fence.c | 2 +- drivers/gpu/drm/

[PATCH v2 5/6] virtio-gpu: add basic prime support

2015-09-21 Thread Gerd Hoffmann
From: Dave Airlie <airl...@redhat.com> This is enough to enable DRI3. Signed-off-by: Dave Airlie <airl...@redhat.com> Signed-off-by: Gerd Hoffmann <kra...@redhat.com> --- drivers/gpu/drm/virtio/Makefile| 2 +- drivers/gpu/drm/virtio/virtgpu_drv.c | 13 +- driv

Re: [RFC] kvmtool: add support for modern virtio-pci

2015-11-18 Thread Gerd Hoffmann
On Mi, 2015-11-18 at 00:11 -0500, Sasha Levin wrote: > This is a first go at adding support for the modern (based on the 1.0 virtio > spec) virtio-pci implementation. > To sum it up: this is a lightly tested version for feedback about the design > and to weed out major bugs people notice.

Re: [RFC] kvmtool: add support for modern virtio-pci

2015-11-18 Thread Gerd Hoffmann
On Mi, 2015-11-18 at 23:01 -0500, Sasha Levin wrote: > On 11/18/2015 11:00 PM, Sasha Levin wrote: > > Anyways, I debugged it for a bit a found that seabios attempts to write to > > the notification BAR, I look further tomorrow to narrow it down and fix it. > > Err, *read*, obviously. > > I've

Re: [RFC] kvmtool: add support for modern virtio-pci

2015-11-19 Thread Gerd Hoffmann
Hi, > That was indeed the ISR field. Fixing that makes seabios reach the same point > as > legacy virtio before failing. > > I don't see the original correspondence about seabios failures you've > reported, if > you want to forward them over we can look at it further. It was a few months

Re: [PATCH RESEND 06/14] drm/virtio: use drm_crtc_send_vblank_event()

2016-06-07 Thread Gerd Hoffmann
On Mo, 2016-06-06 at 11:41 -0300, Gustavo Padovan wrote: > From: Gustavo Padovan > > Replace the legacy drm_send_vblank_event() with the new helper function. > > Signed-off-by: Gustavo Padovan > --- >

Re: [PATCH] virtio-gpu: use src not crtc

2016-06-14 Thread Gerd Hoffmann
On Di, 2016-06-14 at 12:13 +0200, Marc-André Lureau wrote: > Hi > > On Tue, May 31, 2016 at 2:52 PM, Gerd Hoffmann <kra...@redhat.com> wrote: > > Pick up the correct source rectangle from framebuffer. > > Without this multihead setups are not working correctly.

Re: [PATCH v3 7/7] [wip] virtio-gpu: add page flip support

2016-05-30 Thread Gerd Hoffmann
Hi, > > But I'll take you up on the implied offer to help out and test ;-) > > git://people.freedesktop.org/~danvet/drm stuff Tried that branch. > Would be really awesome if you could test this on virtio. Note that the > new nonblocking helpers require that your atomic backend gets the drm >

Re: [PATCH] Add virtio gpu driver.

2016-05-30 Thread Gerd Hoffmann
Hi, > - add a small core function to registerr HOT_X/HOT_Y for a (cursor) plane, > e.g. drm_plane_register_hotspot(). That should allocate the properties > (if they don't exist yet) and then attach those props to the cursor. We > don't want those props everywhere, but only on drivers that

Re: [PATCH v3 7/7] [wip] virtio-gpu: add page flip support

2016-05-31 Thread Gerd Hoffmann
Hi, > > Right now the virtual outputs are linked to drm_crtc. To apply any > > changes I need to lookup the crtc to figure which virtual output should > > be updated. > > So, setting active_only should make sure I have a valid crtc pointer on > > plane updates, right? It probably also skips

Re: [PATCH v3 7/7] [wip] virtio-gpu: add page flip support

2016-05-31 Thread Gerd Hoffmann
Hi, > > https://lists.freedesktop.org/archives/dri-devel/2016-May/108772.html > > Hm, smells more like virtio isn't too happy with the default ordering of > the commit operation. The default is: > > - Disable any crtc/encoders that need to be disabled/change. > - Bash new plane setup into hw.

Re: [PATCH] Add virtio gpu driver.

2016-05-31 Thread Gerd Hoffmann
Hi, > > Why attach the hotspot to the plane? Wouldn't it make more sense to > > make it a framebuffer property? > > We don't have properties on the framebuffer. I guess you /could/ just add > it internally to struct drm_framebuffer, and not bother exposing to > userspace. I guess that would

Re: [PATCH v3 7/7] [wip] virtio-gpu: add page flip support

2016-05-27 Thread Gerd Hoffmann
On Mi, 2016-05-25 at 18:37 +0200, Daniel Vetter wrote: > On Fri, Oct 2, 2015 at 1:58 PM, Gerd Hoffmann <kra...@redhat.com> wrote: > > Signed-off-by: Gerd Hoffmann <kra...@redhat.com> > > So I entirely missed this, but this isn't really how to implement > page_flip

Re: [PATCH] Add virtio gpu driver.

2016-05-27 Thread Gerd Hoffmann
ne for the most part, see attached draft. The only thing I'm wondering is how the hotspot is handled. drm_mode_cursor_universal doesn't even look at req->hot_{x,y}. /me looks confused. cheers, Gerd From fb1d0700a46d850ec9f931304a9e99854a3ce5e9 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann

[PATCH] virtio-gpu: use src not crtc

2016-05-31 Thread Gerd Hoffmann
Pick up the correct source rectangle from framebuffer. Without this multihead setups are not working correctly. Signed-off-by: Gerd Hoffmann <kra...@redhat.com> --- drivers/gpu/drm/virtio/virtgpu_plane.c | 31 ++- 1 file changed, 18 insertions(+), 13 del

[PATCH 1/5] virtio-gpu: fix output lookup

2016-05-31 Thread Gerd Hoffmann
Needed for multihead setups where we can have disabled outputs and therefore plane->crtc can be NULL. Signed-off-by: Gerd Hoffmann <kra...@redhat.com> --- drivers/gpu/drm/virtio/virtgpu_plane.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/d

[PATCH 3/5] virtio-gpu: switch to atomic cursor interfaces

2016-05-31 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann <kra...@redhat.com> --- drivers/gpu/drm/virtio/virtgpu_display.c | 102 -- drivers/gpu/drm/virtio/virtgpu_drv.h | 1 + drivers/gpu/drm/virtio/virtgpu_plane.c | 105 --- 3 files changed, 109 inse

[PATCH 2/5] virtio-gpu: add atomic_commit function

2016-05-31 Thread Gerd Hoffmann
Do modesets first, then call drm_atomic_helper_commit_planes with active_only = true. That way the outputs doesn't get disabled temporarly on atomic commits. Signed-off-by: Gerd Hoffmann <kra...@redhat.com> --- drivers/gpu/drm/virtio/virtgpu_display.c | 22 +- drive

[PATCH 5/5] virtio-gpu: pick up hotspot from framebuffer

2016-05-31 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann <kra...@redhat.com> --- drivers/gpu/drm/virtio/virtgpu_plane.c | 20 +--- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_plane.c b/drivers/gpu/drm/virtio/virtgpu_plane.c index 4780354..b7778a7

Re: [PATCH] virtio-gpu: disable VIRGL with BE kernel

2017-01-27 Thread Gerd Hoffmann
On Di, 2017-01-24 at 14:12 +0100, Laurent Vivier wrote: > VIRTIO_GPU_F_VIRGL is added in features list only > for LE kernel, so we must check for it only on LE kernel, > otherwise virtio_has_feature() calls BUG() and > crashes the kernel. > > Suggested-by: Gerd Hoffmann

Re: [PATCH] drm/virtio: call drm_plane_cleanup() at destroy phase

2017-02-16 Thread Gerd Hoffmann
On Mi, 2017-02-15 at 16:00 -0200, Gustavo Padovan wrote: > From: Gustavo Padovan > > virtio was missing this call to clean up core plane usage. > > Signed-off-by: Gustavo Padovan > --- > drivers/gpu/drm/virtio/virtgpu_plane.c |

Re: BUG: 'list_empty(>free_vbufs)' is true!

2016-11-09 Thread Gerd Hoffmann
On Di, 2016-11-08 at 22:37 +0200, Michael S. Tsirkin wrote: > On Mon, Nov 07, 2016 at 09:43:24AM +0100, Jiri Slaby wrote: > > Hi, > > > > I can relatively easily reproduce this bug: How? > > BUG: 'list_empty(>free_vbufs)' is true! > The following might be helpful for debugging - if kernel

Re: BUG: 'list_empty(>free_vbufs)' is true!

2016-11-15 Thread Gerd Hoffmann
On Di, 2016-11-15 at 09:55 +0100, Jiri Slaby wrote: > On 11/15/2016, 09:46 AM, Gerd Hoffmann wrote: > > On Fr, 2016-11-11 at 17:28 +0100, Jiri Slaby wrote: > >> On 11/09/2016, 09:01 AM, Gerd Hoffmann wrote: > >>> On Di, 2016-11-08 at 22:37 +0200, Michael S. Tsirki

[PATCH for-4.9] drm/virtio: allocate some extra bufs

2016-11-15 Thread Gerd Hoffmann
virtio-gpu guest driver appearently can run out of buffers. allocate some extra buffers, as quick stopgap for 4.9. analyzing root cause and fixing it properly is TBD. Reported-by: Jiri Slaby <jsl...@suse.cz> Tested-by: Jiri Slaby <jsl...@suse.cz> Signed-off-by: Gerd Hoffmann <kr

Re: BUG: 'list_empty(>free_vbufs)' is true!

2016-11-15 Thread Gerd Hoffmann
On Fr, 2016-11-11 at 17:28 +0100, Jiri Slaby wrote: > On 11/09/2016, 09:01 AM, Gerd Hoffmann wrote: > > On Di, 2016-11-08 at 22:37 +0200, Michael S. Tsirkin wrote: > >> On Mon, Nov 07, 2016 at 09:43:24AM +0100, Jiri Slaby wrote: > >>> Hi, > >>> > &

Re: virtio gpu sparse warning

2016-11-27 Thread Gerd Hoffmann
On Do, 2016-11-24 at 04:57 +0200, Michael S. Tsirkin wrote: > sparse produces these warnings: > > drivers/gpu/drm/virtio/virtgpu_fb.c:340:27: warning: incorrect type in > assignment (different address spaces) > drivers/gpu/drm/virtio/virtgpu_fb.c:340:27:expected char [noderef] > *screen_base

[PATCH] drm/virtio: fix framebuffer sparse warning

2016-11-28 Thread Gerd Hoffmann
virtio uses normal ram as backing storage for the framebuffer, so we should assign the address to new screen_buffer (added by commit 17a7b0b4d9749f80d365d7baff5dec2f54b0e992) instead of screen_base. Reported-by: Michael S. Tsirkin <m...@redhat.com> Signed-off-by: Gerd Hoffmann <kra...@r

[PATCH] virtio-gpu: fix vblank events

2016-10-13 Thread Gerd Hoffmann
virtio-gpu sends vblank events in virtio_gpu_crtc_atomic_flush, and because of that it must be called for disabled planes too. Ask drm_atomic_helper_commit_planes to do that. Signed-off-by: Gerd Hoffmann <kra...@redhat.com> --- drivers/gpu/drm/virtio/virtgpu_display.c | 2 +- 1 file chan

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

2016-12-13 Thread Gerd Hoffmann
Hi, > +struct virtio_gpu_fence *virtio_gpu_fence_alloc(struct virtio_gpu_device > *vgdev) > +{ > + struct virtio_gpu_fence_driver *drv = >fence_drv; > + struct virtio_gpu_fence *fence; > + unsigned long irq_flags; > + > + fence = kmalloc(sizeof(struct virtio_gpu_fence),

Re: [PATCH 2/2] drm: virtio: fix virtio_gpu_mode_dumb_create

2017-04-03 Thread Gerd Hoffmann
On Mo, 2017-04-03 at 09:53 +0200, Daniel Vetter wrote: > On Mon, Apr 03, 2017 at 09:08:45AM +0200, Gerd Hoffmann wrote: > > Lookup format using virtio_gpu_translate_format() > > instead of hardcoding it. Fixes xorg display on > > bigendian guests (i.e. ppc64). > &g

Re: [PATCH 1/2] drm: virtio: add virtio_gpu_translate_format

2017-04-03 Thread Gerd Hoffmann
On Mo, 2017-04-03 at 09:51 +0200, Daniel Vetter wrote: > On Mon, Apr 03, 2017 at 09:08:44AM +0200, Gerd Hoffmann wrote: > > Factors out code, no functional change. > > > > Signed-off-by: Gerd Hoffmann <kra...@redhat.com> > > Ugh on the big endian define, I gu

[PATCH 1/2] drm: virtio: add virtio_gpu_translate_format

2017-04-03 Thread Gerd Hoffmann
Factors out code, no functional change. Signed-off-by: Gerd Hoffmann <kra...@redhat.com> --- drivers/gpu/drm/virtio/virtgpu_drv.h | 1 + drivers/gpu/drm/virtio/virtgpu_fb.c| 58 + drivers/gpu/drm/virtio/virtgpu_plane.c | 68 +++

[PATCH 2/2] drm: virtio: fix virtio_gpu_mode_dumb_create

2017-04-03 Thread Gerd Hoffmann
Lookup format using virtio_gpu_translate_format() instead of hardcoding it. Fixes xorg display on bigendian guests (i.e. ppc64). Signed-off-by: Gerd Hoffmann <kra...@redhat.com> --- drivers/gpu/drm/virtio/virtgpu_gem.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff

[PATCH] drm/virtio: don't leak bo on drm_gem_object_init failure

2017-04-06 Thread Gerd Hoffmann
Reported-by: 李强 <liqiang...@360.cn> Signed-off-by: Gerd Hoffmann <kra...@redhat.com> --- drivers/gpu/drm/virtio/virtgpu_object.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_object.c b/drivers/gpu/drm/virtio/virtgpu_object.c i

Re: DRM_FORMAT_* byte order (was: Re: [PATCH] drm: virtio: fix virtio_gpu_cursor_formats)

2017-04-07 Thread Gerd Hoffmann
Hi, > > So, bigendian guests assume that DRM_FORMAT_XRGB is big endian not > > little endian. And given that the fourcc codes are used in the > > userspace/kernel API too (see DRM_IOCTL_MODE_ADDFB2) I think we can't > > change that any more ... > > Sigh. That makes mixed endian systems

Re: DRM_FORMAT_* byte order (was: Re: [PATCH] drm: virtio: fix virtio_gpu_cursor_formats)

2017-04-07 Thread Gerd Hoffmann
Hi, > Hmm. Maybe it's still possible to salvage something by redefining the > BIG_ENDIAN format bit to mean the "the other endianness". Ugly but it > might still result in something usable. Also at least for the virtual machine use case this doesn't buy us much. The drm drivers (at least the

Re: DRM_FORMAT_* byte order (was: Re: [PATCH] drm: virtio: fix virtio_gpu_cursor_formats)

2017-04-07 Thread Gerd Hoffmann
On Fr, 2017-04-07 at 11:45 +0300, Ville Syrjälä wrote: > On Fri, Apr 07, 2017 at 10:29:00AM +0200, Gerd Hoffmann wrote: > > Hi, > > > > > Hmm. Maybe it's still possible to salvage something by redefining the > > > BIG_ENDIAN format bit to mean the "the othe

[PATCH 4/6] drm: fourcc byteorder: adapt bochs-drm to drm_mode_legacy_fb_format update

2017-04-24 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann <kra...@redhat.com> --- drivers/gpu/drm/bochs/bochs_mm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bochs/bochs_mm.c b/drivers/gpu/drm/bochs/bochs_mm.c index 857755ac2d..781d35bdff 100644 --- a/drivers/gpu/drm/bochs/boch

[PATCH 5/6] drm: fourcc byteorder: adapt virtio to drm_mode_legacy_fb_format update

2017-04-24 Thread Gerd Hoffmann
Signed-off-by: Gerd Hoffmann <kra...@redhat.com> --- drivers/gpu/drm/virtio/virtgpu_gem.c | 2 +- drivers/gpu/drm/virtio/virtgpu_plane.c | 31 --- 2 files changed, 1 insertion(+), 32 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_gem.c b/drivers/g

[PATCH 6/6] drm: fourcc byteorder: virtio restrict to XRGB8888

2017-04-24 Thread Gerd Hoffmann
While wading through the code I've noticed we have a little issue in virtio: We attach a format to the bo when it is created (DRM_IOCTL_MODE_CREATE_DUMB), not when we map it as framebuffer (DRM_IOCTL_MODE_ADDFB). Easy way out: support a single format only. Signed-off-by: Gerd Hoffmann <

Re: [PATCH] drm: qxl: add missing return check

2017-03-14 Thread Gerd Hoffmann
On Di, 2017-03-14 at 10:54 +0300, Dan Carpenter wrote: > My static checker complains that "release" is uninitialized if > qxl_alloc_release_reserved() fails, so let's add a check for that. applied to drm-misc-next. thanks, Gerd ___ Virtualization

Re: [PATCH] drm: virtio: fix eno.cocci warnings

2017-03-14 Thread Gerd Hoffmann
Hi, > vbuf = kmem_cache_alloc(vgdev->vbufs, GFP_KERNEL); > - if (IS_ERR(vbuf)) > + if (!vbuf) > return ERR_CAST(vbuf); Well, ERR_CAST(vbuf) isn't correct either ... correct fix has been committed to drm-misc-next today and should show up in linux-next shortly.

[PATCH] drm: virtio: fix kmem_cache_alloc error check

2017-03-13 Thread Gerd Hoffmann
kmem_cache_alloc returns NULL on error, not ERR_PTR. Fixes: f5985bf9cadd4e3ed8d5d9a9cbbb2e39cdb81cd9 Reported-by: Jiri Slaby <jsl...@suse.cz> Signed-off-by: Gerd Hoffmann <kra...@redhat.com> --- drivers/gpu/drm/virtio/virtgpu_vq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deleti

[PATCH 4/4] qxl: fix qxl_conn_get_modes

2017-03-01 Thread Gerd Hoffmann
on the spice client request, we need to look at client_monitors_config->count not monitors_config->count. Signed-off-by: Gerd Hoffmann <kra...@redhat.com> --- drivers/gpu/drm/qxl/qxl_display.c | 22 -- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/drivers

[PATCH 1/4] qxl: drop mode_info.modes & related code.

2017-03-01 Thread Gerd Hoffmann
at load time in case debug logging is enabled. Drop that pointless code. Signed-off-by: Gerd Hoffmann <kra...@redhat.com> --- drivers/gpu/drm/qxl/qxl_drv.h | 2 -- drivers/gpu/drm/qxl/qxl_kms.c | 22 -- 2 files changed, 24 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_d

[PATCH 2/4] qxl: limit monitor config read retries

2017-03-01 Thread Gerd Hoffmann
When reading the monitor config fails, don't retry forever. If it fails ten times in a row just give up to avoid the driver hangs. Also add a small delay after each attempt, so the host has a chance to complete a partial update. Signed-off-by: Gerd Hoffmann <kra...@redhat.com> --- drive

[PATCH 3/4] qxl: read monitors config at boot

2017-03-01 Thread Gerd Hoffmann
a empty client monitors config, so we don't trip over an uninitialized client monitors config. Signed-off-by: Gerd Hoffmann <kra...@redhat.com> --- drivers/gpu/drm/qxl/qxl_display.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/d

[PATCH] drm: virtio: use kmem_cache

2017-03-01 Thread Gerd Hoffmann
Just use kmem_cache instead of rolling our own, limited implementation. Signed-off-by: Gerd Hoffmann <kra...@redhat.com> --- drivers/gpu/drm/virtio/virtgpu_drv.h | 4 +-- drivers/gpu/drm/virtio/virtgpu_vq.c | 57 +++- 2 files changed, 11 insertions(

<    1   2   3   4   5   6   7   8   9   10   >