* [PATCH] gpu: drm: virito: code cleanup
@ 2018-07-02 18:27 Souptick Joarder
2018-07-03 6:28 ` Gerd Hoffmann
0 siblings, 1 reply; 3+ messages in thread
From: Souptick Joarder @ 2018-07-02 18:27 UTC (permalink / raw)
To: airlied, kraxel
Cc: dri-devel, virtualization, linux-kernel, svptas.linux,
ajitn.linux, brajeswar.linux, sabyasachi.linux
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.
Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
---
drivers/gpu/drm/virtio/virtgpu_ttm.c | 36 +-----------------------------------
1 file changed, 1 insertion(+), 35 deletions(-)
diff --git a/drivers/gpu/drm/virtio/virtgpu_ttm.c b/drivers/gpu/drm/virtio/virtgpu_ttm.c
index 11f8ae5..b6f021c 100644
--- a/drivers/gpu/drm/virtio/virtgpu_ttm.c
+++ b/drivers/gpu/drm/virtio/virtgpu_ttm.c
@@ -106,29 +106,6 @@ static void virtio_gpu_ttm_global_fini(struct virtio_gpu_device *vgdev)
}
}
-#if 0
-/*
- * Hmm, seems to not do anything useful. Leftover debug hack?
- * Something like printing pagefaults to kernel log?
- */
-static struct vm_operations_struct virtio_gpu_ttm_vm_ops;
-static const struct vm_operations_struct *ttm_vm_ops;
-
-static int virtio_gpu_ttm_fault(struct vm_fault *vmf)
-{
- struct ttm_buffer_object *bo;
- struct virtio_gpu_device *vgdev;
- int r;
-
- bo = (struct ttm_buffer_object *)vmf->vma->vm_private_data;
- if (bo == NULL)
- return VM_FAULT_NOPAGE;
- vgdev = virtio_gpu_get_vgdev(bo->bdev);
- r = ttm_vm_ops->fault(vmf);
- return r;
-}
-#endif
-
int virtio_gpu_mmap(struct file *filp, struct vm_area_struct *vma)
{
struct drm_file *file_priv;
@@ -143,19 +120,8 @@ int virtio_gpu_mmap(struct file *filp, struct vm_area_struct *vma)
return -EINVAL;
}
r = ttm_bo_mmap(filp, vma, &vgdev->mman.bdev);
-#if 0
- if (unlikely(r != 0))
- return r;
- if (unlikely(ttm_vm_ops == NULL)) {
- ttm_vm_ops = vma->vm_ops;
- virtio_gpu_ttm_vm_ops = *ttm_vm_ops;
- virtio_gpu_ttm_vm_ops.fault = &virtio_gpu_ttm_fault;
- }
- vma->vm_ops = &virtio_gpu_ttm_vm_ops;
- return 0;
-#else
+
return r;
-#endif
}
static int virtio_gpu_invalidate_caches(struct ttm_bo_device *bdev,
--
1.9.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] gpu: drm: virito: code cleanup
2018-07-02 18:27 [PATCH] gpu: drm: virito: code cleanup Souptick Joarder
@ 2018-07-03 6:28 ` Gerd Hoffmann
2018-07-03 6:34 ` Souptick Joarder
0 siblings, 1 reply; 3+ messages in thread
From: Gerd Hoffmann @ 2018-07-03 6:28 UTC (permalink / raw)
To: Souptick Joarder
Cc: airlied, dri-devel, virtualization, linux-kernel, svptas.linux,
ajitn.linux, brajeswar.linux, sabyasachi.linux
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] gpu: drm: virito: code cleanup
2018-07-03 6:28 ` Gerd Hoffmann
@ 2018-07-03 6:34 ` Souptick Joarder
0 siblings, 0 replies; 3+ messages in thread
From: Souptick Joarder @ 2018-07-03 6:34 UTC (permalink / raw)
To: Gerd Hoffmann
Cc: airlied, dri-devel, virtualization, linux-kernel, SUMAN TRIPATHI,
ajitn.linux, brajeswar.linux, Sabyasachi Gupta
On Tue, Jul 3, 2018 at 11:58 AM, Gerd Hoffmann <kraxel@redhat.com> wrote:
> 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.
>
Ahh, typos. I will send v2 after correction.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-07-03 6:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-02 18:27 [PATCH] gpu: drm: virito: code cleanup Souptick Joarder
2018-07-03 6:28 ` Gerd Hoffmann
2018-07-03 6:34 ` Souptick Joarder
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®