Received: by 10.223.185.116 with SMTP id b49csp822619wrg; Fri, 23 Feb 2018 07:20:55 -0800 (PST) X-Google-Smtp-Source: AH8x227QykidZiX/2fsKAPBvIk/cRIvHHlFmvzs5mJQKGyluVcvzIHNUweY/+AzyoQTPrec4tmA9 X-Received: by 2002:a17:902:8f89:: with SMTP id z9-v6mr2082368plo.370.1519399255196; Fri, 23 Feb 2018 07:20:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519399255; cv=none; d=google.com; s=arc-20160816; b=XDMReVbZ+GbjHGJuvbzQtqgUrGRVYFo2AuOlxkfpDweZn6KkHPe8WtmGbq+XisE2SR 9oGOhMbqsZPPyRYV7yNuF8uWXEwziogTlZpGqZLRcd5cGiVK91ilrzVLNf5uF2v32bn+ 9VypAtSpIs1CgOXmR/FePfUWyhQGEBS4CzZWkXUdfzP3WDw493k8fYojzP5osbmG7jyB 5KeA4xgYKlrRBdw4RPAuo6kiLDQSpJ2VADci6KY4U2EGI/IKfGicetB0Sh6ogJ+fs3O0 SPYo/uqpC1UFpFZLFKwuAdw0AGJQ4FMmTlxjNgmwxXII2QXRq9dsRTfotSyBlU6XBd4y 3v+w== 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=5Fjx8Q+50Gxf7nGkZmPvgfW+Qk539C48PjujJqcoEdU=; b=KxL5ZSdWh1Vj/46/9pLcTHdw5kt9h9KGGESLhZDxU38nysszxw7oSz2nP+0gXz0fpz DoOrOXCr46T3cDFMysy4/EsHS6WbRRV/m/ZXg5JxbbIK9u7L9D4OCxOulFKDfkubNxY4 TTJAB+nvki5tnqXJydkBzRCDHwPsGXa6fiVPtD8VStVVUW7MRhXsWhqkuoxVw4Prda7M 3nGQf71f2I0XEor4WC0XJR/eg/PhYmH64Qek78xioBOVeGzWxiFhfEJW7HbxSO7dZosI K2MwRhg3v4UjHxgA2zVyMOSCRX+hWp+2Uo+N52LSZG+x5S9C1sgbE0JvB3znIZGRbiIP qElg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=d9mj1BsR; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h5si1604555pgs.795.2018.02.23.07.20.39; Fri, 23 Feb 2018 07:20:55 -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=@gmail.com header.s=20161025 header.b=d9mj1BsR; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751750AbeBWPT6 (ORCPT + 99 others); Fri, 23 Feb 2018 10:19:58 -0500 Received: from mail-lf0-f65.google.com ([209.85.215.65]:38453 "EHLO mail-lf0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751360AbeBWPT5 (ORCPT ); Fri, 23 Feb 2018 10:19:57 -0500 Received: by mail-lf0-f65.google.com with SMTP id g72so12847948lfg.5 for ; Fri, 23 Feb 2018 07:19:56 -0800 (PST) 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-transfer-encoding:content-language; bh=5Fjx8Q+50Gxf7nGkZmPvgfW+Qk539C48PjujJqcoEdU=; b=d9mj1BsR2oeyVMowzT+UwIdRXGWmNSOMIVeuz9AUJMBck8XfwJYH0WlN4c9qtVPHxD Qut3DbXAEje3oOfGUdSyGrszjjjMBuCOUfdZUfTZfiASHWXDqI4sHd5gG5t3xuGEbliH q08c2s96LyA8wbb5PtbeMIpD6l1uPsPhmy2vSGeKhMHFwwA/niLzeu5m08B6YJYUr/HV 5xl0Oy127m6sLn4L+xnC0jIgFDdngSX3ljDqfgIWOjNUpnmksSvZI7NHUmBClL8go9/4 BrGdQl7P37oTSCpdyyBjtrtYpT9cXMbIYKPD8smRkdrfm4rfmjn53xgh19LNGq5WI48F avBg== 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-transfer-encoding :content-language; bh=5Fjx8Q+50Gxf7nGkZmPvgfW+Qk539C48PjujJqcoEdU=; b=HF42AydU7WmUTVvVq+oV77JDLF7f2WLQaJQcHYtqBva06Dqmwte7gl2aFW+Cm3BI+O OLIpd7vnMq7n8El1RrCNOvxI6xkvJtE3n/jk2AWML43ElKw+h/dJo8TwwXgvBguMuz9j 7XauSI1pkwWxU517lj5yqdGV7MAL8WJpjbcrKPkN74B7/5Dx4Lc87JBHhrz4h9SwyzCR JBMFJjJ/awG9N2uFeEiY0kkchfkUQ4YRhJ7osHz3fJ97XhmWccHNmDS2zqMjGpPSe2WH ih23HxPIlH7v7r9+eemKAVvD63LRNv1hyezjHtjs6jgxB15buCVEjt9YZtAat9qhV38k TzCQ== X-Gm-Message-State: APf1xPACm/fgrCeeOXxZvguRTHLvqnC91qIX/af6pvmj2rIMdodqmKLV xuejUdDGMwDDT2Z5S6eWeDw= X-Received: by 10.25.161.213 with SMTP id k204mr1560945lfe.127.1519399195765; Fri, 23 Feb 2018 07:19:55 -0800 (PST) Received: from [10.17.182.9] (ll-53.209.223.85.sovam.net.ua. [85.223.209.53]) by smtp.gmail.com with ESMTPSA id i23sm510996lfh.84.2018.02.23.07.19.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Feb 2018 07:19:54 -0800 (PST) Subject: Re: [PATCH 6/9] drm/xen-front: Introduce DRM/KMS virtual display driver To: Boris Ostrovsky , 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> <9081e140-dd0e-bb55-240f-77ff19a33f3c@oracle.com> From: Oleksandr Andrushchenko Message-ID: <5f1d8590-8c74-ac40-896e-06405f23be3a@gmail.com> Date: Fri, 23 Feb 2018 17:19:53 +0200 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: <9081e140-dd0e-bb55-240f-77ff19a33f3c@oracle.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/23/2018 05:12 PM, Boris Ostrovsky wrote: > 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 ;-) yes, this is true ;) > > I assume this needs to be updated. It can be, but I would either stick to the current value for historical reasons or would update it in the final version of the driver, so it reflects the date of issuing ;) >> +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? no, backend will not be able to activate us again > -boris