Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3424304imu; Mon, 24 Dec 2018 01:29:05 -0800 (PST) X-Google-Smtp-Source: ALg8bN7+kMvSI2WCJIzEls/SMWh8cf7wgdpgcBnKLMgKQZWFVhUyghIWzACUHUo48jXFsyeKpPpl X-Received: by 2002:a17:902:5a86:: with SMTP id r6mr11852796pli.301.1545643745480; Mon, 24 Dec 2018 01:29:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545643745; cv=none; d=google.com; s=arc-20160816; b=0y1geuzEd5MFmREhW4MqpC8bDJb5T9QwVC90HvkPkiVguTZy62lJkY5sUEkS3oiSgK 4RFKIZAi39UNcDpBybG4ezL3j8fNmTyhOMrEDyaflwFw+hUpmeeYHEgeI/pF3zj5qxGZ E9HGpPocFQtNMcB9/v3+PToZiRFk58k1zEnMviaePnK4B05Ex6YXe/mZcyJVAYW6cE78 8H3Vys3tWBrSLiIAN/W8JgVXd4zHWSolgiEwxazde7aaUtsKSCILmBAlKYXe7pktrX0U bBf7a8hEFrZ7zEksI2xLefEDmgOPCDrw4SjHAmmVooLcHeGlN1LDRLbUdXXc/dmXyxHq krkg== 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=3brXUZjW0ecMdPsbmdMF6h3G6Q090dX2ypslU0FAsOI=; b=LwpXa0JN65jOjd4gv0opOxOEEgSSL0eMCJmWNzujDSbNfpoh3wUlSgsEUKnboBsPtB Wzc9y2xqIWhjhY0XgXQxiSNd8VgH+JWJ/Jg42ue/tA3cRb8WDY2Kk/F71HUtqx1E0E7w kzu6ICXHLFo9ZZUo78u9++uDKOx1i3EaLNMo0mHcL2sbJ6JBK62Ev0API+4hSrUclF20 I/+5JyZPcwohtd8oRHhgb3052ogFa1mVsJPUwTmND3SrKb7fwhZr29L+M3iLa/h24Scl ysv/UTHUx8Gr7ra0RBhkRpL4fcpJbFL3+bgz7egQPNY0jdeRg4SmiuGcKLqL9HdeyDQo hn/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@armh.onmicrosoft.com header.s=selector1-arm-com header.b=lR5cuq8C; 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 k62si27790187pfc.208.2018.12.24.01.28.50; Mon, 24 Dec 2018 01:29:05 -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=lR5cuq8C; 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 S1725956AbeLXJ0h (ORCPT + 99 others); Mon, 24 Dec 2018 04:26:37 -0500 Received: from mail-eopbgr150052.outbound.protection.outlook.com ([40.107.15.52]:25380 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725294AbeLXJ0h (ORCPT ); Mon, 24 Dec 2018 04:26:37 -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=3brXUZjW0ecMdPsbmdMF6h3G6Q090dX2ypslU0FAsOI=; b=lR5cuq8CPK95JzqGCoijEapediWci2e2+SpYMGmi/P78jOSAobkYcArL3HCOTp6bkBmlc1QW5iEqjG9kxIOT/XQn1FizKOKPRbv4X6WIv4ALfjNsHdB0kpJUfzZyVXw51oqYMXHn8LF/jRbjYDLy5TiaiJmTXN0acbLPgVFAgLg= 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:31 +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:31 +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 07/11] drm/komeda: Add komeda_crtc_vblank_enable/disable Thread-Topic: [PATCH 07/11] drm/komeda: Add komeda_crtc_vblank_enable/disable Thread-Index: AQHUm2rBQ9cUqfU5BUCGr5zf1/3BfA== Date: Mon, 24 Dec 2018 09:26:31 +0000 Message-ID: <20181224092435.2792-8-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:T+MYHczo+UlIFsAzIG6RXCLJ8tFi/kFHpRkK/E4W4BLKCFFR5537oMz+YmZZWlOKhh8JPRCv4v+jEOwwRbOi7l3hsxigfCqzPOBrs/YaxV+ktwH3HSfX3aq3oZvngY/aV3yEqNyQ4iG+otMYtpBp+uD17efb2Hemqw/lRPcve3OH4oODCVkCme6MLk/Yn/dyy7X/Ig7YOuwEMIuiIrGamYKGnjmbus3+nXPlkqhB6BiWeLY+WtluBK53UQtj9HmEb4INTHNVaX8rfg59ZRP1MJ6Nd3eZOSuOlkiouUkeiTPKiPvz9nequ5s5S9UAu262oowh7KEdjGhBux0WqGJ7J+JTxbjFZr3Lkj/As2I4nMX4RaYPBsaM+c6Quf2p8xclOo4FTB45MsRaiPxuvNRujQikO4KSanmmY/n/9Yt8HUBDKvoHOI7b4xuIDJH5tBTSB5iDELnVs8uXXJWSd8qVqg==;5:cuyPkiU4rKq5/l/ZtcoEduLVjcNKyWHPcZMEbI/xNN6i0PUAxsn3oZaWHU4zSBwBukicK7Nt947GF8TnFqLd5/+Qy/yL2TlYUKYQP3Z1pe0PdKBQXc6eXk6w+AE3UtIQ7KkgIpP8bkbS29doMJm4VsXc7Ef70IoGd6fxcpvBPQ4=;7:f3EAkONrDukCcZ8z6rfpHChCD7XotobmoasnlXVc2koFiRFCrHuKnEABjCGcNqdI7EGAtTEzhI6PbqLq4i45EooB7jB2mCgNJcmR5Spykmp6IrRcRlyzdakEei1qkxXUOiZq8N2WzVt6U/vhyEsuyQ== x-ms-office365-filtering-correlation-id: c09464d7-b9a2-49c2-6620-08d66981e3a5 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)(979002)(396003)(366004)(136003)(376002)(39850400004)(346002)(199004)(189003)(4326008)(256004)(305945005)(53936002)(6862004)(71190400001)(71200400001)(486006)(7736002)(97736004)(446003)(2906002)(52116002)(6116002)(76176011)(1076003)(575784001)(6436002)(86362001)(6512007)(5660300001)(11346002)(186003)(26005)(68736007)(3846002)(2616005)(476003)(55236004)(386003)(102836004)(6506007)(25786009)(103116003)(14454004)(105586002)(99286004)(54906003)(37006003)(6486002)(106356001)(316002)(8676002)(81166006)(81156014)(8936002)(6636002)(36756003)(478600001)(66066001)(969003)(989001)(999001)(1009001)(1019001);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: XF78ugxyBRll0FWRatVFv6DvPK0ipstWeJ6uTEO4iRUYkz1oiwhUTFEIlr862Qw6r9glxDXgfWz5R6hcQiJCwsDDvMb/8j3sGw5GuMUVPOCk2OL5dETRGydYZijNHQCU3HLSQgvXeyoby09M2SYCoZbGZjsb/nNbWVv+jlz6Temv/OSwy0/vdVKwdo30wt5Jrux4HkACMikNR8bAS07vg+ObNAB0BHbtkb7GQK79krQuOEg91WnvzLXpqwBWhRsV6IqfbUZWZNr5Jxr46qH/Jhch21Ik9gIDCrI30qzBryUfPaACf8Xaj1rMqO7h65yA 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: c09464d7-b9a2-49c2-6620-08d66981e3a5 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Dec 2018 09:26:31.4202 (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 Add a new komeda_dev_func->on_off_vblank to enable/disable HW vblank event Signed-off-by: James (Qian) Wang --- .../gpu/drm/arm/display/komeda/d71/d71_dev.c | 10 ++++++++++ .../gpu/drm/arm/display/komeda/komeda_crtc.c | 19 +++++++++++++++++++ .../gpu/drm/arm/display/komeda/komeda_dev.h | 3 +++ 3 files changed, 32 insertions(+) diff --git a/drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c b/drivers/gpu= /drm/arm/display/komeda/d71/d71_dev.c index 39b3c84cf483..31680bc0ccba 100644 --- a/drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c +++ b/drivers/gpu/drm/arm/display/komeda/d71/d71_dev.c @@ -241,6 +241,15 @@ static int d71_disable_irq(struct komeda_dev *mdev) return 0; } =20 +static void d71_on_off_vblank(struct komeda_dev *mdev, int master_pipe, bo= ol on) +{ + struct d71_dev *d71 =3D mdev->chip_data; + struct d71_pipeline *pipe =3D d71->pipes[master_pipe]; + + malidp_write32_mask(pipe->dou_addr, BLK_IRQ_MASK, + DOU_IRQ_PL0, on ? DOU_IRQ_PL0 : 0); +} + static int to_d71_opmode(int core_mode) { switch (core_mode) { @@ -492,6 +501,7 @@ static struct komeda_dev_funcs d71_chip_funcs =3D { .irq_handler =3D d71_irq_handler, .enable_irq =3D d71_enable_irq, .disable_irq =3D d71_disable_irq, + .on_off_vblank =3D d71_on_off_vblank, .change_opmode =3D d71_change_opmode, .flush =3D d71_flush, }; diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c b/drivers/gpu= /drm/arm/display/komeda/komeda_crtc.c index c76cd75a0100..6d9fb4626ba5 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_crtc.c @@ -347,7 +347,26 @@ struct drm_crtc_helper_funcs komeda_crtc_helper_funcs = =3D { .mode_fixup =3D komeda_crtc_mode_fixup, }; =20 +static int komeda_crtc_vblank_enable(struct drm_crtc *crtc) +{ + struct komeda_dev *mdev =3D crtc->dev->dev_private; + struct komeda_crtc *kcrtc =3D to_kcrtc(crtc); + + mdev->funcs->on_off_vblank(mdev, kcrtc->master->id, true); + return 0; +} + +static void komeda_crtc_vblank_disable(struct drm_crtc *crtc) +{ + struct komeda_dev *mdev =3D crtc->dev->dev_private; + struct komeda_crtc *kcrtc =3D to_kcrtc(crtc); + + mdev->funcs->on_off_vblank(mdev, kcrtc->master->id, false); +} + static const struct drm_crtc_funcs komeda_crtc_funcs =3D { + .enable_vblank =3D komeda_crtc_vblank_enable, + .disable_vblank =3D komeda_crtc_vblank_disable, }; =20 int komeda_kms_setup_crtcs(struct komeda_kms_dev *kms, diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_dev.h b/drivers/gpu/= drm/arm/display/komeda/komeda_dev.h index 18dd82b09340..2beaa0d49c34 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_dev.h +++ b/drivers/gpu/drm/arm/display/komeda/komeda_dev.h @@ -103,6 +103,9 @@ struct komeda_dev_funcs { int (*enable_irq)(struct komeda_dev *mdev); /** @disable_irq: disable irq */ int (*disable_irq)(struct komeda_dev *mdev); + /** @on_off_vblank: notify HW to on/off vblank */ + void (*on_off_vblank)(struct komeda_dev *mdev, + int master_pipe, bool on); =20 /** @dump_register: Optional, dump registers to seq_file */ void (*dump_register)(struct komeda_dev *mdev, struct seq_file *seq); --=20 2.17.1