From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8C77AC54EE9 for ; Tue, 6 Sep 2022 20:05:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=7hQX/nsXoEN0rwNZzv9292VXz+zegqRXNs6SeS2dbAA=; b=SxvfGOcTlp0/4l rooBPcyd7A2XKspkXztKKH4bDBywEAz/PxgAK6Oq9b8XrgBpv5hDTgP3KHFc7C7PApEB8iwRot0Cp CUvDn3MZTpIUkxClM1rQ9Ir/B8JRksec65yMLHUKZfytYdXQxWfurV0o9ekNzruSuQNYbQ9vfs0En 8B7Eo8R1Zs+aC7cNnkGkYM8x1OtHcEPozKu4RwPKOy1hHM5Dt+8POIPiAZ82LmDJvF+pmzF6WNzRS 39WB1M9OxbbPw83SZuQXr7Rmt9Hv4z9zAtnfB1Uf3U9DeniDGj4VDxr9i5I+alE53aAU94RwmKhvZ MKPZSw+DkHP6JyEtBVHA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVeoL-00GySe-0j; Tue, 06 Sep 2022 20:04:41 +0000 Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oVeoI-00GyQj-0V for linux-arm-kernel@lists.infradead.org; Tue, 06 Sep 2022 20:04:39 +0000 Received: by mail-ed1-x535.google.com with SMTP id m1so16594049edb.7 for ; Tue, 06 Sep 2022 13:04:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=plI2ccCtxFfQQaA/IHicso25P4hNeiGkni4LSwxPbm4=; b=Oa0+iWZ5DBGIMbtbaWYlC5APlU/wi67OB46kQ8Fked1WkqCJO7eSuYV4pXcpMtsrLh h4m8ns9bM2EwwF1pb3EvhBxIuI6zX9ev0R6fn6dUX6ngsdv7SQcvBDNqWnFLGSyURMsG 3t1udFKm1hYrJJ9BkltIYCn31OmFy6AZPUQ8/Sj6T1LlhFdQjhA57LTt7OJxR5vTJLKR IuunwxnSMYyOBJoMqzyfHehMGdq3P/FdVikYQbvRTcieYwm9qSRwWDkFuVFhqCAaAZGj eCCSN7KdX2r0rqA0gSJxLFOqvSdqphm5EeP5zTMWlKZ20BzoIgCkXDmhh8P46XPQ9TEb YhLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=plI2ccCtxFfQQaA/IHicso25P4hNeiGkni4LSwxPbm4=; b=NhbNpIdCTUHEdagDvNkL/KGiETE75cwfeuYfkhVvqLTvEwvKv19f0Hj1jcfjC5Sz2c euPbY/4bWcUC5lItjOBDXqLkP6YTZKl5HwRi8dQokQEtVLBPKt+VQRFhKD6kyT8ixqps 0nTcZWlccGExGw0ItaKKqRYHBfg8OZEEnG1mpT4lqYF5czCChQYYNUl8ThIu4v5UjG1Y 3dtPbgK90L81olcp/GIFW03zDUppgAaFKfzNm+aNvjKxZywFltWiYmyvNF+sXl+lc+q6 sqSj71TxzKE2JxEBWFxblF1ZOXVC0Q0dKKn5zxnEYc3aKvW9niDi1n6JW/t0k9Xc7eRb 4UYQ== X-Gm-Message-State: ACgBeo0NSYehPgvzlDWNn/kmN4nAz2jqRQrEoWLrbikKQ+18ANs/AtqK 75j4PQ0zaxFctQvMre2lCWo= X-Google-Smtp-Source: AA6agR6Kk9aCcEfrY5Ey5jOi/kWmdkQVgNAUGJ16H1QclaprIGEZQnyZQvab5nv2idHUjXMCwzagDQ== X-Received: by 2002:a05:6402:911:b0:44e:a5b4:74f7 with SMTP id g17-20020a056402091100b0044ea5b474f7mr211765edz.249.1662494675009; Tue, 06 Sep 2022 13:04:35 -0700 (PDT) Received: from kista.localnet (82-149-1-172.dynamic.telemach.net. [82.149.1.172]) by smtp.gmail.com with ESMTPSA id i6-20020a170906850600b0073d9a0d0cbcsm7193709ejx.72.2022.09.06.13.04.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Sep 2022 13:04:33 -0700 (PDT) From: Jernej =?utf-8?B?xaBrcmFiZWM=?= To: Maxime Ripard , Ben Skeggs , David Airlie , Chen-Yu Tsai , Thomas Zimmermann , Jani Nikula , Lyude Paul , Philipp Zabel , Maarten Lankhorst , Rodrigo Vivi , Tvrtko Ursulin , Samuel Holland , Karol Herbst , Noralf =?ISO-8859-1?Q?Tr=F8nnes?= , Emma Anholt , Daniel Vetter , Joonas Lahtinen , Maxime Ripard Cc: Maxime Ripard , Hans de Goede , linux-arm-kernel@lists.infradead.org, Phil Elwell , intel-gfx@lists.freedesktop.org, Dave Stevenson , dri-devel@lists.freedesktop.org, Dom Cobley , linux-kernel@vger.kernel.org, nouveau@lists.freedesktop.org, linux-sunxi@lists.linux.dev, Mateusz Kwiatkowski , Geert Uytterhoeven Subject: Re: [PATCH v2 36/41] drm/sun4i: tv: Merge mode_set into atomic_enable Date: Tue, 06 Sep 2022 22:04:32 +0200 Message-ID: <10138422.nUPlyArG6x@kista> In-Reply-To: <20220728-rpi-analog-tv-properties-v2-36-459522d653a7@cerno.tech> References: <20220728-rpi-analog-tv-properties-v2-0-459522d653a7@cerno.tech> <20220728-rpi-analog-tv-properties-v2-36-459522d653a7@cerno.tech> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220906_130438_084994_2B6C03E1 X-CRM114-Status: GOOD ( 18.98 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Dne ponedeljek, 29. avgust 2022 ob 15:11:50 CEST je Maxime Ripard napisal(a): > Our mode_set implementation can be merged into our atomic_enable > implementation to simplify things, so let's do this. Are you sure this is a good thing in long term? What if user wants to change mode? Unlikely, but why not. Best regards, Jernej > > Signed-off-by: Maxime Ripard > > diff --git a/drivers/gpu/drm/sun4i/sun4i_tv.c > b/drivers/gpu/drm/sun4i/sun4i_tv.c > index f7aad995ab5b..3944da9a3c34 100644 > --- a/drivers/gpu/drm/sun4i/sun4i_tv.c > +++ b/drivers/gpu/drm/sun4i/sun4i_tv.c > @@ -359,23 +359,13 @@ static void sun4i_tv_enable(struct drm_encoder > *encoder, { > struct sun4i_tv *tv = drm_encoder_to_sun4i_tv(encoder); > struct sun4i_crtc *crtc = drm_crtc_to_sun4i_crtc(encoder->crtc); > - > - DRM_DEBUG_DRIVER("Enabling the TV Output\n"); > - > - sunxi_engine_apply_color_correction(crtc->engine); > - > - regmap_update_bits(tv->regs, SUN4I_TVE_EN_REG, > - SUN4I_TVE_EN_ENABLE, > - SUN4I_TVE_EN_ENABLE); > -} > - > -static void sun4i_tv_mode_set(struct drm_encoder *encoder, > - struct drm_display_mode *mode, > - struct drm_display_mode *adjusted_mode) > -{ > - struct sun4i_tv *tv = drm_encoder_to_sun4i_tv(encoder); > + struct drm_crtc_state *crtc_state = > + drm_atomic_get_new_crtc_state(state, encoder->crtc); > + struct drm_display_mode *mode = &crtc_state->mode; > const struct tv_mode *tv_mode = sun4i_tv_find_tv_by_mode(mode); > > + DRM_DEBUG_DRIVER("Enabling the TV Output\n"); > + > /* Enable and map the DAC to the output */ > regmap_update_bits(tv->regs, SUN4I_TVE_EN_REG, > SUN4I_TVE_EN_DAC_MAP_MASK, > @@ -468,12 +458,17 @@ static void sun4i_tv_mode_set(struct drm_encoder > *encoder, > SUN4I_TVE_RESYNC_FIELD : 0)); > > regmap_write(tv->regs, SUN4I_TVE_SLAVE_REG, 0); > + > + sunxi_engine_apply_color_correction(crtc->engine); > + > + regmap_update_bits(tv->regs, SUN4I_TVE_EN_REG, > + SUN4I_TVE_EN_ENABLE, > + SUN4I_TVE_EN_ENABLE); > } > > static const struct drm_encoder_helper_funcs sun4i_tv_helper_funcs = { > .atomic_disable = sun4i_tv_disable, > .atomic_enable = sun4i_tv_enable, > - .mode_set = sun4i_tv_mode_set, > }; > > static int sun4i_tv_comp_get_modes(struct drm_connector *connector) > > -- > b4 0.10.0-dev-65ba7 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel