Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp519167lqb; Wed, 17 Apr 2024 03:30:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWKIl2xBKOuznInHVMDFvcvzGrLFW2JKHQUnCq4RcTZxgRh43n3sRregjgNuFl5PENRIIZ6vvA1e5WFgOvmY2fMsT7ybshWooY9zk7KhA== X-Google-Smtp-Source: AGHT+IE/LDVZfVaua6+Q8Dhh7y45zVCiakiTBi4Xmtlt9X1kOufz3wPovonWlMgBQOvpfDnhc6ny X-Received: by 2002:a92:c24c:0:b0:36a:25c6:f35d with SMTP id k12-20020a92c24c000000b0036a25c6f35dmr19420619ilo.12.1713349830367; Wed, 17 Apr 2024 03:30:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713349830; cv=pass; d=google.com; s=arc-20160816; b=LJaes25p4vnvHTmphoetYfg1fJAM4JPUY52J/S/fUjS+vZ5LE0NmosjoVXI+WzYcU3 6Bmo7siG/zprxaIoBmLldHbujUKdU5BpbqjkiU9PwHptgsDn1CXNyf4Fp5Chx3LsrTLR TzRbeLvXTFwgKeAr/QONo5bCANoXgZB3xu+V2sGJkMjp9BELcdtzxi0+5ulEdPgBuRV/ 0kWiGrcnFvZEJG2sPA2/2ERPwWi8sfZDWjPd50aUWazPiBMFX1V2G8UBvQX0eZBticPm RSwrehJUnCpWqyRwG3RH2GDxe2EgV3Ae/A108ONXN+iF3oSrCKqKg/5s6dblfLS4wii9 2cLw== 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=w2VXufhvYRbQKrsNFpVv8k/81SGmq2t5x9xNAyfMzUU=; fh=cue+2yBY2zemkCbDwlaSl0+O4SBBEdInRuLaOwa6Jdg=; b=glhAAOVKvCHcmziDDZ6p0xuRJcaFydMYBkYDi02/9RljfQgjBEdWihUANYVm4P0u0p a6fNPDcW7X5AD6g4hbMhKzf5GkMUv8JlS0SmAyZPpD3XJtCWuvPNy+ucZmMh04QTnw6G +C1Q7Nss2fGuc2UxAmsytwQcJwnwwfnhJQC9UKSA2SR6tuwY8xgZLbW2Qbgn+EM8n5ZI 0mbIX0Dl+HDWt5xfWUI9e9j9XoUE3u/JIJc0rJzePUc0gfGYcRIHW0TQFr4l38GrM3de oW0/2IIaBT739PndwoXVMmf+xmINMSYOmQdB+BTrD5MzTZn7lyo5MJETRsEV5fgfIFmW 7R9w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=A6OzMDZU; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-148323-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-148323-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id e8-20020a635008000000b005f41561dc71si11407892pgb.625.2024.04.17.03.30.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Apr 2024 03:30:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-148323-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=A6OzMDZU; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-148323-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-148323-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 01561281F47 for ; Wed, 17 Apr 2024 10:30:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C9F1B58209; Wed, 17 Apr 2024 10:30:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="A6OzMDZU" 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 C39ED11181; Wed, 17 Apr 2024 10:30:20 +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=1713349822; cv=none; b=OqP6s60XYj6X17LMqdMsD2o3bMtO9iwgMqO9Y+oC+xZcBY5iwYqVRH/8vD1dzzzBoI5ohVUVD0liS3v2clTVrfb7RcEMAgCxchAoqFFrgPgBxWSthuZAq4IWln4HNRdUVn9v4K7v0+Tgucx2Ehe3j7U0PgESLr5xYZMFlbpA/pk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713349822; c=relaxed/simple; bh=+gBG99f0GmjeWR4WBbEAkDNYZuCzgUsWIIYF0c+Dnhw=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=pUCC/O5072qVsQlzYYcGWq8Yrg/No3jS8cdtOyMGx0slLTj+K9hptlkpqt+RLdaRoiX24xOYLdOoaZY0bzLeV5V1dgNjnlXbcsCTWysg/Ufqi1iEFZerlUdZ7SAdBR1CgUMCf+WmkGqy8eN08hq9f2PYRwiT6s02n8PN4++d2Aw= 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=A6OzMDZU; 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 9002516F9; Wed, 17 Apr 2024 12:29:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1713349771; bh=+gBG99f0GmjeWR4WBbEAkDNYZuCzgUsWIIYF0c+Dnhw=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=A6OzMDZU51R6f6/0Ix/dluKPIax+YWhsP89GqNlQt0I6FFR14+FgiUIEIbV5QHuH2 mhHMsSmBAFzxHu0Bzzyb9hUGoK7zG5q01wRj63ky5o5KCd8TbrsU1j6S+p4ZtcMkf5 b6dzWsnGZ9PRXlAaR4iqG0J4ZwNacJh27aNG4sz4= Message-ID: Date: Wed, 17 Apr 2024 13:30:14 +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 v4 6/7] 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: <20240416-dp-live-fmt-v4-0-c7f379b7168e@amd.com> <20240416-dp-live-fmt-v4-6-c7f379b7168e@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 aW5lbiA8dG9taS52YWxrZWluZW5AaWRlYXNvbmJvYXJkLmNvbT7CwY4EEwEIADgWIQTEOAw+ ll79gQef86f6PaqMvJYe9QUCX/HruAIbAwULC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+mQChEB1am0BueV1JZaBboIL0AGlSJkm23kw== In-Reply-To: <20240416-dp-live-fmt-v4-6-c7f379b7168e@amd.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 16/04/2024 23:31, 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. > > Signed-off-by: Anatoliy Klymenko > --- > drivers/gpu/drm/xlnx/zynqmp_disp.c | 92 ++++++++++++++++++++++++++++++++------ > drivers/gpu/drm/xlnx/zynqmp_disp.h | 2 + > drivers/gpu/drm/xlnx/zynqmp_dp.c | 13 ++++-- > 3 files changed, 90 insertions(+), 17 deletions(-) > Reviewed-by: Tomi Valkeinen Tomi > diff --git a/drivers/gpu/drm/xlnx/zynqmp_disp.c b/drivers/gpu/drm/xlnx/zynqmp_disp.c > index 8cdd74a9b772..13157da0089e 100644 > --- a/drivers/gpu/drm/xlnx/zynqmp_disp.c > +++ b/drivers/gpu/drm/xlnx/zynqmp_disp.c > @@ -436,19 +436,29 @@ 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; > + zynqmp_disp_avbuf_write(disp, reg, val); > + } 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); > + } > > 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]); > } > @@ -926,6 +936,31 @@ zynqmp_disp_layer_find_format(struct zynqmp_disp_layer *layer, > return NULL; > } > > +/** > + * zynqmp_disp_layer_find_live_format - Find format information for given > + * media bus format > + * @layer: The layer > + * @drm_fmt: Media bus format to search > + * > + * Search display subsystem format information corresponding to the given media > + * bus format @media_bus_format for the @layer, and return a pointer to the > + * format descriptor. > + * > + * Return: A pointer to the format descriptor if found, NULL otherwise > + */ > +static const struct zynqmp_disp_format * > +zynqmp_disp_layer_find_live_format(struct zynqmp_disp_layer *layer, > + u32 media_bus_format) > +{ > + unsigned int i; > + > + for (i = 0; i < layer->info->num_formats; i++) > + if (layer->info->formats[i].bus_fmt == media_bus_format) > + return &layer->info->formats[i]; > + > + return NULL; > +} > + > /** > * zynqmp_disp_layer_drm_formats - Return the DRM formats supported by the layer > * @layer: The layer > @@ -1040,6 +1075,9 @@ void zynqmp_disp_layer_disable(struct zynqmp_disp_layer *layer) > * @layer: The layer > * @info: The format info > * > + * NOTE: Use zynqmp_disp_layer_set_live_format() to set media bus format for > + * live video layers. > + * > * Set the format for @layer to @info. The layer must be disabled. > */ > void zynqmp_disp_layer_set_format(struct zynqmp_disp_layer *layer, > @@ -1047,14 +1085,16 @@ void zynqmp_disp_layer_set_format(struct zynqmp_disp_layer *layer, > { > unsigned int i; > > + if (WARN_ON(layer->mode != ZYNQMP_DPSUB_LAYER_NONLIVE)) > + return; > + > layer->disp_fmt = zynqmp_disp_layer_find_format(layer, info->format); > + if (WARN_ON(!layer->disp_fmt)) > + return; > layer->drm_fmt = info; > > zynqmp_disp_avbuf_set_format(layer->disp, layer, layer->disp_fmt); > > - if (layer->mode == ZYNQMP_DPSUB_LAYER_LIVE) > - return; > - > /* > * Set pconfig for each DMA channel to indicate they're part of a > * video group. > @@ -1074,6 +1114,32 @@ void zynqmp_disp_layer_set_format(struct zynqmp_disp_layer *layer, > } > } > > +/** > + * zynqmp_disp_layer_set_live_format - Set the live video layer format > + * @layer: The layer > + * @info: The format info > + * > + * NOTE: This function should not be used to set format for non-live video > + * layer. Use zynqmp_disp_layer_set_format() instead. > + * > + * Set the display format for the live @layer. The layer must be disabled. > + */ > +void zynqmp_disp_layer_set_live_format(struct zynqmp_disp_layer *layer, > + u32 media_bus_format) > +{ > + if (WARN_ON(layer->mode != ZYNQMP_DPSUB_LAYER_LIVE)) > + return; > + > + layer->disp_fmt = zynqmp_disp_layer_find_live_format(layer, > + media_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); > +} > + > /** > * zynqmp_disp_layer_update - Update the layer framebuffer > * @layer: The layer > diff --git a/drivers/gpu/drm/xlnx/zynqmp_disp.h b/drivers/gpu/drm/xlnx/zynqmp_disp.h > index efd1c52c2916..fa545533c9d1 100644 > --- a/drivers/gpu/drm/xlnx/zynqmp_disp.h > +++ b/drivers/gpu/drm/xlnx/zynqmp_disp.h > @@ -58,6 +58,8 @@ 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); > +void zynqmp_disp_layer_set_live_format(struct zynqmp_disp_layer *layer, > + u32 media_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 faaeea526970..a7fa5e2abb9b 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_live_format(layer, bus_fmt); > zynqmp_disp_layer_enable(layer); > > if (layer == dp->dpsub->layers[ZYNQMP_DPSUB_LAYER_GFX]) >