Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

debug info #76

Draft
wants to merge 1 commit into
base: celadon/u/mr0/master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion drivers/gpu/drm/virtio/virtgpu_object.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,28 +286,36 @@ int virtio_gpu_object_create(struct virtio_gpu_device *vgdev,

int virtio_gpu_object_restore_all(struct virtio_gpu_device *vgdev)
{
printk("-yue virtgpu_object: virtio_gpu_object_restore_all\n ");
struct virtio_gpu_object_restore *curr, *tmp;
struct virtio_gpu_mem_entry *ents;
unsigned int nents;
int ret = 0;

list_for_each_entry_safe(curr, tmp, &vgdev->obj_rec, node) {
ret = virtio_gpu_object_shmem_init(vgdev, curr->bo, &ents, &nents);
if (ret)
if (ret) {
printk("--yue-- before break\n");
break;
}

if (curr->params.blob) {
printk("-yue params.blob\n");
virtio_gpu_cmd_resource_create_blob(vgdev, curr->bo, &curr->params,
ents, nents);
} else if (curr->params.virgl) {
printk("-yue params.virgl\n");
virtio_gpu_cmd_resource_create_3d(vgdev, curr->bo, &curr->params,
NULL, NULL);
virtio_gpu_object_attach(vgdev, curr->bo, ents, nents);
} else {
printk("-yue else\n");
virtio_gpu_cmd_create_resource(vgdev, curr->bo, &curr->params,
NULL, NULL);
virtio_gpu_object_attach(vgdev, curr->bo, ents, nents);
}
printk("-yue- curr->bo hw_res_handle is %x\n", curr->bo->hw_res_handle);
printk("-yue- ents addr is %llx\n", ents->addr);
}

return ret;
Expand Down
4 changes: 4 additions & 0 deletions drivers/gpu/drm/virtio/virtgpu_prime.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,17 +273,21 @@ struct drm_gem_object *virtgpu_gem_prime_import_sg_table(
__func__, table, table->orig_nents, table->nents);
obj = drm_gem_shmem_prime_import_sg_table(dev, attach, table);
if (IS_ERR(obj)) {
printk("--yue-- IS_ERR\n");
return ERR_CAST(obj);
}

bo = gem_to_virtio_gpu_obj(obj);
printk("--yue-- bo->hw_res_handle is %x \n", bo->hw_res_handle);
ret = virtio_gpu_resource_id_get(vgdev, &bo->hw_res_handle);
if (ret < 0) {
printk("yue- ret < 0\n");
return ERR_PTR(ret);
}

ret = virtio_gpu_sgt_to_mem_entry(vgdev, table, &ents, &nents);
if (ret != 0) {
printk("yue- ret != 0\n");
goto err_put_id;
}

Expand Down
Loading