From patchwork Wed Oct 25 23:02:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepak Sharma X-Patchwork-Id: 10027333 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 E25D46032C for ; Wed, 25 Oct 2017 23:37:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D360A28C73 for ; Wed, 25 Oct 2017 23:37:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C71E728C81; Wed, 25 Oct 2017 23:37:15 +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=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, 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 BC76728C73 for ; Wed, 25 Oct 2017 23:37:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 029FF89B48; Wed, 25 Oct 2017 23:37:13 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 2060 seconds by postgrey-1.35 at gabe; Wed, 25 Oct 2017 23:37:11 UTC Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0085.outbound.protection.outlook.com [104.47.40.85]) by gabe.freedesktop.org (Postfix) with ESMTPS id D025989B48 for ; Wed, 25 Oct 2017 23:37:11 +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=ZaEhHUQxDu6OWqhIKGPQTMdnCvtWwW9a2k2+oP1N//c=; b=xUvLYCVjpqcTgW0c0tBpFbi1l5WDQGg68hLZ/z7AyOyFzqxid+cVOHHPzEeJgp1T5bNwfhfPk4m3xMtvlDEoaOLPpmK1c73iuZu7uOr5FHF3dU87N+1MXd6tN3MXLXtZSCAzycfAVl1P/KSHmzWyn3rO09vvzlaPvFYK2wMKWU0= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Deepak.Sharma@amd.com; Received: from chrome.amd.com (165.204.53.123) by DM5PR1201MB0172.namprd12.prod.outlook.com (10.174.107.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.178.6; Wed, 25 Oct 2017 23:02:49 +0000 From: Deepak Sharma To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/vgem: Fix vgem_init to get drm device avaliable. Date: Wed, 25 Oct 2017 16:02:26 -0700 Message-Id: <20171025230226.6432-1-Deepak.Sharma@amd.com> X-Mailer: git-send-email 2.14.2 MIME-Version: 1.0 X-Originating-IP: [165.204.53.123] X-ClientProxiedBy: CY4PR0601CA0089.namprd06.prod.outlook.com (52.132.96.158) To DM5PR1201MB0172.namprd12.prod.outlook.com (10.174.107.8) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 46ae4bb1-bd75-4c13-f5b6-08d51bfc83ab X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081)(4534020)(4602075)(4627075)(201703031133081)(201702281549075)(2017052603238); SRVR:DM5PR1201MB0172; X-Microsoft-Exchange-Diagnostics: 1; DM5PR1201MB0172; 3:3TcPnw/VQbqa4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3U/zYyyKN0d74hyYbn0zfxK8pwXxIOSOVW6/pOJJ1FRhg0jiLI+R19La7MIUyvZV8d/o+NwGGUkl2pXi9Yb2H9BtFO8wQIZYy8B8Sl84aXNHtRRTXG600xYHbiVVfr3fyEM9gEYrByzuVQNybDiMnkvGbNP2sY0Nz+I1TuZe8TxfL0hixbrQLmIjo6UsQm5KfvYJqEzHgZvhNAcYKFwi0CC+X9vw7qrXmcUZEEV3RT3Yaee6br+M6IDV6OuZpkiOXB5Ird/sIc98qqFC8VJjkEYXW1LB0Fgl7AV89d/Z+QNtcaeFO3rFdPTUqyrVmaN54wiDn6brQZJhkQXvFJ7Pv6z4TnFuUjbsysVAXLb7eBmT; 4:1lVjIT+i9VnLfGkDDvP+m4dqCEaX6YNW1iyrYEiDJ9F5LcbqdczYCifFjqFE8oIK2BQC11O+zgvpZwZSWH0Nuo3x0Rc0nwgcP9nv+Kv2BrE0pd4P310+8N3vj+QpgWuNsaevEQGJHTeE9bLQO+fARKI0ZBZk8Hn0afzzLquMPKsrmbseOsZ8oLD3KMGlauIJOTwUjPphSyRJLtHm8XJGxyvKev7K/HnNS6vuzVDqGOcl4KEY/DDpVqOEYIqcoxTHMdeC7+Z+k4vKSdx9spmivWBiRXbkURhaVdipGUY4BAZ11WSlpAU79sBihKqXiyi8 X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(93006095)(93001095)(3231020)(10201501046)(3002001)(6055026)(6041248)(20161123560025)(20161123558100)(20161123562025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR1201MB0172; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR1201MB0172; X-Forefront-PRVS: 0471B73328 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(376002)(39860400002)(346002)(189002)(199003)(6486002)(53416004)(48376002)(189998001)(50466002)(7736002)(16526018)(101416001)(68736007)(8676002)(305945005)(2351001)(106356001)(50226002)(8936002)(2361001)(105586002)(47776003)(66066001)(36756003)(6666003)(2906002)(6916009)(25786009)(5660300001)(81156014)(81166006)(3846002)(6116002)(50986999)(72206003)(5003940100001)(53936002)(97736004)(1076002)(478600001)(4326008)(316002)(16586007)(86362001); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR1201MB0172; H:chrome.amd.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR1201MB0172; 23:t/LQ+jVNwwZZWqV2OR4zWnSy8ThgIpnoLJXrIQW?= =?us-ascii?Q?3Qu4ntoM6RNBojTpBCKVwTbYtfEOlAjzUL+NMf2znAiE0lkwzPvPBzGe+ioA?= =?us-ascii?Q?0pyK6IPHptGx02HQw4bqKHRraPU55zyCahZFyuOncrnazsyx/Tl7rROd3/AT?= =?us-ascii?Q?XpMpVodwBDrgPhMrxe8XvUL1n4HMlhHwvgyB9QzeCD7EKzt6gElI8kJPukrD?= =?us-ascii?Q?DvcVyYiBwfYM1V++ssC/bUJvprH+D84966TdaoTAbZYIx+LG3XeD1HqAjLdb?= =?us-ascii?Q?rmsNklLc+XLV50Da1VZJCP7cSl/C52jpbxBE5TjytiycBtq4+cPFVK/Lw89J?= =?us-ascii?Q?ukJOQW/Z29O45P5EWBKzVvkKqyvLDjv1IMkKbSYAqKJsEMZicjfKAjwdmVuq?= =?us-ascii?Q?clNlkeXTF/ElGoNAyQlcfy5vmopXR53Yj8KOwXsRRTYh470Nm2vmXnbRu3aI?= =?us-ascii?Q?/CWKxi7lwvpLHdZr075subBBJa5dCdsI29wwFpw9eKz9JMqLwrvXVEkFxibQ?= =?us-ascii?Q?sIt53aLXjSbGa8wOPpO6q7QEai5bOXoPfvEndmnPg59c4twRXR3tG9ATp4sa?= =?us-ascii?Q?l06wg638HtqUaLnWITHMT50UdV7U+CEZtAw8IEeENeIwt6VE06lZpmDKBmSa?= =?us-ascii?Q?tIuwdaqUnmEWttk4MrFxLfRdZ14mxtjZJgLIyuLQ2T1//byVjoRNY/+u42FA?= =?us-ascii?Q?nk5edOg87QS/XlRu8VlOOWly9at1sXJGGWSppSrOeRjOuOzxGt0xC4t2U1QZ?= =?us-ascii?Q?uP5J09ha25XXV1M+NfZpQZSLzwy/39rM5Db8yPkz/o6J17iFpBpN98COSXCa?= =?us-ascii?Q?dPb0KmiwABQn0BcRnDg3VyN4wxCozjrfALB+cSj7rK4i3UL/hWfN4j5L9cTr?= =?us-ascii?Q?BDZT+quVUjwgd39hhSVuEw6PVdPEIPbHnAuU4VZcrNmcPr7PfpIvRksQU1Uo?= =?us-ascii?Q?F/seuuzlnxMF4IZ8O0PI7WJ8AevNQnqcYmRpSUZ7J1QW2rS47g53xG/o8CMg?= =?us-ascii?Q?t6vl+lvJnuDax0u2n/qlu9moTaaRjfkNc77mezGWYIRNBILQ/XpxFHWFgPU8?= =?us-ascii?Q?5haz21T2v0vak9ZxNluWbPMqorz0Q?= X-Microsoft-Exchange-Diagnostics: 1; DM5PR1201MB0172; 6:HymuWhw5NQjy0GLqKWS9L8Bl3M+iym/Td3k9inWtuA/iNzc0olCWlhyGsazDn8YdlXGm0DnTNboJUfx3L3ETv2UryfD0rZRQ2NPyFsSk2drJT+iKNCVdfb8+/EnFijB3/s5dUFcYxOak4RdJnOBgnDL7B2DgreBFoPp580JPsaOJArFo70k1fMkASDf78q51RckZlgSstGSx4YulF84P8Yfpu/O3Qy3jLmgsgFFM856ESplVHQtTgf22HUV3IuLP/kGXxpCkMX0WKUHPjtQOKS79PdzhqnVsr2byqEijvHe1kZEmfNWj2wisrg44xxfTKfnwDfUVVCG6JuM0nG2lbK+I9pB2134SWnODmVYEGIg=; 5:c4jvcOJLsE+B9tIUv+1uq2cE4CI4iNeYfmk5H+8HYx6okJ37P+nLbAbGtfHUjCli/XS9eGura16yKzriGPOHSkdgxPsZgrqbZu78oKHHoqxoEys9ru+ChmEYGsdcDXj5v+EgBeMfmeN5SHB2Ti/wrNY9YQXT5OduhYp53ZJTlJU=; 24:M1vmidVysiV6+enX/brT3zZP3Tqrb4wDNXJ63ztNBnSSBytxbDSVhZ9Gow3lF7WgYbXZ5ptcNlzCBZnf983cIHGrWXKt6i55PBWKcGymEzM=; 7:DOLXqhCSL3cEQHtHFt2DcRJ64u/4hFF/PFkCXhvUOHmVmx+OvvRKvLuVwbhcowjRKKnCGCSLw81NRerCFyHh0y69zpAGouTTLDsgFOyPLRp9Ov5hWIEznsZO8tZFoJ+Xya5AffITWKkKjEknQfhGJsmDzRnZSXbgtmw3jxQLpwvZv/r1kAZyFcnvNU5EtZKPSyFQJ8zm7x9wFM2U1efY4uecSwPpcNRF3+C8OWlOfOQiIwwZIxnaBcY9rg9tRNfO SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM5PR1201MB0172; 20:624y42Iia3ooW2x4CoQ29Z4yZ/9q6NxTu1z2gxMT18+B3NWEouRvF0WIW/dPO5jxKSGaNXWYWuZ1IXnfzLxCNaRfucXVDHIKnX6H+p4D/MjxNGZjD8wUT1M0s6EeXVxrJp37kJfeU9s3kNpBC3sovqBG0OIaZ+ASFEDeDw5uxF3rxEcqWSUM1ukhIca9gRtrDXR4wc0E3LmwGaNY/X3z6vxitWitUtEsHRF+pbjVkBF4cNJgwhQOANseA0A/rfJ4 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Oct 2017 23:02:49.2430 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 46ae4bb1-bd75-4c13-f5b6-08d51bfc83ab X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1201MB0172 Cc: Alexander.Deucher@amd.com, marcheu@chromium.org, Deepak Sharma 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 From: Deepak Sharma Modify vgem_init to take platform dev as parent in drm_dev_init. This will make drm device available at "/sys/devices/platform/vgem" in x86 chromebook. Signed-off-by: Deepak Sharma Reviewed-by: Sean Paul --- drivers/gpu/drm/vgem/vgem_drv.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/vgem/vgem_drv.c b/drivers/gpu/drm/vgem/vgem_drv.c index c938af8c40cf..17e2eafc62b8 100644 --- a/drivers/gpu/drm/vgem/vgem_drv.c +++ b/drivers/gpu/drm/vgem/vgem_drv.c @@ -471,31 +471,30 @@ static int __init vgem_init(void) if (!vgem_device) return -ENOMEM; - ret = drm_dev_init(&vgem_device->drm, &vgem_driver, NULL); - if (ret) - goto out_free; - vgem_device->platform = platform_device_register_simple("vgem", -1, NULL, 0); if (IS_ERR(vgem_device->platform)) { ret = PTR_ERR(vgem_device->platform); - goto out_fini; + goto out_free; } dma_coerce_mask_and_coherent(&vgem_device->platform->dev, DMA_BIT_MASK(64)); + ret = drm_dev_init(&vgem_device->drm, &vgem_driver, &vgem_device->platform->dev); + if (ret) + goto out_unregister; /* Final step: expose the device/driver to userspace */ ret = drm_dev_register(&vgem_device->drm, 0); if (ret) - goto out_unregister; + goto out_fini; return 0; -out_unregister: - platform_device_unregister(vgem_device->platform); out_fini: drm_dev_fini(&vgem_device->drm); +out_unregister: + platform_device_unregister(vgem_device->platform); out_free: kfree(vgem_device); return ret;