Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2170626pxb; Tue, 12 Oct 2021 00:23:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzcweV5H+2gSTFgVznrovte28goadMD4vT7Ipu2eLIjhssMtz3p9NP6ChAv46f6q1ca6hZA X-Received: by 2002:a17:906:4702:: with SMTP id y2mr32445419ejq.114.1634023424616; Tue, 12 Oct 2021 00:23:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634023424; cv=none; d=google.com; s=arc-20160816; b=EeAyCTit0ttcvlguV2bh5zw36pAHyWLakKPiEhGf7IxSxzopw/bj5FIqSj09Uv+oMl pnfHTI5W97GCQrm+STOvTsS0rZEB8GaSV2occRpDY/CGay5/bcUQ/S2GrHNFahnxZcaY 1zunn08jy107afqZmq1MP4DmgiGnAAa1Ytt8+E2NQpked33K5r33N5beSe9O/GGAHAcb eAftZaBBxt9D3mkS9hRbbYS5uotWuuGlDL3g8TkmGN0zyYdPyDvo3wotvRklWD+PpyD6 aqw8J4bOnf7RLSdghoPrfjA2RXNqtutXsu9CzLNS/jPI1HoAgxl/11VNNyomgensvkpy vTCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=RvUuvMHAh90JOmhvojgnnTNNBPQ8ki0pJz+UvlLtOP4=; b=n/VWMBgBWdzxZDQQqcK78NtBI7x4fobo08aHMc44nClELL7f37sOrg/TqsLVwuvyGF UpvkQjpQmqtGGLyfpOgNDwqzY4BlOcEVmygHcjzta0Cd3WYitWrLz6LsTVhzK3dXbzn3 PCyiFqZHQ1PxxQizDrmHSZNMpojNLa4WiKJRSjXPmc6wkBg/zyyLrsAmgDIA/6SQ7hC0 yx/4Emk0Am6CkWIUUuzZhbveavgTz19+yEcrdjIC0Oyc4l+kAetQw+t7K/P/J+x7G/ac vpQo7lWgjjdYxiYC+kjr4a50XcWuxBidUlmDowzZcjoaU3Fw6WReFDGyg6ksrCDiOOmc R1aA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=HGHS9HXB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j20si14076399edq.485.2021.10.12.00.23.19; Tue, 12 Oct 2021 00:23:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=HGHS9HXB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233926AbhJLHX1 (ORCPT + 99 others); Tue, 12 Oct 2021 03:23:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233507AbhJLHX0 (ORCPT ); Tue, 12 Oct 2021 03:23:26 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F041AC061570; Tue, 12 Oct 2021 00:21:24 -0700 (PDT) Received: from [192.168.1.111] (91-158-153-130.elisa-laajakaista.fi [91.158.153.130]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 31B81F1; Tue, 12 Oct 2021 09:21:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1634023283; bh=UdFCjI4cwaSDdeWWXv/2XqR4Rxx5UVD22jWQA8TQ7/o=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=HGHS9HXB3+qbhYLqY2jHEU/IwHJk1VsZ+KFTLgjyWp0JmU6FxuVHWH5dpLodndPEb uXOdIJFkSXtzpiyPzLAC6BTsBKup7eGyxP5GQwUBDlCPPYZFLggtZ56o7Vo4wXU3Zl G+BhhuFQMsfIQKmeZXZL6Z6U2yJ4OmXZv3RfRYNU= Subject: Re: [PATCH v5 1/8] drm/omap: Add ability to check if requested plane modes can be supported To: Neil Armstrong Cc: linux-omap@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, khilman@baylibre.com, Benoit Parrot References: <20210923070701.145377-1-narmstrong@baylibre.com> <20210923070701.145377-2-narmstrong@baylibre.com> From: Tomi Valkeinen Message-ID: Date: Tue, 12 Oct 2021 10:21:20 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20210923070701.145377-2-narmstrong@baylibre.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 23/09/2021 10:06, Neil Armstrong wrote: > From: Benoit Parrot > > We currently assume that an overlay has the same maximum width and > maximum height as the overlay manager. This assumption is incorrect. On > some variants the overlay manager maximum width is twice the maximum > width that the overlay can handle. We need to add the appropriate data > per variant as well as export a helper function to retrieve the data so > check can be made dynamically in omap_plane_atomic_check(). > > Signed-off-by: Benoit Parrot > Signed-off-by: Neil Armstrong > --- > drivers/gpu/drm/omapdrm/dss/dispc.c | 22 ++++++++++++++++++++++ > drivers/gpu/drm/omapdrm/dss/dss.h | 2 ++ > drivers/gpu/drm/omapdrm/omap_plane.c | 14 ++++++++++++++ > 3 files changed, 38 insertions(+) > > diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c > index 3c4a4991e45a..bdecec8f4d88 100644 > --- a/drivers/gpu/drm/omapdrm/dss/dispc.c > +++ b/drivers/gpu/drm/omapdrm/dss/dispc.c > @@ -92,6 +92,8 @@ struct dispc_features { > u8 mgr_height_start; > u16 mgr_width_max; > u16 mgr_height_max; > + u16 ovl_width_max; > + u16 ovl_height_max; > unsigned long max_lcd_pclk; > unsigned long max_tv_pclk; > unsigned int max_downscale; > @@ -2599,6 +2601,12 @@ static int dispc_ovl_calc_scaling(struct dispc_device *dispc, > return 0; > } > > +void dispc_ovl_get_max_size(struct dispc_device *dispc, u16 *width, u16 *height) > +{ > + *width = dispc->feat->ovl_width_max; > + *height = dispc->feat->ovl_height_max; > +} > + > static int dispc_ovl_setup_common(struct dispc_device *dispc, > enum omap_plane_id plane, > enum omap_overlay_caps caps, > @@ -4240,6 +4248,8 @@ static const struct dispc_features omap24xx_dispc_feats = { > .mgr_height_start = 26, > .mgr_width_max = 2048, > .mgr_height_max = 2048, > + .ovl_width_max = 2048, > + .ovl_height_max = 2048, > .max_lcd_pclk = 66500000, > .max_downscale = 2, > /* > @@ -4278,6 +4288,8 @@ static const struct dispc_features omap34xx_rev1_0_dispc_feats = { > .mgr_height_start = 26, > .mgr_width_max = 2048, > .mgr_height_max = 2048, > + .ovl_width_max = 2048, > + .ovl_height_max = 2048, > .max_lcd_pclk = 173000000, > .max_tv_pclk = 59000000, > .max_downscale = 4, > @@ -4313,6 +4325,8 @@ static const struct dispc_features omap34xx_rev3_0_dispc_feats = { > .mgr_height_start = 26, > .mgr_width_max = 2048, > .mgr_height_max = 2048, > + .ovl_width_max = 2048, > + .ovl_height_max = 2048, > .max_lcd_pclk = 173000000, > .max_tv_pclk = 59000000, > .max_downscale = 4, > @@ -4348,6 +4362,8 @@ static const struct dispc_features omap36xx_dispc_feats = { > .mgr_height_start = 26, > .mgr_width_max = 2048, > .mgr_height_max = 2048, > + .ovl_width_max = 2048, > + .ovl_height_max = 2048, > .max_lcd_pclk = 173000000, > .max_tv_pclk = 59000000, > .max_downscale = 4, > @@ -4383,6 +4399,8 @@ static const struct dispc_features am43xx_dispc_feats = { > .mgr_height_start = 26, > .mgr_width_max = 2048, > .mgr_height_max = 2048, > + .ovl_width_max = 2048, > + .ovl_height_max = 2048, > .max_lcd_pclk = 173000000, > .max_tv_pclk = 59000000, > .max_downscale = 4, > @@ -4418,6 +4436,8 @@ static const struct dispc_features omap44xx_dispc_feats = { > .mgr_height_start = 26, > .mgr_width_max = 2048, > .mgr_height_max = 2048, > + .ovl_width_max = 2048, > + .ovl_height_max = 2048, > .max_lcd_pclk = 170000000, > .max_tv_pclk = 185625000, > .max_downscale = 4, > @@ -4457,6 +4477,8 @@ static const struct dispc_features omap54xx_dispc_feats = { > .mgr_height_start = 27, > .mgr_width_max = 4096, > .mgr_height_max = 4096, > + .ovl_width_max = 2048, > + .ovl_height_max = 4096, > .max_lcd_pclk = 170000000, > .max_tv_pclk = 192000000, > .max_downscale = 4, > diff --git a/drivers/gpu/drm/omapdrm/dss/dss.h b/drivers/gpu/drm/omapdrm/dss/dss.h > index a547527bb2f3..14c39f7c3988 100644 > --- a/drivers/gpu/drm/omapdrm/dss/dss.h > +++ b/drivers/gpu/drm/omapdrm/dss/dss.h > @@ -397,6 +397,8 @@ int dispc_get_num_mgrs(struct dispc_device *dispc); > const u32 *dispc_ovl_get_color_modes(struct dispc_device *dispc, > enum omap_plane_id plane); > > +void dispc_ovl_get_max_size(struct dispc_device *dispc, u16 *width, u16 *height); > + > u32 dispc_read_irqstatus(struct dispc_device *dispc); > void dispc_clear_irqstatus(struct dispc_device *dispc, u32 mask); > void dispc_write_irqenable(struct dispc_device *dispc, u32 mask); > diff --git a/drivers/gpu/drm/omapdrm/omap_plane.c b/drivers/gpu/drm/omapdrm/omap_plane.c > index 512af976b7e9..d0a67b7ed1a0 100644 > --- a/drivers/gpu/drm/omapdrm/omap_plane.c > +++ b/drivers/gpu/drm/omapdrm/omap_plane.c > @@ -109,11 +109,18 @@ static int omap_plane_atomic_check(struct drm_plane *plane, > { > struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, > plane); > + struct omap_drm_private *priv = plane->dev->dev_private; > struct drm_crtc_state *crtc_state; > + u16 width, height; > + u32 width_fp, height_fp; I think naming these max_w/max_width etc. would be better. Tomi