Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3424640imu; Mon, 24 Dec 2018 01:29:34 -0800 (PST) X-Google-Smtp-Source: ALg8bN61YwxtU8wqDpAU8rQkfVeBHZWEi9zgfhdKtHFHvnw3LIH3qAh4hskG04ZFAuzaT7FnZe1d X-Received: by 2002:a65:40c5:: with SMTP id u5mr11437052pgp.46.1545643774121; Mon, 24 Dec 2018 01:29:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545643774; cv=none; d=google.com; s=arc-20160816; b=TYbRqYqvjQciswulahhhJ/tF2syyKRIniW18S9P6DNgSj1Pql3xjHIqoq0Pv4PScUz sOFl+x1da/U/NIIwXttHsbjgjkcr6dHsTxDYH5oaQ7GlilNSwoXD1NRuzBD0mVUOAdWc LK8pw3wxPDykGs4v91C12UDyQWYnzjs0EdH/OBkuU/hV1I4C5a249Xv3XA+odEp2xjKN bErZGVpZmahEmWHnmkI17MFzV/lo0ysgBAjLL/B0F9mPDCYjtN/hRB+dob8k4eoVA9ta 9fXdvkDReZ0tmgNThssvAnyxuMXHHb8qoVOAQJPWCsJ7jvJIoC0x38pLkMcrsYnwh0D+ 4/5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:nodisclaimer :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=hwLSdmP+OIGkn9Z5nqrWiY+/fj4Mo10HDhk1STPjU1I=; b=Ex56O/2y7Byd7DihiafJhAUGbej+CvTrsgiGtSv7SHaXL0ZAXpfRI01uCk5k7gBQJ3 yIXKNl2ogVsn/PdSKF7EVOg53HnCgQHNHNsr0LuiB9+P2lfi82zC/aBqzXQ7NqRV0UHk Z/9by6SYjqwWZGQHXOfvfCY8iq98jmmLjIzQ5TsVjJ8h3nqNYbIyAVTL8tDa1cPwzls8 NFQOEUML/XXJpt6o28p0vkG1cA53Qz3NU+Iy1yIofU+3mCYDaH9fUz7viVdzmOroT860 UHt3t4Pl38wCdXry93ouqHrfW6uYOrGXmGYZBBQkER39gTmEFvhKF1pou7W44q5THKEs YO4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector1-arm-com header.b=EX7zTlVn; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s8si22715133pgl.503.2018.12.24.01.29.18; Mon, 24 Dec 2018 01:29:34 -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=@armh.onmicrosoft.com header.s=selector1-arm-com header.b=EX7zTlVn; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726002AbeLXJ05 (ORCPT + 99 others); Mon, 24 Dec 2018 04:26:57 -0500 Received: from mail-eopbgr150072.outbound.protection.outlook.com ([40.107.15.72]:37508 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725554AbeLXJ05 (ORCPT ); Mon, 24 Dec 2018 04:26:57 -0500 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:X-MS-Exchange-SenderADCheck; bh=hwLSdmP+OIGkn9Z5nqrWiY+/fj4Mo10HDhk1STPjU1I=; b=EX7zTlVnsCwQSpiDdSAnwJH6UFXSrWpsfaO7sBcH08TmHg+HKd+BxD+5BwOXTpesVsqLQrDyFiCA3RhivWx1Gr9EiyvAnSF+pXk48ZOl4Oh/3/P/DusbqIvz4JEI6jKohkXSBMRqScngQogtP5nVAQ2hMdas0/RJ5nCS6+Tnm+8= Received: from AM3PR08MB0611.eurprd08.prod.outlook.com (10.163.188.149) by AM3PR08MB0262.eurprd08.prod.outlook.com (10.161.35.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1446.23; Mon, 24 Dec 2018 09:26:53 +0000 Received: from AM3PR08MB0611.eurprd08.prod.outlook.com ([fe80::3c73:534c:9c6e:352d]) by AM3PR08MB0611.eurprd08.prod.outlook.com ([fe80::3c73:534c:9c6e:352d%2]) with mapi id 15.20.1446.026; Mon, 24 Dec 2018 09:26:53 +0000 From: "james qian wang (Arm Technology China)" To: Liviu Dudau CC: "Jonathan Chai (Arm Technology China)" , Brian Starkey , "Julien Yin (Arm Technology China)" , "thomas Sun (Arm Technology China)" , Alexandru-Cosmin Gheorghe , "Lowry Li (Arm Technology China)" , Ayan Halder , "Tiannan Zhu (Arm Technology China)" , "Jin Gao (Arm Technology China)" , "Yiqi Kang (Arm Technology China)" , nd , "malidp@foss.arm.com" , "airlied@linux.ie" , "yamada.masahiro@socionext.com" , "linux-kernel@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , "maarten.lankhorst@linux.intel.com" , "maxime.ripard@bootlin.com" , "sean@poorly.run" , "james qian wang (Arm Technology China)" Subject: [PATCH 09/11] drm/komeda: Add komeda_kms_check Thread-Topic: [PATCH 09/11] drm/komeda: Add komeda_kms_check Thread-Index: AQHUm2rONVL1eL96PEKP9cqW77BNYg== Date: Mon, 24 Dec 2018 09:26:53 +0000 Message-ID: <20181224092435.2792-10-james.qian.wang@arm.com> References: <20181224092435.2792-1-james.qian.wang@arm.com> In-Reply-To: <20181224092435.2792-1-james.qian.wang@arm.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [113.29.88.7] x-clientproxiedby: SYXPR01CA0099.ausprd01.prod.outlook.com (2603:10c6:0:2e::32) To AM3PR08MB0611.eurprd08.prod.outlook.com (2a01:111:e400:c408::21) authentication-results: spf=none (sender IP is ) smtp.mailfrom=james.qian.wang@arm.com; x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;AM3PR08MB0262;6:6+ubTd1WDFlwQ0SMYGiv/bh2jyOjTSnR8d7mMXZJEYTnIPU3RDSbu71nUd6dIOnduN/mDeuIT7L4HBJxRHl3WkJzBVGpM+YQ/vL7/kHdmhoOOpKCapuydXjPqur/qvjKpxPJclgR59eXzfYKbShJSb5ApBO9kLGV+n4tTDhpojkzJj1o9SQ/JDIjjaqmnzcNL/eQyeHJh4z+9OejlfFUANdlg4EgbxhePDxS3OrsomgKpi7NgAQzBb4tJafA2RkfZ2vKkOCPRC5fYrrjDWb21QJ17jBUPoKxxYvyIrS/iryarRb1ah60VrrMEawsersLxRs+6GWIrbDdMlTCnpk6oza4JPk/T2O+wB6K/V+/+s97BO0gUWTfJV9q+NhngcrZSE5nKeUXFBEpZMMngQLaZgJTIT458pQmaNAuFvUl/SEH8s2otrdxtYBuR/2GzkJc8TKMbKT9tF6ndRaf5bqTKQ==;5:unW8oDEXM6XMwpao4eysx+BIzOPuf+DIvonJO0et4QB6VIdzKfjr1oBoOy9+mLdh8KA0rUsOyciL3tyg3StAhwB+vtU+DQrVn5lYkCSkYOYJP8nMviwsW+R88pgKF8aGFn+rC9xsMbcsc1gzRT6I4xm8uC35q50ldWdN25V4CDo=;7:lBXh3Bb6PQWHgpIUclzLuRca2myJph+X4bdh92z34qhhQr1jLE7fY8UwCMI2r26NYisRuLSzdjzMrbGvaoXd7mBKLE4eqDOAqfxiOB3xPB3oE9dY4bPByh8QEM8c3DWk2Lz8PX0f88TjWuJG6+T//g== x-ms-office365-filtering-correlation-id: 9cfa1223-36ca-45b1-7179-08d66981f0b2 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020);SRVR:AM3PR08MB0262; x-ms-traffictypediagnostic: AM3PR08MB0262: nodisclaimer: True x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(3230021)(908002)(999002)(5005026)(6040522)(2401047)(8121501046)(10201501046)(3231475)(944501520)(52105112)(3002001)(93006095)(93001095)(6055026)(6041310)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095);SRVR:AM3PR08MB0262;BCL:0;PCL:0;RULEID:;SRVR:AM3PR08MB0262; x-forefront-prvs: 0896BFCE6C x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(396003)(366004)(136003)(376002)(39850400004)(346002)(199004)(189003)(4326008)(256004)(305945005)(53936002)(6862004)(71190400001)(71200400001)(486006)(7736002)(97736004)(446003)(2906002)(52116002)(6116002)(76176011)(1076003)(6436002)(86362001)(6512007)(5660300001)(11346002)(186003)(26005)(68736007)(3846002)(2616005)(476003)(55236004)(386003)(102836004)(14444005)(6506007)(25786009)(103116003)(14454004)(105586002)(99286004)(54906003)(37006003)(6486002)(106356001)(316002)(8676002)(81166006)(81156014)(8936002)(6636002)(36756003)(478600001)(66066001);DIR:OUT;SFP:1101;SCL:1;SRVR:AM3PR08MB0262;H:AM3PR08MB0611.eurprd08.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: nGs7zlEikI9NIVrR3I88DIWPhGcGhCDvVCF8hux7rSr8JEVaHHzHMCs1wahqWzbA+5XdBcNMeLgU8xG70LNLZBqVJodKlHr0jm75M5V1pvBhc+eT1rmtGXQIUj+GWPEAkxWNJlLeqkZhzjiSg2bYb2VKaU6t7x7hoo0jWqJxw8PwKjA8wEDwTx+V7i8MeKhUQW9ytDIqL50YUJaToMIbXkXmCB6dnmIxagHIHzWM3XH0/2UOlaj1tUZE5Q3zyJm6WTmuSgsiWlZoMNSnBcA4gKRqMERwW6jKYZSHhmNM5FSAqY3o1yH3bxLp4GrQzl/U spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9cfa1223-36ca-45b1-7179-08d66981f0b2 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Dec 2018 09:26:53.3010 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM3PR08MB0262 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Implement komeda_kms_check to add all affected_planes (even unchanged) to drm_atomic_state. since komeda need to re-calculate the resources assumption in every commit. Signed-off-by: James (Qian) Wang --- .../gpu/drm/arm/display/komeda/komeda_kms.c | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_kms.c b/drivers/gpu/= drm/arm/display/komeda/komeda_kms.c index 210e5c05bf49..ae97db7e447e 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_kms.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_kms.c @@ -95,9 +95,37 @@ static const struct drm_mode_config_helper_funcs komeda_= mode_config_helpers =3D { .atomic_commit_tail =3D komeda_kms_commit_tail, }; =20 +static int komeda_kms_check(struct drm_device *dev, + struct drm_atomic_state *state) +{ + struct drm_crtc *crtc; + struct drm_crtc_state *old_crtc_st, *new_crtc_st; + int i, err; + + err =3D drm_atomic_helper_check_modeset(dev, state); + if (err) + return err; + + /* komeda need to re-calculate resource assumption in every commit + * so need to add all affected_planes (even unchanged) to + * drm_atomic_state. + */ + for_each_oldnew_crtc_in_state(state, crtc, old_crtc_st, new_crtc_st, i) { + err =3D drm_atomic_add_affected_planes(state, crtc); + if (err) + return err; + } + + err =3D drm_atomic_helper_check_planes(dev, state); + if (err) + return err; + + return 0; +} + static const struct drm_mode_config_funcs komeda_mode_config_funcs =3D { .fb_create =3D komeda_fb_create, - .atomic_check =3D NULL,/*komeda_kms_check*/ + .atomic_check =3D komeda_kms_check, .atomic_commit =3D drm_atomic_helper_commit, }; =20 --=20 2.17.1