Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3772260imu; Mon, 14 Jan 2019 08:46:33 -0800 (PST) X-Google-Smtp-Source: ALg8bN4DkSH9T5m5JUOzVxYCF6SU48smr05ZXNquSn9JS+9xFP6QAstqRUozncZryKgoNFKKaxem X-Received: by 2002:a17:902:720c:: with SMTP id ba12mr26307413plb.79.1547484393228; Mon, 14 Jan 2019 08:46:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547484393; cv=none; d=google.com; s=arc-20160816; b=nckAe56fzNSISCHSNkT7Nc/cELgFJcs8g5DV0F+lw9t9lDZddtHPAgfW3e7dPBTEEG +q2JCDFIrX6vCwXWSDdPV8GPNb/FqB4LXg3/M3UQ+Sht3AT8SSaZ/spvBVQVUlRQRmrR RsQ9GX2Y7ZpkSMRa3FQebRV4wN86DSror8nsemtuRkuRIaG1w5qp/Fsi6M+LYxwBm7hP 8L5OmfUj8otb5w9vEg1awL94JXNcDkJS6zb/PXY59s1dDE1xy1zUlL7kwbCcDAmwC9kL mvWKgmYYzKS/cJ6N9Py3uyj0SZlnAdIjG405OM4PCV96o+aTF5dfqYP5t0yn4t/xDeBl AZHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=tE/gXHwhBKdOi5gJGjJHIcmIchLmOlWGfjqq3DKg2TA=; b=tTpYQaSD5wgVSk3X1CI3W02uqKV0ePRXdXUaaVBAy8xlxZWteX3bRGhJ5d852Vopo5 oM9o7TrbXREB5NDTJy8qIOU7aPXQFUuA8mQbwI49TYW5zW/L7wwjDlisoceH2DBgbnKP 9tM7H/p8O3ZNXlQKIJeYKC9iG7NyL8AUstNnhqD+QsGvoh0J5/TdB6/8xdE6pV8m818/ fgX6EIxCcKOe9u2koKst3JJfM4gNc3ICxmeCWI7244X1A++ElFxCR0Tlmlu0NXs5bBnF vqZkusNCmaAiixqmdSmi1iyE9o6U1IRXr5+9rSu56nRjM1PKW+bmbo69Dsk2Xad82Ox6 McwA== ARC-Authentication-Results: i=1; mx.google.com; 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 k12si710757pgg.382.2019.01.14.08.46.16; Mon, 14 Jan 2019 08:46:33 -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; 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 S1726832AbfANQox (ORCPT + 99 others); Mon, 14 Jan 2019 11:44:53 -0500 Received: from honk.sigxcpu.org ([24.134.29.49]:45948 "EHLO honk.sigxcpu.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726804AbfANQox (ORCPT ); Mon, 14 Jan 2019 11:44:53 -0500 Received: from localhost (localhost [127.0.0.1]) by honk.sigxcpu.org (Postfix) with ESMTP id B25C4FB04; Mon, 14 Jan 2019 17:37:11 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at honk.sigxcpu.org Received: from honk.sigxcpu.org ([127.0.0.1]) by localhost (honk.sigxcpu.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5QTgmjqCxMHl; Mon, 14 Jan 2019 17:37:09 +0100 (CET) Received: by bogon.sigxcpu.org (Postfix, from userid 1000) id 8D44947303; Mon, 14 Jan 2019 17:37:08 +0100 (CET) Date: Mon, 14 Jan 2019 17:37:08 +0100 From: Guido =?iso-8859-1?Q?G=FCnther?= To: Robert Chiras Cc: Daniel Vetter , Philipp Zabel , Marek Vasut , Anson Huang , David Airlie , "linux-kernel@vger.kernel.org" , Mirela Rabulea , "dri-devel@lists.freedesktop.org" , "kernel@pengutronix.de" , Fabio Estevam , Shawn Guo , dl-linux-imx Subject: Re: [PATCH 07/10] drm/mxsfb: Signal mode changed when bpp changed Message-ID: <20190114163708.GA24994@bogon.m.sigxcpu.org> References: <1547043209-8283-1-git-send-email-robert.chiras@nxp.com> <1547043209-8283-8-git-send-email-robert.chiras@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1547043209-8283-8-git-send-email-robert.chiras@nxp.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Wed, Jan 09, 2019 at 02:13:47PM +0000, Robert Chiras wrote: > From: Mirela Rabulea > > Add mxsfb_atomic_helper_check to signal mode changed when bpp changed. > This will trigger the execution of disable/enable on > a modeset with different bpp than the current one. > > Signed-off-by: Mirela Rabulea > --- > drivers/gpu/drm/mxsfb/mxsfb_drv.c | 48 ++++++++++++++++++++++++++++++++++++++- > 1 file changed, 47 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/mxsfb/mxsfb_drv.c b/drivers/gpu/drm/mxsfb/mxsfb_drv.c > index d3fb3a8..f528a37 100644 > --- a/drivers/gpu/drm/mxsfb/mxsfb_drv.c > +++ b/drivers/gpu/drm/mxsfb/mxsfb_drv.c > @@ -115,9 +115,55 @@ void mxsfb_disable_axi_clk(struct mxsfb_drm_private *mxsfb) > clk_disable_unprepare(mxsfb->clk_axi); > } > > +/** > + * mxsfb_atomic_helper_check - validate state object > + * @dev: DRM device > + * @state: the driver state object > + * > + * On top of the drm imlementation drm_atomic_helper_check, > + * check if the bpp is changed, if so, signal mode_changed, > + * this will trigger disable/enable > + * > + * RETURNS: > + * Zero for success or -errno > + */ > +static int mxsfb_atomic_helper_check(struct drm_device *dev, > + struct drm_atomic_state *state) > +{ > + struct drm_crtc *crtc; > + struct drm_crtc_state *crtc_state; > + int i, ret; > + > + ret = drm_atomic_helper_check(dev, state); > + if (ret) > + return ret; > + > + for_each_crtc_in_state(state, crtc, crtc_state, i) { This does not exist anymore in recent drm, see 9ba29fcb76a559078491adffc74f66bf92b9dbea. Cheers, -- Guido > + struct drm_plane_state *primary_state; > + int old_bpp = 0; > + int new_bpp = 0; > + > + if (!crtc->primary || !crtc->primary->old_fb) > + continue; > + primary_state = > + drm_atomic_get_plane_state(state, crtc->primary); > + if (!primary_state || !primary_state->fb) > + continue; > + old_bpp = crtc->primary->old_fb->format->depth; > + new_bpp = primary_state->fb->format->depth; > + if (old_bpp != new_bpp) { > + crtc_state->mode_changed = true; > + DRM_DEBUG_ATOMIC( > + "[CRTC:%d:%s] mode changed, bpp %d->%d\n", > + crtc->base.id, crtc->name, old_bpp, new_bpp); > + } > + } > + return ret; > +} > + > static const struct drm_mode_config_funcs mxsfb_mode_config_funcs = { > .fb_create = drm_gem_fb_create, > - .atomic_check = drm_atomic_helper_check, > + .atomic_check = mxsfb_atomic_helper_check, > .atomic_commit = drm_atomic_helper_commit, > }; > > -- > 2.7.4 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel