Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1274043pxb; Thu, 24 Mar 2022 16:38:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyBmSvnLpyrj2dDKSJKvTGtrdUKMWCFrdS1bb3nXUHZwURUO8NKzOwvc8CQ6JRbF94G/L8N X-Received: by 2002:a17:90b:4c8c:b0:1c6:f86d:a6f5 with SMTP id my12-20020a17090b4c8c00b001c6f86da6f5mr21441710pjb.15.1648165112983; Thu, 24 Mar 2022 16:38:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648165112; cv=none; d=google.com; s=arc-20160816; b=Bs4Ocvv5TiW6ohpAkxM0EnJo1EmjNGh0oIYNQHlt3xEC+YkfJh4EUTCaqqlCJV4BM8 DpIJldz8gRxglpX5Pw6z1JZ9MA22vkMK5xpmyvjk2TVss/Yw0doieXIP8Rwyp1+0fvc1 6DkltyWndeP5lZcdznHl0Zb9TVWToI0Vc6deyepITSbbww6keK6p49QfPWCh8G1TRp/Z R+xrH5bOZYg0vBGgxcpd5lySu7jHto+7slN4oXOziopJSGJRHB3ygpX0whXq7COQCcuo O6i6Zor3ckdUbf7ElVFt40u8Ag226x7h1TL+X+6bIUkq6w9YzsxOm3a/Jrn8jCfz0Ops Qo1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=xioJZ+2YEDofGMEutA63IvvOM8iQOGldWfvAdOVrV34=; b=lhoTTsSzWRf+K+HWO3mIvhQc5nOJt6IeszVepcuf3+Jtg+7j2VP7RdRbL7rJMoKqeE w+hPiRIoE5j4ygzj5fnY8+vMHTSbZ6BF+ZNkBFAA85RrHo8YgWR1eMEiPHYqcJ7baZ31 0bwN8Y4Q8Uz7HkWuVnnWxLtLk1Xp8H3VrycP8KpCgirQVDNTO5cKHDqFg479LNGa2Ndf J+MBnF6ED3GEIdWDJuSTzRKL19cwLowqKfu1vVlK96u3fs1f7l1EGziHbRSNR/ReL7vo DYFZTC0V6chAWMEUjFZwlSY98SZYhATpB0DhtjgzopjGBr3YL5ne8IF8aKwObXKqRUiX Nx5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=D2es6Rjp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l76-20020a633e4f000000b003816043eeffsi703771pga.244.2022.03.24.16.38.18; Thu, 24 Mar 2022 16:38:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=D2es6Rjp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351332AbiCXPn2 (ORCPT + 99 others); Thu, 24 Mar 2022 11:43:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242256AbiCXPn2 (ORCPT ); Thu, 24 Mar 2022 11:43:28 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6703EBE2C; Thu, 24 Mar 2022 08:41:56 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id F213661834; Thu, 24 Mar 2022 15:41:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D5703C340EC; Thu, 24 Mar 2022 15:41:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1648136515; bh=doZwDOyg5aAln9B5DrZ3TY24Ms37FN+svJ7hBf9kLOA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=D2es6RjpWpnvAYmQBArcDtITQiqCqQkxdHOTn+VLib8RpjRqoz7Bk42YaQeIkW4B+ YV4riix7mFJO6aTCfBltJ+fHD9NcvbmSVUgVRccYTsAThnjUvTUElpQVWLkEmXn3XP 0KARQD6J5sux0XLqkyQczgxTdKj6a0blrlIj64sjOTOnkhpG5IQOzN1na+sGcth01V BHerFSDNphjfIgtjIwzEyNtiuKx5MEFUnf8zYDfP5QxivQK6NnsEXMMHf83nTw7iCV 0JmhQp4Rh9K55bYoS3LHd/KRXZDaoGGhW53QMIr6NdwapjmHHWkxiYfwY5Yfp7IlAG xZBPVqEuXQxJA== Date: Thu, 24 Mar 2022 21:11:50 +0530 From: Vinod Koul To: Marijn Suijten Cc: Rob Clark , linux-arm-msm@vger.kernel.org, Bjorn Andersson , David Airlie , Daniel Vetter , Jonathan Marek , Dmitry Baryshkov , Abhinav Kumar , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Subject: Re: [REPOST PATCH v4 07/13] drm/msm/disp/dpu1: Add support for DSC in encoder Message-ID: References: <20220210103423.271016-1-vkoul@kernel.org> <20220210103423.271016-8-vkoul@kernel.org> <20220217223239.2i256klkbjkogovz@SoMainline.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23-03-22, 20:10, Vinod Koul wrote: > On 17-02-22, 23:32, Marijn Suijten wrote: > > On 2022-02-10 16:04:17, Vinod Koul wrote: > > > + > > > + slice_count = dsc->drm->slice_count; > > > + slice_per_intf = DIV_ROUND_UP(width, dsc->drm->slice_width); > > > + > > > + /* > > > + * If slice_count is greater than slice_per_intf then default to 1. > > > + * This can happen during partial update. > > > + */ > > > + if (slice_count > slice_per_intf) > > > + slice_count = 1; > > > + > > > + bytes_in_slice = DIV_ROUND_UP(dsc->drm->slice_width * > > > + dsc->drm->bits_per_pixel, 8); > > > + total_bytes_per_intf = bytes_in_slice * slice_per_intf; > > > + > > > + dsc->eol_byte_num = total_bytes_per_intf % 3; > > > + dsc->pclk_per_line = DIV_ROUND_UP(total_bytes_per_intf, 3); > > > + dsc->bytes_in_slice = bytes_in_slice; > > > + dsc->bytes_per_pkt = bytes_in_slice * slice_count; > > > + dsc->pkt_per_line = slice_per_intf / slice_count; > > > +} > > > > I've seen the same calculations duplicated twice in dsi code. Since the > > msm_display_dsc_config struct is available in a header, perhaps a single > > - easily reviewable and maintainable - calculation function should be > > available there too? > > Let me try check if we can make it common.. I rechecked and we can actually remove this as we do this caln in timing and update the dsc structure there. So this fn is dropped now -- ~Vinod