From patchwork Wed Aug 29 15:34:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Souptick Joarder X-Patchwork-Id: 10581277 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B6F4413AC for ; Thu, 30 Aug 2018 07:39:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A7C262B74E for ; Thu, 30 Aug 2018 07:39:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9C5612B752; Thu, 30 Aug 2018 07:39:34 +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 592872B74E for ; Thu, 30 Aug 2018 07:39:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CAC666E6D3; Thu, 30 Aug 2018 07:39:23 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf1-x442.google.com (mail-pf1-x442.google.com [IPv6:2607:f8b0:4864:20::442]) by gabe.freedesktop.org (Postfix) with ESMTPS id A60E96E58D for ; Wed, 29 Aug 2018 15:31:42 +0000 (UTC) Received: by mail-pf1-x442.google.com with SMTP id h69-v6so2444039pfd.4 for ; Wed, 29 Aug 2018 08:31:42 -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=i5dYOjhNG2gndHKxV80oE9viUYgIRkmhBFBmqtZPAJg=; b=YCJOdDABq03RtZYGJ72xRTho3PSqPhd+7lJ8uh9FINkuq1wJ/L+ZSfvrIqs5o/aG5k wTOwTEuNOEb6okuziy9J0sCf1ZActc7CS275o+o6eVlveBn/TRzELQLzh3GBz2w78AdJ 9zgIpO7+MNO9Z8GFPhSSMsa4cR7EQ1yP6K72VI7kxbIy1I1OusQSHxqSMevL77csnng/ 8qSb8RDZcoD+5Jzv8k3XPDm/GfNg/thr7a7yYUWVbJeQOT6I8+4HosxoV9BKWlywQq3G XMQXdBc6NHLSa2/+aE3Hdw1dfSL1okqn8ntN+HAuZlYb75+zFInJcz6yxfXyiUiZt6a/ lvrQ== X-Gm-Message-State: APzg51B+C054qNVFbtmtUYNTr6gt4yk9v/1wIwTdvuHe3/hcKC7txrU0 8flZyAT6cLd1YmwG6rxC40E= X-Google-Smtp-Source: ANB0VdY5bI4TQ2D1HTxUckkbR5wNueSPuHI62pXDImCdZW061GcfsgD8mgWUPc0rOqaDfM+ZT5xPjw== X-Received: by 2002:a63:e056:: with SMTP id n22-v6mr6081050pgj.205.1535556702232; Wed, 29 Aug 2018 08:31:42 -0700 (PDT) Received: from jordon-HP-15-Notebook-PC ([117.219.202.211]) by smtp.gmail.com with ESMTPSA id f19-v6sm6828581pfd.147.2018.08.29.08.31.39 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 29 Aug 2018 08:31:40 -0700 (PDT) Date: Wed, 29 Aug 2018 21:04:40 +0530 From: Souptick Joarder To: akpm@linux-foundation.org Subject: [PATCH v2] gpu: drm: virtio: code cleanup Message-ID: <20180829153440.GA30850@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: Thu, 30 Aug 2018 07:39:21 +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: airlied@linux.ie, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, willy@infradead.org, virtualization@lists.linux-foundation.org, kraxel@redhat.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 Signed-off-by: Gerd Hoffmann --- 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,