Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp16752535ybl; Wed, 1 Jan 2020 12:49:02 -0800 (PST) X-Google-Smtp-Source: APXvYqwE3G2WwK6kuLJdrKFMzE0tEjPIzbBcRbrJBm3ceSxHVMs+Rr5i+T/8PTKsdwQ//DmE1vxb X-Received: by 2002:a9d:3f61:: with SMTP id m88mr70386858otc.56.1577911742028; Wed, 01 Jan 2020 12:49:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577911742; cv=none; d=google.com; s=arc-20160816; b=TD3uJkJWY0vgdufDMBuk8NJFm8/Izan0Gjzy6qV8umYiv8nnmoireOwy7sznU/daEs LUo0hLuQn2bvQpfsDpMH5y1l3MUVLjn8YyClyV7iPp6EPKHvHB09HtY/pf04AhJF/P1p KDdeWTYstwDypT7jf4adwcT4FnKRHvbI6F3A/9RXkDApItABo2rYgpPGTIQ9jPMPBGWr qHA7sAYBQPhnyRq50MyBW1HiTTq4KyJ4BZMp8LN3chEJuxB/JFxZb36ULnqD94ewR3RI CbBrTAkTyb207zAqnb8IsXl6W7Qd4OSYH8ifVyQuPWNrkLHJuKJ1LF+nsRNPCAzHuPGm nMHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=XbMrezaMD0p4i3SGBGMVhsDuOIGR0bDHjQFGAvfTghk=; b=Ae1dHEUxKgSyHcMASfUaPxsR9XDg7WiJUxGfmSGZJhFVYdJFmI7tq6gRldawUbR1Iv ZwuY9csyPWnUq/45g6G8pc33QISByeIGnRTnZZzFVaJ28mkq9pANzfTsUVt1WXGKFfkA kkzqZ2l9UHRPMS/0FuL1EfQOmtfi7r/eqhZA3ceqX7T4gD8aBYfjXwrCDG5aXc9+Xl5m jBDgafOcJCO5QL4CuGMTKysdE4tJiUMzIpZQDkY5hKYD6sNYr5bAMcHjsdciYZYRUEAZ 3mUJCV+OLoNsFXul6SFVPHzlEgw7t//dVzGtpwuNtH7Sv8Bgcx09mi2Er+Owoz8k3U0s gLYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@globallogic.com header.s=google header.b=hsxj+yEF; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=globallogic.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k1si24552328oic.245.2020.01.01.12.48.50; Wed, 01 Jan 2020 12:49:02 -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=@globallogic.com header.s=google header.b=hsxj+yEF; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=globallogic.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727282AbgAAUsJ (ORCPT + 99 others); Wed, 1 Jan 2020 15:48:09 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:34912 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727207AbgAAUsI (ORCPT ); Wed, 1 Jan 2020 15:48:08 -0500 Received: by mail-pl1-f195.google.com with SMTP id g6so17077306plt.2 for ; Wed, 01 Jan 2020 12:48:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=globallogic.com; s=google; h=from:to:cc:subject:date:message-id; bh=XbMrezaMD0p4i3SGBGMVhsDuOIGR0bDHjQFGAvfTghk=; b=hsxj+yEFbN25j8L+Ydo66FZwz/eE6FmsuE4JZo+LvmE5pQ8fQosViIyOHOBi8CVVhO J6PmU80Y9MwsX7+e3BYqKc7PGfwmhiDToIO5DX35mP9M+TQDCubpt9qKAs/4MNeweXoZ Bv6xRTj2HxpouULBCdd+x1lMSF0JipscIeEeIFUdkUY6a1x9uZWOo9dPD3TuGEY5pze+ J78pfzvMFsGfwns6f7LzQDsw86xyvDuWohvx9BS/cNuNurpOgd3Zt6UHO+tsQAoQnLto r4fFJ9duEn5NufTJ+YN/GWbC8WjCGZWwU54J/UkwlCIN4bgJ4qHr16atUn5+Ve0zUfy1 Oziw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=XbMrezaMD0p4i3SGBGMVhsDuOIGR0bDHjQFGAvfTghk=; b=Veq9CbliawIYQij2TRw3yrROTLAGn+ItuZwhCPDj6f5vW7ddmtBi9sdTzAQsEXmaf8 s83xnjBS/ZW2eDKRf6phVOEiZrlE0Z02UJGMR2s/uKyGUp1dA7XP4AEE8y/d5xF+5FMq I0Hax4ikqi74GFAbwmlpuxd33wGbouY4Nv0YsXuPJrdyjintww1xtn1IBbD2r91K7xo3 Zc9vnEL0erfBaqIG0STaJdRMV45CTecrhf1XQJanbOrPWqpPnHBJ46WWl4gf16j85n06 oo3HZk/yIV7KEW56w72KnTmGdKPcY+p2WotP+KN6LRnKO39O+3aRrrfIj4+RI1rwKru4 S53Q== X-Gm-Message-State: APjAAAWGB1EGJet2g/Gq8tcSv7FqM18qL3mUVFlDeRzHSz/X5CVd5Og/ TuJfWoq2uaFy/8lEA4d6d0mukA== X-Received: by 2002:a17:902:74c5:: with SMTP id f5mr78136579plt.229.1577911688023; Wed, 01 Jan 2020 12:48:08 -0800 (PST) Received: from virtualhost-PowerEdge-R810.synapse.com ([195.238.92.107]) by smtp.gmail.com with ESMTPSA id z22sm53774752pfr.83.2020.01.01.12.48.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jan 2020 12:48:07 -0800 (PST) From: roman.stratiienko@globallogic.com To: mripard@kernel.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, jernej.skrabec@siol.net Cc: Roman Stratiienko Subject: [PATCH v3 1/2] drm/sun4i: Add mode_set callback to the engine Date: Wed, 1 Jan 2020 22:47:49 +0200 Message-Id: <20200101204750.50541-1-roman.stratiienko@globallogic.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Roman Stratiienko Create callback to update engine's registers on mode change. Signed-off-by: Roman Stratiienko Reviewed-by: Jernej Skrabec --- v2: - Split commit in 2 parts. - Add description to mode_set callback - Dropped 1 line from sun4i_crtc_mode_set_nofb() - Add struct drm_display_mode declaration (fix build warning) v3: - Pick reviewed-by line - Add missing 'and' word to the mode_set callback description. --- drivers/gpu/drm/sun4i/sun4i_crtc.c | 3 +++ drivers/gpu/drm/sun4i/sunxi_engine.h | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/drivers/gpu/drm/sun4i/sun4i_crtc.c b/drivers/gpu/drm/sun4i/sun4i_crtc.c index 3a153648b369..f9c627d601c3 100644 --- a/drivers/gpu/drm/sun4i/sun4i_crtc.c +++ b/drivers/gpu/drm/sun4i/sun4i_crtc.c @@ -141,6 +141,9 @@ static void sun4i_crtc_mode_set_nofb(struct drm_crtc *crtc) struct sun4i_crtc *scrtc = drm_crtc_to_sun4i_crtc(crtc); sun4i_tcon_mode_set(scrtc->tcon, encoder, mode); + + if (scrtc->engine->ops->mode_set) + scrtc->engine->ops->mode_set(scrtc->engine, mode); } static const struct drm_crtc_helper_funcs sun4i_crtc_helper_funcs = { diff --git a/drivers/gpu/drm/sun4i/sunxi_engine.h b/drivers/gpu/drm/sun4i/sunxi_engine.h index 548710a936d5..7faa844646ff 100644 --- a/drivers/gpu/drm/sun4i/sunxi_engine.h +++ b/drivers/gpu/drm/sun4i/sunxi_engine.h @@ -9,6 +9,7 @@ struct drm_plane; struct drm_device; struct drm_crtc_state; +struct drm_display_mode; struct sunxi_engine; @@ -108,6 +109,17 @@ struct sunxi_engine_ops { * This function is optional. */ void (*vblank_quirk)(struct sunxi_engine *engine); + + /** + * @mode_set: + * + * This callback is used to update engine registers that + * responsible for display frame size and other mode attributes. + * + * This function is optional. + */ + void (*mode_set)(struct sunxi_engine *engine, + struct drm_display_mode *mode); }; /** -- 2.17.1