From patchwork Tue Jul 3 15:33:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Souptick Joarder X-Patchwork-Id: 10506051 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 69200603D7 for ; Wed, 4 Jul 2018 07:05:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 50BC928CF0 for ; Wed, 4 Jul 2018 07:05:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 43A4728CF8; Wed, 4 Jul 2018 07:05:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0208E28CF0 for ; Wed, 4 Jul 2018 07:05:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6E5036EA9F; Wed, 4 Jul 2018 07:04:18 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg0-x241.google.com (mail-pg0-x241.google.com [IPv6:2607:f8b0:400e:c05::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id D56ED6E7F7 for ; Tue, 3 Jul 2018 15:31:29 +0000 (UTC) Received: by mail-pg0-x241.google.com with SMTP id m19-v6so1148035pgv.3 for ; Tue, 03 Jul 2018 08:31:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=U5UcmPhLZVTrhjmGntLj2MrAGsTIp95syWuiee4K5kg=; b=ozj6GxztEU/SrXKhZEFRHyhY5Cva5r9ZMJrIYBKrZenNv47qSK1gGO0VCtDxMeMBs9 b5HRvve4XMfqM6f5q8Rc6hAa9cYhtHDduCJx8Gr0O3basrmD0tkgn6+vXcEUAfAY84It i3nwzKXYPrn0mINgoEtIUdlI7Ojb4dhVtCn5zPIZYheD7EiqHRzx+tpNSpMAcuGm0qKs A/NakAnKAzkYYCJxVq3GS2cIXI9DX5+2U8/B2oE11W1Ot/Vvs3dZcb6jPJc1fhn1iOra 4LHxUS2+treGkn/+oTFE/luqZwU30f3qLdqljQuCo6ZOHWZZTFccaq0u8MBE6whHqnlv vH/Q== X-Gm-Message-State: APt69E3WTP9SIQDWfHWSgp7updZfRUucYbKde4oPW6tBI4rD6pojzaX0 xbLZTAnyoAGdRq8tGB4rFnjsyQ== X-Google-Smtp-Source: ADUXVKI2jSQ8Mlpc/qGL52dTaK6Zz+FhcnQ2lSiau/M8e5ULn+ieZJNJOub3LjWRLavm6COjvgI15A== X-Received: by 2002:a63:2c9:: with SMTP id 192-v6mr26536418pgc.354.1530631889265; Tue, 03 Jul 2018 08:31:29 -0700 (PDT) Received: from jordon-HP-15-Notebook-PC ([183.82.19.17]) by smtp.gmail.com with ESMTPSA id z19-v6sm2761850pfe.163.2018.07.03.08.31.26 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 03 Jul 2018 08:31:27 -0700 (PDT) Date: Tue, 3 Jul 2018 21:03:53 +0530 From: Souptick Joarder To: airlied@linux.ie, kraxel@redhat.com Subject: [PATCH v2] gpu: drm: virtio: code cleanup Message-ID: <20180703153353.GA3375@jordon-HP-15-Notebook-PC> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-Mailman-Approved-At: Wed, 04 Jul 2018 07:04:13 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ajitn.linux@gmail.com, svptas.linux@gmail.com, sabyasachi.linux@gmail.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, virtualization@lists.linux-foundation.org, brajeswar.linux@gmail.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 --- v2: corrected subject line 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,