From patchwork Wed Feb 1 10:16:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mihail Atanassov X-Patchwork-Id: 9549661 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 C71B360415 for ; Wed, 1 Feb 2017 12:49:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B369128422 for ; Wed, 1 Feb 2017 12:49:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A668C28437; Wed, 1 Feb 2017 12:49:39 +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 2CC3F28422 for ; Wed, 1 Feb 2017 12:49:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 769BF6E7AC; Wed, 1 Feb 2017 12:49:37 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0081.outbound.protection.outlook.com [104.47.2.81]) by gabe.freedesktop.org (Postfix) with ESMTPS id 504316E7AC for ; Wed, 1 Feb 2017 12:49:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=3Zuu0SBrnB7mEmUmaUZZG0bG91IIb8UZB7qUS/1zg4I=; b=UUIUrOvxD7osyTYFos58K6ulyAEm2QFUYWjbME/1loUxYgR2GQFYXMTM9Bie5WJzuDwns/3tJKYL7cWxjtYOmwqnDj+hCZ3KO69I9X4hTOb7vIBo1m9vpP6Oz65BYRrSwDqYJVtXiADy0UCgD/R9AELHHil9FdJ8OUs/GBCMbbk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Mihail.Atanassov@arm.com; Received: from e110433-lin.cambridge.arm.com (217.140.96.140) by AM4PR08MB0881.eurprd08.prod.outlook.com (10.164.83.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.874.12; Wed, 1 Feb 2017 10:17:04 +0000 From: Mihail Atanassov To: Subject: [PATCH 1/2] drm: mali-dp: add malidp_crtc_state struct Date: Wed, 1 Feb 2017 10:16:57 +0000 Message-ID: <1485944218-14354-1-git-send-email-mihail.atanassov@arm.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [217.140.96.140] X-ClientProxiedBy: HE1PR0202CA0044.eurprd02.prod.outlook.com (10.171.89.158) To AM4PR08MB0881.eurprd08.prod.outlook.com (10.164.83.27) X-MS-Office365-Filtering-Correlation-Id: 519f7716-aa16-42ad-b8a3-08d44a8b78fa X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081); SRVR:AM4PR08MB0881; X-Microsoft-Exchange-Diagnostics: 1; AM4PR08MB0881; 3:BM3fRqPgTEhgzQmUSyf2Ts0H/J0g+SZkgKZSdTn8ZAi1ptoyL7PEJ/OgtiQH+gzgC3dpzP6ULUfhHnGhorv6Gw0DjihHzcqN7ccJWFFYjP1aIf0Txv3aojN5wkVk/dyw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1AjFtci6/l5aTvCCa56SzNLaafOl5q+QRHYlusM001S9iHELndrdimzjJg= NoDisclaimer: True X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(180628864354917); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6055026)(6041248)(20161123558025)(20161123564025)(20161123562025)(20161123555025)(20161123560025)(6072148); SRVR:AM4PR08MB0881; BCL:0; PCL:0; RULEID:; SRVR:AM4PR08MB0881; X-Microsoft-Exchange-Diagnostics: 1; AM4PR08MB0881; 4:P6QJIjyESVJn650mem/DbY68WlV/bOXv5UMbhjxepor5JpHGKFzSnZ5ncmAY1ZWvLkgPOt1zxYvRwWUTjpq8WtBLBxCVAip2v2uO0uvj+I13o8ec/1NVjm239bV63j2lN5IT28yl/8beJ0Iu+VnwZKsrOS08ISHbEbd4pHdo+nWHn3Dm4aW/BZjpFD9irEhnqLSuunIuwBtUv6M/Wizad/0Hv8YpSuY2Gh/uaeYsv8ooEpogvOJOqffeE4KYeZSiVXhzvs7wt0tPS8nsB+V+VmUre57QtMAMwLfmYMXWq6H9feB6de4RDID7ynwdJml+Xw4CDzpZBABrHm1priyi1deUnSyeXQRy1AKfCnUQvPregkq+DypQKSswPo+BQTeDpsj3TUkZcwXO4eZ3tpZBwxVULicfSywF3L0o6pOSNcjlFpH7HC8g7wt26E+8EvZA3IwQ8taBDmzJL381behrhV5R3WfpYlcvSdTQsHhjzxSgdqSNRpFPlyfU6eHjZhpURo952rO6CY3lRh9cIeklkqjVWN/YfcS1KgZl0qSoTjseYjReplinJMWOq2ZK8St9Gl9jRIbSXujCWOrUx4Fh7m9Bm9P3gghxDhHC9v+bk3x87hzsHXOnL92VgqyiWdvaIKWQkEyFiI+qtV1X0yylTpVB14lygK91GNBou6ofPMQ= X-Forefront-PRVS: 0205EDCD76 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(39850400002)(39450400003)(39840400002)(39410400002)(199003)(189002)(54906002)(42186005)(6916009)(53936002)(105586002)(38730400001)(4326007)(5660300001)(110136003)(6666003)(106356001)(575784001)(86362001)(50986999)(33646002)(6486002)(47776003)(68736007)(92566002)(2351001)(25786008)(5003940100001)(101416001)(6116002)(66066001)(36756003)(97736004)(189998001)(81156014)(305945005)(50466002)(81166006)(7736002)(3846002)(2906002)(50226002)(48376002)(8676002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR08MB0881; H:e110433-lin.cambridge.arm.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM4PR08MB0881; 23:eUSNYpqNeLVwMTyJiVuR/eibGjEaFhGcSk2xHh9pq?= =?us-ascii?Q?Ifdo+d18yZMDlUiH6/UgVb/piqSW/tUAeMi8BS0692MoHXMCCG5UGOeZsXvZ?= =?us-ascii?Q?63lmm7kR1XWWBlG5J0yBkGn4bHSMXXuVHsAQW4zADDOhufyFUtbnkyoue3gG?= =?us-ascii?Q?XwA1XBocRKhnw3Se+OkEsR/acrAmOqWT3jiZMYPA2phpbvih0NLOcDtKyB42?= =?us-ascii?Q?lQf5qhnIFY340KYJrqtyQuZgjCW0m027YT9opI6u9+o1Y4wxZ58STglVe4lz?= =?us-ascii?Q?FRgZ8bswTf9/CN3369wu3JIumqA+uwMAI/+M6UMcbWPWtm0ojMlvp4tZrt4X?= =?us-ascii?Q?5PEg19/pzBqCZFPotzzlX2zzdvC3K0zMBkfSIJOYO7OaPmIoAESBn24OC0Xg?= =?us-ascii?Q?dXpvqG5Vvrp2eCniKeh84HQb2HuH1guRN8xK6ony5eggVYAz+fCmda6LJlzu?= =?us-ascii?Q?FPYR5J2qF5M+GEJUXC44GlUPJ6q0zZQM8t3rVm+BMlT4g6pIkLJL9ZV/J5ZQ?= =?us-ascii?Q?Map+idv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kI4SExlmYF2tT/aQsuKansmUfyDVyzqP7OyMN/r X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Feb 2017 10:17:04.9501 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR08MB0881 Cc: Liviu Dudau , linux-kernel@vger.kernel.org, Mali DP Maintainers , nd@arm.com 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 Add a custom CRTC state struct to enable storing driver-private per-CRTC state. This patch only adds the base drm_crtc_state struct. Signed-off-by: Mihail Atanassov Reviewed-by: Brian Starkey --- drivers/gpu/drm/arm/malidp_crtc.c | 39 +++++++++++++++++++++++++++++++++++++-- drivers/gpu/drm/arm/malidp_drv.h | 6 ++++++ 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/arm/malidp_crtc.c b/drivers/gpu/drm/arm/malidp_crtc.c index 08e6a71..d1cd0e7 100644 --- a/drivers/gpu/drm/arm/malidp_crtc.c +++ b/drivers/gpu/drm/arm/malidp_crtc.c @@ -160,6 +160,41 @@ static int malidp_crtc_atomic_check(struct drm_crtc *crtc, return 0; } +static struct drm_crtc_state *malidp_crtc_duplicate_state(struct drm_crtc *crtc) +{ + struct malidp_crtc_state *cs; + struct malidp_crtc_state *state; + + if (WARN_ON(!crtc->state)) + return NULL; + + cs = to_malidp_crtc_state(crtc->state); + state = kmalloc(sizeof(*state), GFP_KERNEL); + if (!state) + return NULL; + + __drm_atomic_helper_crtc_duplicate_state(crtc, &state->base); + + return &state->base; +} + +static void malidp_crtc_reset(struct drm_crtc *crtc) +{ + struct malidp_crtc_state *cs = (crtc->state) ? + to_malidp_crtc_state(crtc->state) : NULL; + + if (crtc->state) + __drm_atomic_helper_crtc_destroy_state(crtc->state); + + kfree(cs); + cs = kzalloc(sizeof(*cs), GFP_KERNEL); + if (!cs) + return; + + crtc->state = &cs->base; + crtc->state->crtc = crtc; +} + static const struct drm_crtc_helper_funcs malidp_crtc_helper_funcs = { .mode_fixup = malidp_crtc_mode_fixup, .enable = malidp_crtc_enable, @@ -171,8 +206,8 @@ static int malidp_crtc_atomic_check(struct drm_crtc *crtc, .destroy = drm_crtc_cleanup, .set_config = drm_atomic_helper_set_config, .page_flip = drm_atomic_helper_page_flip, - .reset = drm_atomic_helper_crtc_reset, - .atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state, + .reset = malidp_crtc_reset, + .atomic_duplicate_state = malidp_crtc_duplicate_state, .atomic_destroy_state = drm_atomic_helper_crtc_destroy_state, }; diff --git a/drivers/gpu/drm/arm/malidp_drv.h b/drivers/gpu/drm/arm/malidp_drv.h index 9fc8a2e..c7a69ae 100644 --- a/drivers/gpu/drm/arm/malidp_drv.h +++ b/drivers/gpu/drm/arm/malidp_drv.h @@ -47,6 +47,12 @@ struct malidp_plane_state { #define to_malidp_plane(x) container_of(x, struct malidp_plane, base) #define to_malidp_plane_state(x) container_of(x, struct malidp_plane_state, base) +struct malidp_crtc_state { + struct drm_crtc_state base; +}; + +#define to_malidp_crtc_state(x) container_of(x, struct malidp_crtc_state, base) + int malidp_de_planes_init(struct drm_device *drm); void malidp_de_planes_destroy(struct drm_device *drm); int malidp_crtc_init(struct drm_device *drm);