Age | Commit message (Collapse) | Author | Files | Lines |
|
Just call virtio_gpu_alloc_cmd_resp with some fixed args
instead of duplicating most of the function body.
Signed-off-by: Gerd Hoffmann <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Reviewed-by: Chia-I Wu <[email protected]>
|
|
If the virtio device supports indirect ring descriptors we need only one
ring entry for the whole command. Take that into account when checking
whenever the virtqueue has enough free entries for our command.
Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Chia-I Wu <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
|
|
It becomes clear that virtio_gpu_queue_fenced_ctrl_buffer should be
responsible for setting up sgs and virtio_gpu_queue_ctrl_sgs should
be responsible for queuing sgs.
Signed-off-by: Chia-I Wu <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>
|
|
When vqs_ready is false, vq should be considered invalid and we
should not check vq->num_free. After this change, a fenced command
queued before the vqs are ready will have fence id 0 and will be
considered done.
Signed-off-by: Chia-I Wu <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>
|
|
Signed-off-by: Chia-I Wu <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>
|
|
sgs setup does not need to be in the critical section.
Signed-off-by: Chia-I Wu <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>
|
|
We don't propagate erros to the callers. We have to unlock object
arrays on errors.
Signed-off-by: Chia-I Wu <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>
|
|
We can get it from vbuf.
Signed-off-by: Chia-I Wu <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>
|
|
It is a helper to return the virtio_gpu_ctrl_hdr in a vbuf.
Signed-off-by: Chia-I Wu <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>
|
|
The handling of virtqueue_add_sgs ENOSPC error is incorrect because
it can result in out-of-order virtqueue_add_sgs and break fences.
We never get ENOSPC anyway because the caller waits until there is
enough space (the other caller that did not wait was removed in
commit 32d6c2c5b522 ("drm/virtio: Rewrite virtio_gpu_queue_ctrl_buffer
using fenced version.")). Remove the incorrect and unnecessary error
path.
This also adds a WARN_ON(ret) until we properly handle errors.
Signed-off-by: Chia-I Wu <[email protected]>
Cc: David Riley <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>
|
|
outcnt may be greater than 1 since commit e1218b8c0cc1 ("drm/virtio:
Use vmalloc for command buffer allocations.").
Fixes: e1218b8c0cc1 ("drm/virtio: Use vmalloc for command buffer allocations.")
Signed-off-by: Chia-I Wu <[email protected]>
Cc: David Riley <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>
|
|
Avoid flooding the log in case we screw up badly.
Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Chia-I Wu <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
|
|
virtio has its own commit fail function. Add the
drm_atomic_helper_fake_vblank() call there.
Fixes: 2a735ad3d211 ("drm/virtio: Remove sending of vblank event")
Signed-off-by: Gerd Hoffmann <[email protected]>
Acked-by: Thomas Zimmermann <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
|
|
The atomic helpers automatically send out fake VBLANK events if no
vblanking has been initialized. Remove the sending code from the
driver.
v4:
* separate commit from core vblank changes
Signed-off-by: Thomas Zimmermann <[email protected]>
Acked-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
|
|
msm needs 5.5-rc4, go to the latest.
Signed-off-by: Dave Airlie <[email protected]>
|
|
When submitting a fenced command we must lock the object reservations
because virtio_gpu_queue_fenced_ctrl_buffer() unlocks after adding the
fence.
Reported-by: Jann Horn <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Chia-I Wu <[email protected]>
Tested-by: Jann Horn <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
|
|
That's the only file that uses it.
Signed-off-by: Gurchetan Singh <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>
|
|
That's the only file that uses it.
Signed-off-by: Gurchetan Singh <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>
|
|
This is a little simpler.
Signed-off-by: Gurchetan Singh <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>
|
|
Not used anywhere.
Signed-off-by: Gurchetan Singh <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>
|
|
Not used anywhere else.
Signed-off-by: Gurchetan Singh <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>
|
|
Not used anywhere else.
Signed-off-by: Gurchetan Singh <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>
|
|
v2: remove shift by src_{x,y}, drm_atomic_helper_damage_merged()
handles that for us (Chia-I Wu).
Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Chia-I Wu <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
|
|
When the driver submits multiple commands in a row it makes sense to
notify the host only after submitting the last one, so the host can
process them all at once, with a single vmexit.
Add functions to enable/disable notifications to allow that. Use the
new functions for primary plane updates.
Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Chia-I Wu <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
|
|
v2: also check src rect (Chia-I Wu).
Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Chia-I Wu <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
|
|
Checking both is one too much, so wrap a WARN_ON around it to stope
the copypasta.
Signed-off-by: Daniel Vetter <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Cc: David Airlie <[email protected]>
Cc: Gerd Hoffmann <[email protected]>
Cc: [email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>
|
|
No functional change.
Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Gurchetan Singh <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
|
|
Return early for the no framebuffer (or disabled output) case.
Results in a simpler code flow for the remaining cases.
No functional change.
Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Gurchetan Singh <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
|
|
to}_host_3d functions
Be consistent with the rest of the code base.
No functional change.
v2:
- fix sparse warnings for virtio_gpu_cmd_transfer_to_host_2d call.
- move convert_to_hw_box helper function.
Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Gurchetan Singh <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
|
|
drm_put_dev also calls drm_dev_unregister, so dev will be unregistered
twice.
Replace it with drm_dev_put to fix it.
Signed-off-by: Chuhong Yuan <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
|
|
function
Be consistent with the rest of the code base.
Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Daniel Vetter <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
|
|
Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Daniel Vetter <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
|
|
DEFINE_DRM_GEM_SHMEM_FOPS is identical
to DEFINE_DRM_GEM_FOPS now, drop it.
Signed-off-by: Gerd Hoffmann <[email protected]>
Acked-by: Rob Herring <[email protected]>
Acked-by: Daniel Vetter <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
|
|
Switch gem shmem helper to the new mmap() workflow,
from &gem_driver.fops.mmap to &drm_gem_object_funcs.mmap.
v2: Fix vm_flags and vm_page_prot handling.
Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Steven Price <[email protected]>
Acked-by: Daniel Vetter <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
|
|
Fix warning introduced with commit e1218b8c0cc1
("drm/virtio: Use vmalloc for command buffer allocations.")
from drm-misc-next.
Signed-off-by: David Riley <[email protected]>
Reviewed-by: Chia-I Wu <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>
|
|
Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Chia-I Wu <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
|
|
Userspace requested command buffer allocations could be too large
to make as a contiguous allocation. Use vmalloc if necessary to
satisfy those allocations.
Signed-off-by: David Riley <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>
|
|
Factor function in preparation to generating scatterlist prior to locking.
Signed-off-by: David Riley <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Gerd Hoffmann <[email protected]>
|
|
Only call virtio_gpu_array_add_fence if we actually have a fence.
Fixes: da758d51968a ("drm/virtio: rework virtio_gpu_execbuffer_ioctl fencing")
Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Chia-I Wu <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
|
|
Move object release into a separate worker. Releasing objects requires
sending commands to the host. Doing that in the dequeue worker will
cause deadlocks in case the command queue gets filled up, because the
dequeue worker is also the one which will free up slots in the command
queue.
Reported-by: Chia-I Wu <[email protected]>
Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Chia-I Wu <[email protected]>
Tested-by: Chia-I Wu <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
|
|
Make sure we don't leak half-initialized fences outside the driver.
Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Chia-I Wu <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
|
|
No users left.
Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Chia-I Wu <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
|
|
No users left.
Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Chia-I Wu <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
|
|
Thin wrapper around virtio_gpu_object_create(),
but calling that directly works equally well.
Signed-off-by: Gerd Hoffmann <[email protected]>
Acked-by: Daniel Vetter <[email protected]>
Reviewed-by: Chia-I Wu <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
|
|
virtio-gpu basically needs a sg_table for the bo, to tell the host where
the backing pages for the object are. So the gem shmem helpers are a
perfect fit. Some drm_gem_object_funcs need thin wrappers to update the
host state, but otherwise the helpers handle everything just fine.
Once the fencing was sorted the switch was surprisingly easy and for the
most part just removing the ttm code.
v4: fix drm_gem_object_funcs name.
Signed-off-by: Gerd Hoffmann <[email protected]>
Acked-by: Daniel Vetter <[email protected]>
Reviewed-by: Chia-I Wu <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
|
|
No users left.
Signed-off-by: Gerd Hoffmann <[email protected]>
Acked-by: Daniel Vetter <[email protected]>
Reviewed-by: Chia-I Wu <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
|
|
Switch to the virtio_gpu_array_* helper workflow.
Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Chia-I Wu <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
|
|
Switch to the virtio_gpu_array_* helper workflow.
Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Chia-I Wu <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
|
|
Switch to the virtio_gpu_array_* helper workflow.
Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Chia-I Wu <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
|
|
Rework fencing workflow. Stop using ttm helpers, use the
virtio_gpu_array_* helpers instead.
Due to using the gem reservation object it is initialized and ready for
use before calling ttm_bo_init. So we can simply use the standard
fencing workflow and drop the tricky logic which checks whenever the
command is in flight still.
v6: rewrite most of the patch.
Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Chia-I Wu <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
|