From patchwork Thu Jul 6 20:16:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felix Kuehling X-Patchwork-Id: 9829001 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 68C2B602CA for ; Thu, 6 Jul 2017 20:52:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 598A628583 for ; Thu, 6 Jul 2017 20:52:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4C9252858D; Thu, 6 Jul 2017 20:52:11 +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=-2.6 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_WEB, 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 A921428583 for ; Thu, 6 Jul 2017 20:52:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A2A426E04E; Thu, 6 Jul 2017 20:52:09 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 1137 seconds by postgrey-1.35 at gabe; Thu, 06 Jul 2017 20:52:07 UTC Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0052.outbound.protection.outlook.com [104.47.32.52]) by gabe.freedesktop.org (Postfix) with ESMTPS id DCA0D6E04E for ; Thu, 6 Jul 2017 20:52:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=KkAMEcXId8y8AdZYbcZPJ6F+MpSOwVhz3E0XrkJXJt0=; b=xj+8RpX8WhEgfkeBaVFespqNCjYbr9PkZL2TE1fgUuTRAgVJQEoqbPxSPNZDfMYlBT++Hgrh23zVrFaQn24furdOylUHm2FD1p3qraJX2Xtj4xWBdrTNGyHs3PAQV0OUJwefXjifPQwFzu/vI6tCX6y28CTt9pXviMIeBkXAg7w= Authentication-Results: lists.freedesktop.org; dkim=none (message not signed) header.d=none; lists.freedesktop.org; dmarc=none action=none header.from=amd.com; Received: from Harpoon.amd.com (165.204.55.251) by CY4PR1201MB0232.namprd12.prod.outlook.com (10.172.79.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1220.11; Thu, 6 Jul 2017 20:17:13 +0000 From: Felix Kuehling To: amd-gfx@lists.freedesktop.org Subject: [PATCH 1/6] drm: Add helper to check exporting driver of a DMA-buf Date: Thu, 6 Jul 2017 16:16:22 -0400 Message-Id: <1499372187-18375-2-git-send-email-Felix.Kuehling@amd.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1499372187-18375-1-git-send-email-Felix.Kuehling@amd.com> References: <1499372187-18375-1-git-send-email-Felix.Kuehling@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.55.251] X-ClientProxiedBy: MWHPR2001CA0006.namprd20.prod.outlook.com (10.172.58.144) To CY4PR1201MB0232.namprd12.prod.outlook.com (10.172.79.9) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b63cc1f2-3efa-4895-d0ae-08d4c4abfdc2 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(48565401081)(300000503095)(300135400095)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:CY4PR1201MB0232; X-Microsoft-Exchange-Diagnostics: 1; CY4PR1201MB0232; 3:WbfCFYNG34AEIsxxsHfc5uS4qDbbH/n+s/PBzIimBmWWmB9ugn0YkfYBZ5qSk3qKhPLZLAo2ZRiaRu4DNci7i+3SiUhW9qBkgsIhvo/f4hRBmCj5/qZd7v19+7QpnKmqLQwLvRUUjFRlhJKLhPXEWMFcOUgg/pGNU2adnrd2sK4iuQtZrVkpC88nLPWX7uCXWUIU0QM+3h6hdsg4t19Y89cwZ9aHtXTTEjc5vUCj1oX8ny1Oq6QRPsnwySbNAi4MppoGUkYQgu77MiakXUXldtoDyL446HwoJL32woxQNFHLQB+jBBMZUnbil/YUV/1S6tKIpoNJyHxX5hPetisgBDOR55ibgFnRIzxKbxdirH/fmYrj69yB+AsNljnP/WoTCzBJTnbYTf9XuROm2OGoyvBxmUmowUdZesv/iUKhhi4/rg3P+NA8SNB24sMsbYkNkcNN2zgv8MYsz7mNj6Qbw9IpdRwihEWsP1LGeCif+6yzuCMY5IuQr5oUPr2ItiDRx5P0l+T6i64oJ2ojPP4qugNGHFS4BQraTf/giwSKNfcqF7FhToK7FJqmxajL771Q+ZrKSCgQWJpKZeltze/hnZy0Ak8Q/L4aJeOBFYONvdtDRhwdhYGnaRZoaFpAMGYUVJR+v62vrHhOKMVUWJEqqQZYwKUR3wKAT7UHF5WB52gl2x8X//e+U2T/r3LuChC9nCeun957MO7N9TtNqC1AvNL8OFAp7tmApn7Qi1AMVo8BrPnOIStD1goHOsDn2NwPR0kDM2lkRoEnwwAdax1VRQ== X-MS-TrafficTypeDiagnostic: CY4PR1201MB0232: X-Microsoft-Exchange-Diagnostics: 1; CY4PR1201MB0232; 25:tIt/9VBL92lCTUNTLHCx/f8o6Mx2/I9H02dE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9zrFEbAWkTmK X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(236129657087228)(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(3002001)(100000703101)(100105400095)(93006095)(93001095)(10201501046)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123558100)(20161123555025)(20161123560025)(20161123564025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY4PR1201MB0232; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY4PR1201MB0232; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR1201MB0232; 4:jNaO2gPjYoQkmUSTbzV0XBO6jhcU6hL3be5GCH3j?= =?us-ascii?Q?PJ2b7cie3OQi4GP38b2obDMHqIZnEaaij4rpQshmBTVLInygYX5y25FcYiAz?= =?us-ascii?Q?e9G5Vh/qM34gxF033F9n11f4nNj78/5f3ZMYWuYw4RgwcD8wBEldckLdSd2l?= =?us-ascii?Q?OwrAY2wSNqS0FnJy1ZqexXtgc9Aq7ZOYT0hX+rIOd+hW8yHx6o675r1n6pBN?= =?us-ascii?Q?ghyJGG09PnnuumaajimLO4cKIX/+f2u7zbT1MdmF3jxUTV3M8h1D/NYw80N5?= =?us-ascii?Q?Dq2sU+ZhhK4+tXVLEcqvSVAkKtOsEowxp2lnzQoYRrIFVXivzfKAQfYMC6GM?= =?us-ascii?Q?Ib3MQB6XPlfVZp8QE2QL8zptIBYIvCFoj924eXwpf1R9pdwSa2J4vyWgyMSV?= =?us-ascii?Q?dwporyh8Ds3pzc6NJhYLnodtegRZ503eot+Ug/U/YJ5NP/jPPmL4wMvOzMt0?= =?us-ascii?Q?RryVF9o/Q4zx2JIa+wC4pJrmdVVPpG+jqssltOk+K3Moj/hVgw3dKll3O/yd?= =?us-ascii?Q?uOXrhIxm0HdmZG1p2oX/RvINkK34ICf+o6NdcZkqGoHczBfq+yW8Ilt+qtrO?= =?us-ascii?Q?inK5e8i1+PRmABRrYbYEGFXPpYQnVCeBCF5rjhfeml/Y66w6xPCed5Rfqqlf?= =?us-ascii?Q?p/YWbR5AWLPTaxCCWhr7b19SmmkJU6MPuKODTGC77UrKexsZrbMXQmQ8BxPL?= =?us-ascii?Q?GWbjmCmyuCUt49ghGJPtX0RgXEpdK6IghHO0UHTpcjvA7nUYHpoWDDwjmt+T?= =?us-ascii?Q?9wIwZmE+J57U12F3gGSSyvtwBXPoT4zfgRBow0oN4ROKS6b1nML76nWVESfC?= =?us-ascii?Q?CL+JJtqfs31HQeAVRwV3ikt+/A7Vdg6xPylLk6UHZhL2LJ/pZ1tkwzXkDQe+?= =?us-ascii?Q?J7BpozwDdDYzjPOfOZFSS6ucvbkQoykhfrd5xXX8V+go36v7HuDewr5bYWNt?= =?us-ascii?Q?93VQHIAFV4ZVCMBotMn1TAkd1Pye0JI5kAxztgLgl/5iy+lGrnZzz08f/r8k?= =?us-ascii?Q?TzHlhuOuXN5vWZCPoHgYeHxlgbTK+nYr3K7mN9LuXPQpsXN0KBBZLnK0QRuK?= =?us-ascii?Q?DBkUfXF7YLEJCI7wyer03zsey9veUINyaapSeNy8vaUrChZkGh4UUeaI/csU?= =?us-ascii?Q?v42O13WLZmyS3OX2FS2Io3sI8TDHXFXiPZTpCA482OROhHG8HPuD5zIXdN11?= =?us-ascii?Q?jK5Cd7gEdGVzWh0JfFDRKHTQquvQmicbuKIdSwdYI8aNFZ5FTfzKf1mXdg?= =?us-ascii?Q?=3D=3D?= X-Forefront-PRVS: 03607C04F0 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(39450400003)(39410400002)(39400400002)(39850400002)(39860400002)(39840400002)(66066001)(48376002)(50466002)(38730400002)(47776003)(36756003)(110136004)(5660300001)(4326008)(86362001)(72206003)(53416004)(42186005)(450100002)(2906002)(76176999)(50986999)(25786009)(305945005)(2351001)(7736002)(6486002)(478600001)(189998001)(8676002)(5003940100001)(6116002)(6666003)(50226002)(3846002)(2361001)(2950100002)(81166006)(6916009)(53936002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR1201MB0232; H:Harpoon.amd.com; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR1201MB0232; 23:a7JEHl9B7Y8uPyyjYd701JxZ1jY1mUL2iUyaNNm?= =?us-ascii?Q?P6lZiohSDKSx3sgGD8CHZXIAbK4pDLsiykUF87mBXRscHouYdoxfwPnt45zF?= =?us-ascii?Q?1fI3/kfctctvgE7Df2iRpkX5j+7WXGQdZkKQb3Jukbc2AECmRdwVrEfSvnt4?= =?us-ascii?Q?xMg/ht6j80oX+8ZOZQ/uIvtXjc6ZJweYUz9e2rpmhpuo6mOxrNvoqc0JWQA2?= =?us-ascii?Q?NLZ2qzZhlI4AgQQcxS1QakDO1fcDF7egtLV6EEnpUPe0SKFskV5WvmWYfd3K?= =?us-ascii?Q?bH+nmdrS9zNVbfDXv0GaOnkQF3T5eAhTnnJVefdLyzZIB7v5aSvoLLA9uvYI?= =?us-ascii?Q?NKuSqx2q2oe6AbOBSYf+XwKEy4YCwKKFtpko2YwsevEpNzMIVtyHJxa0ldYI?= =?us-ascii?Q?595iCU4QNeQS0Ix/60Ul5x/QiV49k0J5fl63bc3ttaGtJL4L8TdN2UUoyuRu?= =?us-ascii?Q?pKnCWJcGcO4YsUUWkCiRUPf4thVHsX9sQnsAHxovImMwqkxWoRPBtQwGS7Wl?= =?us-ascii?Q?UQn9Oj53XHEMEK1aLSVuee5Kf/HLjCi/lmLhbfFAdi/nGi8TEHMxI7hHUgTN?= =?us-ascii?Q?CZm+kRbSN2zrN6evnnNRLeGiZCoFXt03rNKvt1U9J3xVQxd/2xJgZYhS4iyJ?= =?us-ascii?Q?4HX8c4od6ztru5FJAM4BusyIWTcDQkweg6LEyDANGQqRS5+mO9MVRdysbqm5?= =?us-ascii?Q?pFE6rBuqjvVOtB9XK0in4cAF54TJg16JkyvfVYlcvy2r4Sp0hbKDzXMLjDC3?= =?us-ascii?Q?T8xvjVo5+19+aAxibZeYn0awBsrmPPXZHPCwBQHmD5ynpQtNsXqDgwdyTKOE?= =?us-ascii?Q?d5e38jQQwwUbimiwkHkoi4JsFl/qUTrfAkiXfNUY2sPnGW9NIvrqgOdKX4xT?= =?us-ascii?Q?D1yk5W2k7wn0PIPSjXurUcxtd0n8cr6yFe1mEyAU1/4C7Yc0cLM4ltsmnaGK?= =?us-ascii?Q?wWyS9Q692QEtdW9Wl21XSsqyMAEIA9F2rg/V7TTbhtq5Sih/+QguvRmbLymm?= =?us-ascii?Q?4QwlplzmY3n7IWqX0hRG8ERV8rCwxEZpoII45n3jmtRgfKK+klCW40eiuQ4X?= =?us-ascii?Q?557xch+qyycte7stb1mG7yvizNQz42JY1zqEoYPWVx/9dyxrSKg=3D=3D?= X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR1201MB0232; 6:204dVLk+nk6CUg5U4s+MjuonGETrSehNwxQM9876?= =?us-ascii?Q?/fFgrmGDyHD/8sFCUAo9s6kdYQ6auW7Rn1vizCffxxVjJyFvAQP5FyaGk6S5?= =?us-ascii?Q?n8/K+k1ZbMFQyMB+yNgj3eRE53P0UjTAQq65etvPmpr3p6WyY4OnZcuBHl4e?= =?us-ascii?Q?4JKRB2D/OlkEghEkCPPZFke+uv698tdmu8RUgMkn+bktGFvYve50JRSWPccq?= =?us-ascii?Q?xChRIJsD1m0jyWue7DurKEBF4l+E/gDpIc2/5S4cPBvhcRzrmBRjMh4kfwaX?= =?us-ascii?Q?8UAT4Y2os+aDJ9aX3EjyIHhW2uxPdLHC5hQaFfc7sVPgJ4mxAGeXJ8NCfmSV?= =?us-ascii?Q?RvYiz9PYMkAC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UglncV716v/4RkL3Em71VMvqYgcpul1BY/1GlIuykmRRXxne9a7lyVEu7YiSRglylOe6CEmfEEayq7ouY9/DQt2IUlTkhYWrEG8OqISsJHpqiah+8C63sLJwe175DSdodZFqSry5pItyVtRA3ITzy6DoeCwf0vSe4TCuHfcK8LyyKWp+2LF8fEHh9JgTAyblpb0SHGSiwfijHvi6qMqwA= X-Microsoft-Exchange-Diagnostics: 1; CY4PR1201MB0232; 20:5BCUagEA0wKeZFB1fFNYbTSku2TXP+goiDRxNUrHhJ0sAqh/TrFsKcCGQG6RuhupH1CpYhSImD1bNIZf7J/JYIze+c1Q6jDsI1ul0/Yg9a5re0tOU8AvKrDpj3TpjSUYI8GyhOtgm0MJDN3KG+Kiy5wX/RBKFfFHfQwAZDYnaWM1xMOLdYw45Y/Kq63KA94rAufxaoMuQEIWkyLsrZURp7gICRQFU/M7RKFGXPMIq/BcS3pfycAn5hZSxrnQaWkR X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2017 20:17:13.6772 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1201MB0232 Cc: Felix Kuehling , dri-devel@lists.freedesktop.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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP This allows drivers to check if a DMA-buf contains a GEM object and whether it comes from the same driver. It may be from the same or a different device. Signed-off-by: Felix Kuehling --- drivers/gpu/drm/drm_prime.c | 24 ++++++++++++++++++++++++ include/drm/drmP.h | 2 ++ 2 files changed, 26 insertions(+) diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c index 25aa455..a50baec 100644 --- a/drivers/gpu/drm/drm_prime.c +++ b/drivers/gpu/drm/drm_prime.c @@ -594,6 +594,30 @@ int drm_gem_prime_handle_to_fd(struct drm_device *dev, EXPORT_SYMBOL(drm_gem_prime_handle_to_fd); /** + * drm_gem_prime_dmabuf_is_from_driver - check exporting driver of a dma-buf + * @dma_buf: dma-buf object to check + * @driver: driver that is the expected exporter of the dma-buf + * + * Returns true if @driver exported @dma_buf. Returns false if + * @dma_buf was exported by a different driver. + */ +bool drm_gem_prime_dmabuf_is_from_driver(const struct dma_buf *dma_buf, + const struct drm_driver *driver) +{ + struct drm_gem_object *obj; + + if (dma_buf->ops != &drm_gem_prime_dmabuf_ops) + return false; + + obj = dma_buf->priv; + if (obj->dev->driver != driver) + return false; + + return true; +} +EXPORT_SYMBOL(drm_gem_prime_dmabuf_is_from_driver); + +/** * drm_gem_prime_import - helper library implementation of the import callback * @dev: drm_device to import into * @dma_buf: dma-buf object to import diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 6105c05..052f747 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -767,6 +767,8 @@ extern struct dma_buf *drm_gem_prime_export(struct drm_device *dev, extern int drm_gem_prime_handle_to_fd(struct drm_device *dev, struct drm_file *file_priv, uint32_t handle, uint32_t flags, int *prime_fd); +extern bool drm_gem_prime_dmabuf_is_from_driver(const struct dma_buf *dma_buf, + const struct drm_driver *driver); extern struct drm_gem_object *drm_gem_prime_import(struct drm_device *dev, struct dma_buf *dma_buf); extern int drm_gem_prime_fd_to_handle(struct drm_device *dev,