From patchwork Thu Mar 29 09:24:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksandr Andrushchenko X-Patchwork-Id: 10314807 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 4666D6037E for ; Thu, 29 Mar 2018 09:24:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3B35F284B3 for ; Thu, 29 Mar 2018 09:24:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2CC162A2D7; Thu, 29 Mar 2018 09:24:41 +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 BE98F284B3 for ; Thu, 29 Mar 2018 09:24:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3A87D89F1B; Thu, 29 Mar 2018 09:24:39 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf0-x229.google.com (mail-lf0-x229.google.com [IPv6:2a00:1450:4010:c07::229]) by gabe.freedesktop.org (Postfix) with ESMTPS id 653E489F1B for ; Thu, 29 Mar 2018 09:24:37 +0000 (UTC) Received: by mail-lf0-x229.google.com with SMTP id x70-v6so622324lfa.0 for ; Thu, 29 Mar 2018 02:24:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=JhjEFEpt17PUoSLNx7uJCtbJQwYIZ5xZDyjqSSSR5ag=; b=NKQoY7D6wZpHgKwfeMIlG07aw+KuAAyMNgyR1RXtV+qYZAfvaT6nRlE3WJ/UcbDSlt te9p5Ho3/apr0KNORG+C41NqKg5EewZWw+ZnXFufE67PtfyGiL6CdLmGWwgDwVCUlTkb SbiZyCSjhfSCBXeIxk7GkMED1zhzNhq4eUm0w6CM+d/UGMrnv9aohuYATlOLsLTzAQba FZEnzJAzuxrA+tUSuI6PS+ra59TauEFaBfRlh2H9aGCKVjcXASsYQpxAmMrF53LhEIbv nqPvMXrZ3iy0WTtDTGWCji8WVuF9oa/hZtZEC0wvQ9/GAIbpjt5S9P/UpwfV99XQgWGU 8Izg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language; bh=JhjEFEpt17PUoSLNx7uJCtbJQwYIZ5xZDyjqSSSR5ag=; b=LQBmXcWubQhd/Gdp5wmRdCN9WsYAiTfan1lpC8/dZNQyrIOf2L+d7cI1Knfj09mnbT /qI0DFmygrP+UXcHseL00SYxe+oR9LduKIpATtanH3l8EdFc/Nfd43x+VtaAgnFjH4mC nNVYV7zYFljKyDxD4qCpgyfR7878X/AyKnP8PM0jzhLJaQnWXVprAK++4Vmk+wQTut1D PW/y6IIZroiREKU6zMtrTJnYt+h92kSgZMSo6nC7jUuk5pxOM+qH3/VRQ5boVI2JqDvF Be+TEQySTwITESoLjdX27SamaGpUYzc5Az97S/c7EiUzL4IS3sO++e8CbyvkwxCjDOuP 6fHg== X-Gm-Message-State: AElRT7GaW7hfPHSY9fRvjLS2bCTAFeND+Q1yOq7j5GEQ9C/UBtnAulxm vasLKkBOb9trP5wPoUFrRDE= X-Google-Smtp-Source: AIpwx48KCnAtXux9WbMLQ6xetneJ7jNHLe5Vnol1mj68yOM0h0T2045UGQZdA6IpTyQumf3gQmfyCA== X-Received: by 10.46.91.21 with SMTP id p21mr5109868ljb.38.1522315475788; Thu, 29 Mar 2018 02:24:35 -0700 (PDT) Received: from [10.17.182.9] (ll-59.209.223.85.sovam.net.ua. [85.223.209.59]) by smtp.gmail.com with ESMTPSA id f200-v6sm1067138lff.35.2018.03.29.02.24.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Mar 2018 02:24:34 -0700 (PDT) Subject: Re: [PATCH v5 0/1] drm/xen-front: Add support for Xen PV display frontend To: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, airlied@linux.ie, daniel.vetter@intel.com, seanpaul@chromium.org, gustavo@padovan.org, jgross@suse.com, boris.ostrovsky@oracle.com, konrad.wilk@oracle.com References: <20180329092247.23905-1-andr2000@gmail.com> From: Oleksandr Andrushchenko Message-ID: <7d9511c8-c3ed-b834-3f23-9664281d4468@gmail.com> Date: Thu, 29 Mar 2018 12:24:33 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180329092247.23905-1-andr2000@gmail.com> Content-Language: en-US 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: Oleksandr Andrushchenko Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP On 03/29/2018 12:22 PM, Oleksandr Andrushchenko wrote: > Changes since v4: For your convenience I am attaching diff between v4..v5 diff --git a/Documentation/gpu/xen-front.rst b/Documentation/gpu/xen-front.rst index 8188e03c9d23..009d942386c5 100644 --- a/Documentation/gpu/xen-front.rst +++ b/Documentation/gpu/xen-front.rst @@ -1,6 +1,6 @@ -==================================== -Xen para-virtualized frontend driver -==================================== +==================================================== + drm/xen-front Xen para-virtualized frontend driver +==================================================== This frontend driver implements Xen para-virtualized display according to the display protocol described at diff --git a/drivers/gpu/drm/xen/xen_drm_front_evtchnl.c b/drivers/gpu/drm/xen/xen_drm_front_evtchnl.c index e521785fd22b..02b6f3d9fe4c 100644 --- a/drivers/gpu/drm/xen/xen_drm_front_evtchnl.c +++ b/drivers/gpu/drm/xen/xen_drm_front_evtchnl.c @@ -186,8 +186,10 @@ static int evtchnl_alloc(struct xen_drm_front_info *front_info, int index, sring, XEN_PAGE_SIZE); ret = xenbus_grant_ring(xb_dev, sring, 1, &gref); - if (ret < 0) + if (ret < 0) { + free_page(page); goto fail; + } handler = evtchnl_interrupt_ctrl; } else { @@ -195,8 +197,10 @@ static int evtchnl_alloc(struct xen_drm_front_info *front_info, int index, ret = gnttab_grant_foreign_access(xb_dev->otherend_id, virt_to_gfn((void *)page), 0); - if (ret < 0) + if (ret < 0) { + free_page(page); goto fail; + } gref = ret; handler = evtchnl_interrupt_evt; diff --git a/drivers/gpu/drm/xen/xen_drm_front_kms.c b/drivers/gpu/drm/xen/xen_drm_front_kms.c index 545049dfaf0a..f3ef9dfb4dfb 100644 --- a/drivers/gpu/drm/xen/xen_drm_front_kms.c +++ b/drivers/gpu/drm/xen/xen_drm_front_kms.c @@ -107,12 +107,13 @@ static void send_pending_event(struct xen_drm_front_drm_pipeline *pipeline) } static void display_enable(struct drm_simple_display_pipe *pipe, - struct drm_crtc_state *crtc_state) + struct drm_crtc_state *crtc_state, + struct drm_plane_state *plane_state) { struct xen_drm_front_drm_pipeline *pipeline = to_xen_drm_pipeline(pipe); struct drm_crtc *crtc = &pipe->crtc; - struct drm_framebuffer *fb = pipe->plane.state->fb; + struct drm_framebuffer *fb = plane_state->fb; int ret, idx; if (!drm_dev_enter(pipe->crtc.dev, &idx)) @@ -273,7 +274,7 @@ static void display_update(struct drm_simple_display_pipe *pipe, drm_dev_exit(idx); } -enum drm_mode_status display_mode_valid(struct drm_crtc *crtc, +static enum drm_mode_status display_mode_valid(struct drm_crtc *crtc, const struct drm_display_mode *mode) { struct xen_drm_front_drm_pipeline *pipeline =