28 Mar, 2019

2 commits

  • This patch moves the virtio_gpu_cmd_create_resource() call (which
    notifies the host about the new resource created) into the
    virtio_gpu_object_create() function. That way we can call
    virtio_gpu_cmd_create_resource() before ttm_bo_init(), so the host
    already knows about the object when ttm initializes the object and calls
    our driver callbacks.

    Specifically the object is already created when the
    virtio_gpu_ttm_tt_bind() callback invokes virtio_gpu_object_attach(),
    so the extra virtio_gpu_object_attach() calls done after
    virtio_gpu_object_create() are not needed any more.

    The fence support for the create ioctl becomes a bit more tricky though.
    The code moved into virtio_gpu_object_create() too. We first submit the
    (fenced) virtio_gpu_cmd_create_resource() command, then initialize the
    ttm object, and finally attach just created object to the fence for the
    command in case it didn't finish yet.

    Signed-off-by: Gerd Hoffmann
    Acked-by: Noralf Trønnes
    Link: http://patchwork.freedesktop.org/patch/msgid/20190318113332.10900-6-kraxel@redhat.com

    Gerd Hoffmann
     
  • Create virtio_gpu_object_params, use that to pass object parameters to
    virtio_gpu_object_create. This is just the first step, followup patches
    will add more parameters to the struct. The plan is to use the struct
    for all object parameters.

    Drop unused "kernel" parameter for virtio_gpu_alloc_object(), it is
    unused and always false.

    Also drop "pinned" parameter. virtio-gpu doesn't shuffle around
    objects, so effecively they all are pinned anyway. Hardcode
    TTM_PL_FLAG_NO_EVICT so ttm knows. Doesn't change much for the moment
    as virtio-gpu supports TTM_PL_FLAG_TT only so there is no opportunity to
    move around objects. That'll probably change in the future though.

    Signed-off-by: Gerd Hoffmann
    Acked-by: Noralf Trønnes
    Link: http://patchwork.freedesktop.org/patch/msgid/20190318113332.10900-3-kraxel@redhat.com

    Gerd Hoffmann
     

11 Feb, 2019

1 commit

  • Bisected guest kernel changes crashing qemu. Landed at
    "6c1cd97bda drm/virtio: fix resource id handling". Looked again, and
    noticed we where not only leaking *some* ids, but *all* ids. The old
    code never ever called virtio_gpu_resource_id_put().

    So, commit 6c1cd97bda effectively makes the linux kernel starting
    re-using IDs after releasing them, and apparently virglrenderer can't
    deal with that. Oops.

    This patch puts a temporary stopgap into place for the 5.0 release.

    Signed-off-by: Gerd Hoffmann
    Reviewed-by: Dave Airlie
    Signed-off-by: Dave Airlie
    Link: https://patchwork.freedesktop.org/patch/msgid/20190208140409.15280-1-kraxel@redhat.com

    Gerd Hoffmann
     

14 Nov, 2018

2 commits


30 Oct, 2018

3 commits

  • These IDRs were only being used to allocate unique numbers, not to look
    up pointers, so they can use the more space-efficient IDA instead.

    Signed-off-by: Matthew Wilcox
    Link: http://patchwork.freedesktop.org/patch/msgid/20180926160031.15721-2-willy@infradead.org

    [ kraxel: resolve conflict ]

    Signed-off-by: Gerd Hoffmann

    Matthew Wilcox
     
  • Move virtio_gpu_resource_id_{get,put} to virtgpu_object.c and make them
    static. Allocate and free the id on creation and destroy, drop all
    other calls. That way objects have a valid handle for the whole
    lifetime of the object.

    Also fixes ids leaking. Worst offender are dumb buffers, and I think
    some error paths too.

    Signed-off-by: Gerd Hoffmann
    Reviewed-by: Dave Airlie
    Link: http://patchwork.freedesktop.org/patch/msgid/20181019061847.18958-7-kraxel@redhat.com

    Gerd Hoffmann
     
  • 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()
    to do nothing on objects not created yet.

    Make virtio_gpu_ttm_bo_destroy() use the new variable too, instead of
    expecting hw_res_handle indicating the object state.

    Signed-off-by: Gerd Hoffmann
    Reviewed-by: Dave Airlie
    Link: http://patchwork.freedesktop.org/patch/msgid/20181019061847.18958-2-kraxel@redhat.com

    Gerd Hoffmann
     

26 Sep, 2018

2 commits

  • Currently, virtio_gpu_object_kmap() is only called by
    virtio_gpufb_create(), when a DRM framebuffer is created.

    Thus, instead of returning the vmap'ed address, emit a warning
    if virtio_gpu_object_kmap is called on an already mapped
    object. With this change, kmap/kunmap calls are now balanced.

    Signed-off-by: Ezequiel Garcia
    Link: http://patchwork.freedesktop.org/patch/msgid/20180925161606.17980-3-ezequiel@collabora.com
    Signed-off-by: Gerd Hoffmann

    Ezequiel Garcia
     
  • Implement a virtio_gpu_object_kunmap() to unmap the kernel
    mapping, and use it in the TTM object destroy path.

    Signed-off-by: Ezequiel Garcia
    Link: http://patchwork.freedesktop.org/patch/msgid/20180925161606.17980-2-ezequiel@collabora.com
    Signed-off-by: Gerd Hoffmann

    Ezequiel Garcia
     

27 Feb, 2018

1 commit


28 Dec, 2017

1 commit


07 Apr, 2017

1 commit


05 May, 2016

2 commits


16 Oct, 2015

1 commit


03 Jun, 2015

1 commit

  • This patch adds a kms driver for the virtio gpu. The xorg modesetting
    driver can handle the device just fine, the framebuffer for fbcon is
    there too.

    Qemu patches for the host side are under review currently.

    The pci version of the device comes in two variants: with and without
    vga compatibility. The former has a extra memory bar for the vga
    framebuffer, the later is a pure virtio device. The only concern for
    this driver is that in the virtio-vga case we have to kick out the
    firmware framebuffer.

    Initial revision has only 2d support, 3d (virgl) support requires
    some more work on the qemu side and will be added later.

    Signed-off-by: Dave Airlie
    Signed-off-by: Gerd Hoffmann
    Acked-by: Michael S. Tsirkin

    Dave Airlie