From patchwork Fri May 21 12:49:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 444670 Delivered-To: patch@linaro.org Received: by 2002:a02:7a1b:0:0:0:0:0 with SMTP id a27csp946523jac; Fri, 21 May 2021 05:50:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQWRjrCbAuXzIGJVNiT+JqJ4a30KDzvzMst/J5lqV31/1tYPcDtW+7sR3YKQ7fjlulVu7K X-Received: by 2002:a17:90a:4545:: with SMTP id r5mr11019425pjm.51.1621601407939; Fri, 21 May 2021 05:50:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621601407; cv=none; d=google.com; s=arc-20160816; b=X25b+19Bim38Jir6c6WFQaq2Tg+gCtfrBRlnr8l++whyreZS2oDJSzXzmujvYUuH0E Coqhj1BkduGUPidQfWCDP6u1qrQo2s5YWq+SJ6c9inSl5zRtA8KBC1NcDIkNFyKebeLe yQLU/Vuyaldz9Iqhw0+l4DPVZsEjjkKlKYAm4A7TET/WhlVkMAj5QsqhDvP6J1rq0/oL MT80M+HC5VDb9MIHrA97wOXaZbZ+mnxsj/IkzuUTYWVhnFpcLlFS6FoOejtA+nDZGVYl t7x4VGQdZo7kRGgGb7cTJlO0nQgkgZ5E88SzCUjDdUNvKrfJ8FctlwWdANXF+jlr4GS7 fElQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature:delivered-to; bh=yI+oQr1s/sKiPNY0eQBU/prVaCIigfQn+NctM3E+dvE=; b=ocSMFY8Ua6TMTdokiQVeK7jGlxbK3bEsHfqd23nlnWSf9A/RHjw3cRAJYjEcqLjqRw qQLjp4fa9Gk2VXfiGKVWYyf5X4pdVeDgajfYXfWKhIpjYnDgGg6Qt6hxMYJgo+ygM5va gmWK3wNRWm7HXkRely7j874JCu3DVI216EB0Q2lrRTL15CRo6TokaXNVoXB5aqhN1A7Q hs6sccsNlM54owebq2gWRlslsPq75XMfl5dlwd5S77c6tk3HPhFBsHvtKHrQ98hTMSRf plp0sgeZgNjWuqFFe2AEyAAI9vgihFpxvGLJGta8phpi/Gxi+fUrywph/0WlimuxocJI F1pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=S7mAlvha; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id p20si6925311plq.437.2021.05.21.05.50.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 May 2021 05:50:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=S7mAlvha; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BEEC36E4F9; Fri, 21 May 2021 12:50:05 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by gabe.freedesktop.org (Postfix) with ESMTPS id 92E9D6E4F8; Fri, 21 May 2021 12:50:03 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id A5BEC613DD; Fri, 21 May 2021 12:49:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1621601403; bh=Eo+Q/n/ObHKYPA8KdmfJSeka049NRwoo0j4Nc78qMAM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S7mAlvhails2QDce0UEUE5pSdbFrXQgTe0wQ0BT0JeYpvxalnkvc8GPXDKOsaeT+c 0LVAWUShmJWd7gu9H8fu/MFT3MQZEy8ko9/7KJ6CvS++2KJjvTfUydORnDBvc66Jak x+MaNuFzcT9p8NEp43E8t/Kdm1/l1cf134Knd64YT9ObRwZYSVfYi0LPuYY04qqrip qUsu9UpI21WpbglGBbYtldFWOGxOz1cskzFaQRJQLBMeuBl9voyIIB/rg4cFt+xzLE kmLgonDfx5cuWuC6xFxoF1B/rx7FzctL99/jwHCKxiukKicTFD30XtDJwoz1cIRokt XkqCKqEj+W+mQ== From: Vinod Koul To: Rob Clark Subject: [RFC PATCH 01/13] drm/dsc: Add dsc pps header init function Date: Fri, 21 May 2021 18:19:30 +0530 Message-Id: <20210521124946.3617862-2-vkoul@kernel.org> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210521124946.3617862-1-vkoul@kernel.org> References: <20210521124946.3617862-1-vkoul@kernel.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jonathan Marek , David Airlie , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Abhinav Kumar , Bjorn Andersson , Vinod Koul , dri-devel@lists.freedesktop.org, Dmitry Baryshkov , freedreno@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" We required a helper to create and set the dsc_dce_header, so add the dsc_dce_header and API drm_dsc_dsi_pps_header_init Signed-off-by: Vinod Koul --- drivers/gpu/drm/drm_dsc.c | 11 +++++++++++ include/drm/drm_dsc.h | 16 ++++++++++++++++ 2 files changed, 27 insertions(+) -- 2.26.3 diff --git a/drivers/gpu/drm/drm_dsc.c b/drivers/gpu/drm/drm_dsc.c index ff602f7ec65b..0c1b745090e2 100644 --- a/drivers/gpu/drm/drm_dsc.c +++ b/drivers/gpu/drm/drm_dsc.c @@ -49,6 +49,17 @@ void drm_dsc_dp_pps_header_init(struct dp_sdp_header *pps_header) } EXPORT_SYMBOL(drm_dsc_dp_pps_header_init); +void drm_dsc_dsi_pps_header_init(struct dsc_dce_header *dsc_header) +{ + memset(dsc_header, 0, sizeof(*dsc_header)); + + dsc_header->bp0 = 0x0A; + dsc_header->bp1 = 1; + dsc_header->bp4 = 10; + dsc_header->bp6 = 128; +} +EXPORT_SYMBOL(drm_dsc_dsi_pps_header_init); + /** * drm_dsc_dp_rc_buffer_size - get rc buffer size in bytes * @rc_buffer_block_size: block size code, according to DPCD offset 62h diff --git a/include/drm/drm_dsc.h b/include/drm/drm_dsc.h index bbe120f461e5..5a3bbeb3e12f 100644 --- a/include/drm/drm_dsc.h +++ b/include/drm/drm_dsc.h @@ -602,8 +602,24 @@ struct drm_dsc_pps_infoframe { struct drm_dsc_picture_parameter_set pps_payload; } __packed; +struct dsc_dce_header { + u8 bp0; + u8 bp1; + u8 bp2; + u8 bp3; + u8 bp4; + u8 bp5; + u8 bp6; +} __packed; + +struct drm_dsi_dsc_infoframe { + struct dsc_dce_header dsc_header; + struct drm_dsc_picture_parameter_set pps_payload; +} __packed; + void drm_dsc_dp_pps_header_init(struct dp_sdp_header *pps_header); int drm_dsc_dp_rc_buffer_size(u8 rc_buffer_block_size, u8 rc_buffer_size); +void drm_dsc_dsi_pps_header_init(struct dsc_dce_header *dsc_header); void drm_dsc_pps_payload_pack(struct drm_dsc_picture_parameter_set *pps_sdp, const struct drm_dsc_config *dsc_cfg); int drm_dsc_compute_rc_parameters(struct drm_dsc_config *vdsc_cfg);