Received: by 2002:ab2:7a55:0:b0:1f4:4a7d:290d with SMTP id u21csp677144lqp; Fri, 5 Apr 2024 05:57:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWyqgCFQ92o+AU8xBMRsHJLiBPg7Wve+4x6GB0Xs72Zg7rX1F14wNlXP62ZWRRAYYSTSWfo/jwTeTCzChbl3GoQUx4UUt/YXFvWskkzIQ== X-Google-Smtp-Source: AGHT+IGzNQlwSdX4xw6T4+5HZLNasJkwACRlCfIEH3+31alJTjETuxm/iSCdItmlmndpj5KkR7CK X-Received: by 2002:a17:906:594e:b0:a46:c8e3:c9b9 with SMTP id g14-20020a170906594e00b00a46c8e3c9b9mr898027ejr.42.1712321822637; Fri, 05 Apr 2024 05:57:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712321822; cv=pass; d=google.com; s=arc-20160816; b=FqHXcM5rK/sUlTxkk28WfFwbbt85cpI0RpqEEKUjnrm4Ad77k1eAlyA2cUGJsvgwii xHuonuVXRMRleLq7r1R8RUuesMWyN9+H7eDDeq6u+VgBdxV1INJaWe9E/e4z6znxqAHr nhQL6DwccqWnsyE2gVHIZvdUqf9WdjLHjuWWJoh5oV4hawUvDRSNdIiBDQJPBEdN9mtZ ldhVjaa8wj2VblMU2EtFGtGEx/dGQ5Zojn50jmrb9Fwnpvm5Lpi5RvXoXIRmBtgpMQLn hImywHYW0hHjMKKanbEcUG0X2HgtwfmBdHk3iyrk1O0JPv9qtQFI8svjz7xvhEFN48KE XDWw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :from:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=7v3dsaYn0Ty+yMQ2bse1rxLusmxLyXTcHGor1R5309M=; fh=cue+2yBY2zemkCbDwlaSl0+O4SBBEdInRuLaOwa6Jdg=; b=mc/pCzpkTI/3jIaNomYkevzUgHGGLF7XIRsvzOw7kK1o9farRjhMJwCfXa05YVBC56 v9fn5O6I5XG4xNP/puW/GZa1Mr+otuttS3mJJVL8yfRRnFaNH6MyXtKq7+zHff5wpQcd My7B1LiMtIZc9vzE3jdOmTEEoPTAm0MhvbXD7vyhGo5aIhlXdti+ifHdFFzKdseAe+Ox OL+tFQsgNGiaadh7MiZG0LtOKJQfscz1JixfqNWZzwl7ZNkVhBRXJYSLg/vmqVtC81Ev ClW87D7fwflGz7FVNi7fQUdFvN4gpAVJVidO2O6vaHAUdykK37qFC3xhCSOLogcG85Qk zAcw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=nahZn9pQ; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-133027-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133027-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id b25-20020a1709062b5900b00a5191ecb737si684710ejg.1009.2024.04.05.05.57.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 05:57:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-133027-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=nahZn9pQ; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-133027-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133027-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 373AA1F23D4E for ; Fri, 5 Apr 2024 12:57:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1086916D4CB; Fri, 5 Apr 2024 12:56:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="nahZn9pQ" Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1035716ABFA; Fri, 5 Apr 2024 12:56:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712321804; cv=none; b=JanqzgDWPCYEfWykdmiXq8k5iD2mXgfl/cuIoEDimVwPoL0B0LNIks7FQaz5BiNo97N4Cr6wFTrRsUQ6Q+iKtYK2+BsrGO0dDHM//aGmAHAY80L1NWGjBr5DxWspVJ97QBRRZEpKzCd30CxSN9O46EBrQFoZbgRtMlep/F3BNjU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712321804; c=relaxed/simple; bh=E94Vm2YqIHWCP3Ytx38QK62FpLjk4a891f9RaR8YcQY=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=jkY0MbfuTxD9RUSB9Gv9zOIBItM40bPtafkHqLdSWxNNZvlpoQt/6x6cBFxTzAmuSX+CSnDxs/xYO6gDDSRKnpyQ9jN/aFZ+zIu8fOhX2bWRn6mEffsFRsEtXr8FzkZN/UOhz5WOOZRScdTSlBGC6oDc42OV5psRU1eMKMYsddY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=nahZn9pQ; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Received: from [192.168.88.20] (91-154-34-181.elisa-laajakaista.fi [91.154.34.181]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id E35C98E1; Fri, 5 Apr 2024 14:56:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1712321762; bh=E94Vm2YqIHWCP3Ytx38QK62FpLjk4a891f9RaR8YcQY=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=nahZn9pQcSG2rMxbKmzi8excYLWCq9MQ0YVNbGg2kiuPENPJ2ASvkfvcQTVlCzeH5 ZIpCY/U9uDZ53+opAPQ+2RVznnNzqhfULY6huwoJxL+RyZeLeJj6BAqNpXkdokebDW LMWubw4NfMuRmE9JLufVDcQ0CYFBzA2vxhkTbzFM= Message-ID: <47947c68-8f1d-46a2-acb4-4ac008e5cb74@ideasonboard.com> Date: Fri, 5 Apr 2024 15:56:36 +0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 6/9] drm: xlnx: zynqmp_dpsub: Set input live format To: Anatoliy Klymenko Cc: dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-media@vger.kernel.org, Laurent Pinchart , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Michal Simek , Andrzej Hajda , Neil Armstrong , Robert Foss , Jonas Karlman , Jernej Skrabec , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Mauro Carvalho Chehab References: <20240321-dp-live-fmt-v3-0-d5090d796b7e@amd.com> <20240321-dp-live-fmt-v3-6-d5090d796b7e@amd.com> From: Tomi Valkeinen Content-Language: en-US Autocrypt: addr=tomi.valkeinen@ideasonboard.com; keydata= xsFNBE6ms0cBEACyizowecZqXfMZtnBniOieTuFdErHAUyxVgtmr0f5ZfIi9Z4l+uUN4Zdw2 wCEZjx3o0Z34diXBaMRJ3rAk9yB90UJAnLtb8A97Oq64DskLF81GCYB2P1i0qrG7UjpASgCA Ru0lVvxsWyIwSfoYoLrazbT1wkWRs8YBkkXQFfL7Mn3ZMoGPcpfwYH9O7bV1NslbmyJzRCMO eYV258gjCcwYlrkyIratlHCek4GrwV8Z9NQcjD5iLzrONjfafrWPwj6yn2RlL0mQEwt1lOvn LnI7QRtB3zxA3yB+FLsT1hx0va6xCHpX3QO2gBsyHCyVafFMrg3c/7IIWkDLngJxFgz6DLiA G4ld1QK/jsYqfP2GIMH1mFdjY+iagG4DqOsjip479HCWAptpNxSOCL6z3qxCU8MCz8iNOtZk DYXQWVscM5qgYSn+fmMM2qN+eoWlnCGVURZZLDjg387S2E1jT/dNTOsM/IqQj+ZROUZuRcF7 0RTtuU5q1HnbRNwy+23xeoSGuwmLQ2UsUk7Q5CnrjYfiPo3wHze8avK95JBoSd+WIRmV3uoO rXCoYOIRlDhg9XJTrbnQ3Ot5zOa0Y9c4IpyAlut6mDtxtKXr4+8OzjSVFww7tIwadTK3wDQv Bus4jxHjS6dz1g2ypT65qnHen6mUUH63lhzewqO9peAHJ0SLrQARAQABzTBUb21pIFZhbGtl aW5lbiA8dG9taS52YWxrZWluZW5AaWRlYXNvbmJvYXJkL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pa4E7lsSdWhSlHYNdG/czhoUkSCN09C0rEK93wxACx3vtxPLjXu6RptBw 3dRq7n+mQChEB1am0BueV1JZaBboIL0AGlSJkm23kw== In-Reply-To: <20240321-dp-live-fmt-v3-6-d5090d796b7e@amd.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 21/03/2024 22:43, Anatoliy Klymenko wrote: > Program live video input format according to selected media bus format. > > In the bridge mode of operation, DPSUB is connected to FPGA CRTC which > almost certainly supports a single media bus format as its output. Expect > this to be delivered via the new bridge atomic state. Program DPSUB > registers accordingly. Update zynqmp_disp_layer_set_format() API to fit > both live and non-live layer types. > > Signed-off-by: Anatoliy Klymenko > --- > drivers/gpu/drm/xlnx/zynqmp_disp.c | 66 +++++++++++++++++++++++++------------- > drivers/gpu/drm/xlnx/zynqmp_disp.h | 2 +- > drivers/gpu/drm/xlnx/zynqmp_dp.c | 13 +++++--- > drivers/gpu/drm/xlnx/zynqmp_kms.c | 2 +- > 4 files changed, 55 insertions(+), 28 deletions(-) > > diff --git a/drivers/gpu/drm/xlnx/zynqmp_disp.c b/drivers/gpu/drm/xlnx/zynqmp_disp.c > index 0c2b3f4bffa6..a385d22d428e 100644 > --- a/drivers/gpu/drm/xlnx/zynqmp_disp.c > +++ b/drivers/gpu/drm/xlnx/zynqmp_disp.c > @@ -436,19 +436,28 @@ static void zynqmp_disp_avbuf_set_format(struct zynqmp_disp *disp, > const struct zynqmp_disp_format *fmt) > { > unsigned int i; > - u32 val; > + u32 val, reg; > > - val = zynqmp_disp_avbuf_read(disp, ZYNQMP_DISP_AV_BUF_FMT); > - val &= zynqmp_disp_layer_is_video(layer) > - ? ~ZYNQMP_DISP_AV_BUF_FMT_NL_VID_MASK > - : ~ZYNQMP_DISP_AV_BUF_FMT_NL_GFX_MASK; > - val |= fmt->buf_fmt; > - zynqmp_disp_avbuf_write(disp, ZYNQMP_DISP_AV_BUF_FMT, val); > + layer->disp_fmt = fmt; > + if (layer->mode == ZYNQMP_DPSUB_LAYER_NONLIVE) { > + reg = ZYNQMP_DISP_AV_BUF_FMT; > + val = zynqmp_disp_avbuf_read(disp, ZYNQMP_DISP_AV_BUF_FMT); > + val &= zynqmp_disp_layer_is_video(layer) > + ? ~ZYNQMP_DISP_AV_BUF_FMT_NL_VID_MASK > + : ~ZYNQMP_DISP_AV_BUF_FMT_NL_GFX_MASK; > + val |= fmt->buf_fmt; > + } else { > + reg = zynqmp_disp_layer_is_video(layer) > + ? ZYNQMP_DISP_AV_BUF_LIVE_VID_CONFIG > + : ZYNQMP_DISP_AV_BUF_LIVE_GFX_CONFIG; > + val = fmt->buf_fmt; > + } > + zynqmp_disp_avbuf_write(disp, reg, val); Just write the registers inside the above if-else blocks. > > for (i = 0; i < ZYNQMP_DISP_AV_BUF_NUM_SF; i++) { > - unsigned int reg = zynqmp_disp_layer_is_video(layer) > - ? ZYNQMP_DISP_AV_BUF_VID_COMP_SF(i) > - : ZYNQMP_DISP_AV_BUF_GFX_COMP_SF(i); > + reg = zynqmp_disp_layer_is_video(layer) > + ? ZYNQMP_DISP_AV_BUF_VID_COMP_SF(i) > + : ZYNQMP_DISP_AV_BUF_GFX_COMP_SF(i); > > zynqmp_disp_avbuf_write(disp, reg, fmt->sf[i]); > } > @@ -902,25 +911,33 @@ static void zynqmp_disp_audio_disable(struct zynqmp_disp *disp) > */ > > /** > - * zynqmp_disp_layer_find_format - Find format information for a DRM format > + * zynqmp_disp_layer_find_format - Find format information for a DRM or media > + * bus format > * @layer: The layer > - * @drm_fmt: DRM format to search > + * @drm_or_bus_format: DRM or media bus format > * > * Search display subsystem format information corresponding to the given DRM > - * format @drm_fmt for the @layer, and return a pointer to the format > - * descriptor. > + * or media bus format @drm_or_bus_format for the @layer, and return a pointer > + * to the format descriptor. Search key choice depends on @layer mode, for live > + * layers search is done by zynqmp_disp_format.bus_fmt, and for non-live layers > + * zynqmp_disp_format.drm_fmt is used. Here also I recommend creating separate funcs for the fourcc and mbus versions. They are different types, even if they happen to fit into u32. > * > * Return: A pointer to the format descriptor if found, NULL otherwise > */ > static const struct zynqmp_disp_format * > zynqmp_disp_layer_find_format(struct zynqmp_disp_layer *layer, > - u32 drm_fmt) > + u32 drm_or_bus_format) > { > unsigned int i; > + const struct zynqmp_disp_format *disp_format; > > for (i = 0; i < layer->info->num_formats; i++) { > - if (layer->info->formats[i].drm_fmt == drm_fmt) > - return &layer->info->formats[i]; > + disp_format = &layer->info->formats[i]; > + if ((layer->mode == ZYNQMP_DPSUB_LAYER_LIVE && > + disp_format->bus_fmt == drm_or_bus_format) || > + (layer->mode == ZYNQMP_DPSUB_LAYER_NONLIVE && > + disp_format->drm_fmt == drm_or_bus_format)) > + return disp_format; > } > > return NULL; > @@ -992,20 +1009,25 @@ void zynqmp_disp_layer_disable(struct zynqmp_disp_layer *layer) > /** > * zynqmp_disp_layer_set_format - Set the layer format > * @layer: The layer > - * @info: The format info > + * @drm_or_bus_format: DRM or media bus format > * > * Set the format for @layer to @info. The layer must be disabled. > */ > void zynqmp_disp_layer_set_format(struct zynqmp_disp_layer *layer, > - const struct drm_format_info *info) > + u32 drm_or_bus_format) And here, with a quick look, a separate function would be fine. Tomi > { > unsigned int i; > > - layer->disp_fmt = zynqmp_disp_layer_find_format(layer, info->format); > - layer->drm_fmt = info; > + layer->disp_fmt = zynqmp_disp_layer_find_format(layer, drm_or_bus_format); > + if (WARN_ON(!layer->disp_fmt)) > + return; > > zynqmp_disp_avbuf_set_format(layer->disp, layer, layer->disp_fmt); > > + layer->drm_fmt = drm_format_info(layer->disp_fmt->drm_fmt); > + if (!layer->drm_fmt) > + return; > + > if (layer->mode == ZYNQMP_DPSUB_LAYER_LIVE) > return; > > @@ -1013,7 +1035,7 @@ void zynqmp_disp_layer_set_format(struct zynqmp_disp_layer *layer, > * Set pconfig for each DMA channel to indicate they're part of a > * video group. > */ > - for (i = 0; i < info->num_planes; i++) { > + for (i = 0; i < layer->drm_fmt->num_planes; i++) { > struct zynqmp_disp_layer_dma *dma = &layer->dmas[i]; > struct xilinx_dpdma_peripheral_config pconfig = { > .video_group = true, > diff --git a/drivers/gpu/drm/xlnx/zynqmp_disp.h b/drivers/gpu/drm/xlnx/zynqmp_disp.h > index 88c285a12e23..9f9a5f50ffbc 100644 > --- a/drivers/gpu/drm/xlnx/zynqmp_disp.h > +++ b/drivers/gpu/drm/xlnx/zynqmp_disp.h > @@ -55,7 +55,7 @@ u32 *zynqmp_disp_layer_formats(struct zynqmp_disp_layer *layer, > void zynqmp_disp_layer_enable(struct zynqmp_disp_layer *layer); > void zynqmp_disp_layer_disable(struct zynqmp_disp_layer *layer); > void zynqmp_disp_layer_set_format(struct zynqmp_disp_layer *layer, > - const struct drm_format_info *info); > + u32 drm_or_bus_format); > int zynqmp_disp_layer_update(struct zynqmp_disp_layer *layer, > struct drm_plane_state *state); > > diff --git a/drivers/gpu/drm/xlnx/zynqmp_dp.c b/drivers/gpu/drm/xlnx/zynqmp_dp.c > index e3b9eb3d9273..200e63636006 100644 > --- a/drivers/gpu/drm/xlnx/zynqmp_dp.c > +++ b/drivers/gpu/drm/xlnx/zynqmp_dp.c > @@ -1299,15 +1299,20 @@ static void zynqmp_dp_disp_enable(struct zynqmp_dp *dp, > struct drm_bridge_state *old_bridge_state) > { > struct zynqmp_disp_layer *layer; > - const struct drm_format_info *info; > + struct drm_bridge_state *bridge_state; > + u32 bus_fmt; > > layer = zynqmp_dp_disp_connected_live_layer(dp); > if (!layer) > return; > > - /* TODO: Make the format configurable. */ > - info = drm_format_info(DRM_FORMAT_YUV422); > - zynqmp_disp_layer_set_format(layer, info); > + bridge_state = drm_atomic_get_new_bridge_state(old_bridge_state->base.state, > + old_bridge_state->bridge); > + if (WARN_ON(!bridge_state)) > + return; > + > + bus_fmt = bridge_state->input_bus_cfg.format; > + zynqmp_disp_layer_set_format(layer, bus_fmt); > zynqmp_disp_layer_enable(layer); > > if (layer == dp->dpsub->layers[ZYNQMP_DPSUB_LAYER_GFX]) > diff --git a/drivers/gpu/drm/xlnx/zynqmp_kms.c b/drivers/gpu/drm/xlnx/zynqmp_kms.c > index bf9fba01df0e..d96b3f3f2e3a 100644 > --- a/drivers/gpu/drm/xlnx/zynqmp_kms.c > +++ b/drivers/gpu/drm/xlnx/zynqmp_kms.c > @@ -111,7 +111,7 @@ static void zynqmp_dpsub_plane_atomic_update(struct drm_plane *plane, > if (old_state->fb) > zynqmp_disp_layer_disable(layer); > > - zynqmp_disp_layer_set_format(layer, new_state->fb->format); > + zynqmp_disp_layer_set_format(layer, new_state->fb->format->format); > } > > zynqmp_disp_layer_update(layer, new_state); >