Received: by 10.223.185.116 with SMTP id b49csp814498wrg; Fri, 23 Feb 2018 07:13:38 -0800 (PST) X-Google-Smtp-Source: AH8x226iHGMjQLvrJ7cIVtV+5DBPZnwAotzgmmga87h0RIS2figQ9zZc+vXGWizcoRBUBEFXfHYV X-Received: by 10.98.102.82 with SMTP id a79mr2114052pfc.138.1519398818695; Fri, 23 Feb 2018 07:13:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519398818; cv=none; d=google.com; s=arc-20160816; b=VrpVpwaR9zh0/wGceMp310uAcegxzWmmX2fvheqJP6OQOUBx5u+mEumv0mHduSZFBp N44uE9Z0X5KUMDfgRuMJFVixnud1K+N7w6Wjr6d8UGRVTNQXedyMDfwDB/p26TlzALmJ sCeKKHLExwYvPbwwVvVuFTjALLDpjvzm9gfBucKLtdsLL0GslsGglSULm9FVelF1Ugvw SY/+8vLf6TzP8S/DRoEatkuYK06b/CdLk6lhG7pO56LYJW9b+WPb7qS7aww4ScB7FgSe wlfoE9wd3/mZPkUy2qBtMpECbNjlFSNJraOlgpwkKXGlhAXIqKzhcHhu0/JnTz0WXYKa 16og== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=Js583oqguslShFJSkOnSLPmefE9TDlONVgLx7e/E38w=; b=znY2dn0+07xZYMAk1lp6Feo0YUJBA2samgYEm2lgkXvkUv5oOnqPcP7NmL2rJa4Fkj 6O5yxU92BLaPlXKK3LRhqfqmlhdfye7UIHCVC5gISZt8NYj9nPygTFwoX4LSafhUgLW2 d082MtjA77BXSMs4nRbQhyUce1tQ8x8NEgYOPu+rAW8vyOplDIjnZg1XHTLdsj2MA98i dbr6wA6x5lxK/S8WaCbLRqEy46tU0YuwOmonM8UvrHn9fqrsZFudL1tZbl/w7ijjA+Ci n52QO8Nq/+gyJxorstpZZ0RJuRG+/S6xSuu2A2cdYxtvsJfrTL8+y8U+QNb3Weg5lSTl Y6Ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=ZYE9j6YE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 70-v6si1914100ple.147.2018.02.23.07.13.24; Fri, 23 Feb 2018 07:13:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=ZYE9j6YE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751952AbeBWPL7 (ORCPT + 99 others); Fri, 23 Feb 2018 10:11:59 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:40722 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751927AbeBWPL5 (ORCPT ); Fri, 23 Feb 2018 10:11:57 -0500 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w1NF2II4136869; Fri, 23 Feb 2018 15:11:46 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=Js583oqguslShFJSkOnSLPmefE9TDlONVgLx7e/E38w=; b=ZYE9j6YEkoKdchKY8YakjD6iGctDBpOIbilKr7NV5Bc+AfT+OU8VjqkVbV16/DdbTdoo 4i7Kk2Wj4kAdIbd0s/75eX2Us1TA9lMx1gu3Orb/mddiY23ElaLfEfWpQ6ykONcTVKuE ceS+E8kHilCTx2uK3wDy1MCjPbIh/P+mWwbQyHvVWpUiR4P32rnrD2NA+p6iBU/CEHsV vtD7dks/JX1RIEpNTpBhYdshuLSFetmxEpoHv6nVvwNKkm0rlYuI53asql+m6ogrsa27 +anlFlDCyIvmV9YdD/3PHIdoSAymNIePp2essjyAOUxCg0UQCFGGrq1tcitxD6ESPEda gw== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp2130.oracle.com with ESMTP id 2gampv87km-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 23 Feb 2018 15:11:46 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w1NFBina008475 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 23 Feb 2018 15:11:45 GMT Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w1NFBh8A026124; Fri, 23 Feb 2018 15:11:43 GMT Received: from dhcp-burlington7-2nd-B-east-10-152-55-162.usdhcp.oraclecorp.com (/10.152.32.65) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 23 Feb 2018 07:11:42 -0800 Subject: Re: [PATCH 6/9] drm/xen-front: Introduce DRM/KMS virtual display driver To: Oleksandr Andrushchenko , 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, konrad.wilk@oracle.com Cc: Oleksandr Andrushchenko References: <1519200222-20623-1-git-send-email-andr2000@gmail.com> <1519200222-20623-7-git-send-email-andr2000@gmail.com> From: Boris Ostrovsky Message-ID: <9081e140-dd0e-bb55-240f-77ff19a33f3c@oracle.com> Date: Fri, 23 Feb 2018 10:12:21 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <1519200222-20623-7-git-send-email-andr2000@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8812 signatures=668677 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=2 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1802230189 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/21/2018 03:03 AM, Oleksandr Andrushchenko wrote: > + > +struct drm_driver xen_drm_driver = { > + .driver_features = DRIVER_GEM | DRIVER_MODESET | > + DRIVER_PRIME | DRIVER_ATOMIC, > + .lastclose = lastclose, > + .gem_free_object_unlocked = free_object, > + .gem_vm_ops = &xen_drm_vm_ops, > + .prime_handle_to_fd = drm_gem_prime_handle_to_fd, > + .prime_fd_to_handle = drm_gem_prime_fd_to_handle, > + .gem_prime_import = drm_gem_prime_import, > + .gem_prime_export = drm_gem_prime_export, > + .gem_prime_get_sg_table = prime_get_sg_table, > + .gem_prime_import_sg_table = prime_import_sg_table, > + .gem_prime_vmap = prime_vmap, > + .gem_prime_vunmap = prime_vunmap, > + .gem_prime_mmap = prime_mmap, > + .dumb_create = dumb_create, > + .fops = &xendrm_fops, > + .name = "xendrm-du", > + .desc = "Xen PV DRM Display Unit", > + .date = "20161109", You must have been working on this for a while ;-) I assume this needs to be updated. > +bool xen_drm_front_drv_is_used(struct platform_device *pdev) > +{ > + struct xen_drm_front_drm_info *drm_info = platform_get_drvdata(pdev); > + struct drm_device *dev; > + > + if (!drm_info) > + return false; > + > + dev = drm_info->drm_dev; > + if (!dev) > + return false; > + > + /* > + * FIXME: the code below must be protected by drm_global_mutex, > + * but it is not accessible to us. Anyways there is a race condition, > + * but we will re-try. > + */ > + return dev->open_count != 0; Would it be a problem, given the race, if you report that the frontend is not in use, while it actually is? -boris