From patchwork Wed Nov 8 18:42:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lepton Wu X-Patchwork-Id: 10050553 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 61EE9601EA for ; Thu, 9 Nov 2017 09:13:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 558522ABFF for ; Thu, 9 Nov 2017 09:13:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4A7802AC07; Thu, 9 Nov 2017 09:13:12 +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=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID 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 152AC2ABFF for ; Thu, 9 Nov 2017 09:13:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 583096E89A; Thu, 9 Nov 2017 09:12:39 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-io0-x242.google.com (mail-io0-x242.google.com [IPv6:2607:f8b0:4001:c06::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 22142897D4 for ; Wed, 8 Nov 2017 18:42:24 +0000 (UTC) Received: by mail-io0-x242.google.com with SMTP id 189so7001207iow.10 for ; Wed, 08 Nov 2017 10:42:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=BbK/Ag3ADW16d5cGdYzKI3jUEWGoc/5xw0KDswiHWL8=; b=cN33IASuEjXOGGMvMmF0qvn4NSQrszYfv9VZCHqFqs/GrtXbdxnYCGkxVJxFwgxb/q 3GaSUg+Q648EisoDqqyeYzz9m8sjIVGs5deHoeEHbzAuB3PNRhyB9mDZLrdaEr1HC2MX H4lI7XY+BxkdSR2JPRtcpb6M+Ht/2A5OrP+8/cgYmymHkY6k4MGRCjyOw2D/rcfnGK7l PLIfyi0vuTvYQanZmjJyd+cKWxpLdvMMbMzvjHcrHAySmJVqWVO4WXNLIjGqaOMTrZ67 ftoB3Zy6wqr76pNH4VDwRKvqHJKn5wbj6i6SQrFfdwOqbUzeomG38eMb1CFozt4awgFs VZhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=BbK/Ag3ADW16d5cGdYzKI3jUEWGoc/5xw0KDswiHWL8=; b=P/xb7zhd2Yg8IltLVSgmfuFb9888twnPSNOnBIaI+Bb19BpwfcsKJc0j172oPftERn OTbwdsU3Du+uqfJ0HT7a3jKodME0FQ4FQqrBvOQ1vdcKVy1nFiYkZ8I0Nmqm835bRPQ2 CNHM9uh+0wZzUuoJ28nV1xcl+iVK/MVOONnpctvJ7o1ub350C6Qj+pnvnEBP8dO5ED+5 NWeqfOvD6GbDT73Ko7joEJIH+h8f8KzMgHHFV2nTutooE/E5o4A/OXILGTy35quCpvyD yEHeoFOJWFxRkMO7cU7E/QryZiJySeFRvYl+MUZ/iBpaEtL+mccKdhPg7DXOPVtABu4s 2wjw== X-Gm-Message-State: AJaThX6XZeMYtHIwsHE8U8r7BQmGxpr24ZpenafBLqbQDBtspkfP2pBg RxBQF+4l1NNRe81gktjeLw8= X-Google-Smtp-Source: AGs4zMa9q5/hOcw7UhD6PxyFfQTpnmEj1iABAd8n3Kb/5ek308U/Fu+JQ8srbhVJtH2CXgr4ISPdCA== X-Received: by 10.107.145.86 with SMTP id t83mr1796009iod.190.1510166544186; Wed, 08 Nov 2017 10:42:24 -0800 (PST) Received: from paxos.mtv.corp.google.com ([2620:0:1000:1611:7567:9b12:9a7b:9aa0]) by smtp.gmail.com with ESMTPSA id b66sm2506909itb.17.2017.11.08.10.42.22 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 Nov 2017 10:42:23 -0800 (PST) From: Lepton Wu To: airlied@linux.ie, kraxel@redhat.com Subject: [PATCH] drm/virtio: add create_handle support. Date: Wed, 8 Nov 2017 10:42:09 -0800 Message-Id: <20171108184209.46211-1-ytht.net@gmail.com> X-Mailer: git-send-email 2.15.0.403.gc27cc4dac6-goog In-Reply-To: <20171108125659.oyjzylx26zmz7753@phenom.ffwll.local> References: <20171108125659.oyjzylx26zmz7753@phenom.ffwll.local> X-Mailman-Approved-At: Thu, 09 Nov 2017 09:12:32 +0000 Cc: Lepton Wu , dri-devel@lists.freedesktop.org, virtualization@lists.linux-foundation.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Add create_handle support to virtio fb. Without this, screenshot tool in chromium OS can't work. Signed-off-by: Lepton Wu --- drivers/gpu/drm/virtio/virtgpu_display.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/gpu/drm/virtio/virtgpu_display.c b/drivers/gpu/drm/virtio/virtgpu_display.c index b6d52055a11f..274b4206ca96 100644 --- a/drivers/gpu/drm/virtio/virtgpu_display.c +++ b/drivers/gpu/drm/virtio/virtgpu_display.c @@ -71,7 +71,19 @@ virtio_gpu_framebuffer_surface_dirty(struct drm_framebuffer *fb, return virtio_gpu_surface_dirty(virtio_gpu_fb, clips, num_clips); } +static int +virtio_gpu_framebuffer_create_handle(struct drm_framebuffer *fb, + struct drm_file *file_priv, + unsigned int *handle) +{ + struct virtio_gpu_framebuffer *virtio_gpu_fb = + to_virtio_gpu_framebuffer(fb); + + return drm_gem_handle_create(file_priv, virtio_gpu_fb->obj, handle); +} + static const struct drm_framebuffer_funcs virtio_gpu_fb_funcs = { + .create_handle = virtio_gpu_framebuffer_create_handle, .destroy = virtio_gpu_user_framebuffer_destroy, .dirty = virtio_gpu_framebuffer_surface_dirty, };