Received: by 2002:ab2:7a55:0:b0:1f4:4a7d:290d with SMTP id u21csp668159lqp; Fri, 5 Apr 2024 05:39:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX3Q1BsvuKtN19WrnLy03eHteTiP0MR7TMg56p/FCb7wTr8Acayabc8dqOD1I/LRlkBlLXqeXDFMUBIbcOai3rXdlgJlRhwRHqC+dh9DA== X-Google-Smtp-Source: AGHT+IGPS25n5Wl4EII4CBy1uwImN4xcpNbrWKVLP6lDYrJw8u+Im5TtSGfvZ4z4hDxK5DiSEeeu X-Received: by 2002:a17:906:81cd:b0:a51:a662:eceb with SMTP id e13-20020a17090681cd00b00a51a662ecebmr863207ejx.10.1712320792057; Fri, 05 Apr 2024 05:39:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712320792; cv=pass; d=google.com; s=arc-20160816; b=V6ybdiylVOZlzybRUTteGkLrccucaK9Ru6klRu8YIyjU0+4i9BA2kfZurBN/8tGuO+ Q42mc6gS3GDR08Yf0DTsnf2S810ibZBoiu3KqgYu04Au9c/Zx+EJUUQLod2Uen3Z0PxS klZgBNP8B7LE3FpXEK+IgtXWrQGps8KtokHSehUtwaHQKJCWXXaPmqH2FQadctPgqgzc YhIWvAwVtv4cnkPv7N5wJc0WQGypqqKJqm9vtZhsBmNqiYA/YR47ifRgIYoeDnzs9uU6 OmGvMbLeKMqutOEtFZNviWAPp5/fffILqP5z+6WPhkPRM/DT9z1L8lUKPz72ZteAbZzE JSJA== 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=KOn2VefYYBn6Zfo6Pgq7JfKhcAZkEnOeZHkNgeRh3s0=; fh=cue+2yBY2zemkCbDwlaSl0+O4SBBEdInRuLaOwa6Jdg=; b=V9Q62/qvbXKeS/mLaxflOgyVRRTnRi3njlILgsCNnJ3IdI8t+ipkIXqdioBivH6DRL lYKIM9XtQOV9T3+NXxEv7qGmkPl2He7Bre4g072PIg0X2eXu4my4SF6QlmK0jJq/kuMP r2xoKKoSr15jDUR4WlHDZEhn8zvirMhWynlo6s3kZ6+Q8wEcJke4u6HWI99IgmlXQpGc /Y5qUXB3y/rlqo3wQUYRWgf04nHVk6L31qdN7rjw3FNb+I9ScUTRWo3GbtDR45C1bdJn kkvQDchwo7RVigjhC4ivbcoglPeQBNH1joB7PmsNE2oqZ9VvKkWNv8uo0Glponf6VhvT QMvA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=IbMukQYS; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-133005-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133005-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id hd16-20020a170907969000b00a4e3dc7d36esi711817ejc.77.2024.04.05.05.39.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 05:39:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-133005-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=IbMukQYS; arc=pass (i=1 spf=pass spfdomain=ideasonboard.com dkim=pass dkdomain=ideasonboard.com); spf=pass (google.com: domain of linux-kernel+bounces-133005-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-133005-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 A0C2C1F235D0 for ; Fri, 5 Apr 2024 12:39:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 131BF16D318; Fri, 5 Apr 2024 12:39:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="IbMukQYS" 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 BDC8B1DFE4; Fri, 5 Apr 2024 12:39:29 +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=1712320771; cv=none; b=VFAIOGIEsQ4kNunyqAfqkAxJ8oYwUWpoljKfu0HA6xoHZ9s7EeTCTGRXxBpGBqq/c9tI8fBFjafEdHCfIJNzA1N0B2zhMp4szke1MiE4lZriRqq3t/oDNZcIlwj6j85KP046rwZgwQJYagtS5lIiAAyUASejiaNN30Xox66xxWU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712320771; c=relaxed/simple; bh=yRpitgM+m1pVWlMGu1BVSdU1GFZ43sgEarLLyPEtBAg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=dB2cE2o+JRef6/wCGki4PuEEp5V+NZbxbCm0aiVaH48ut0t9Z0tQ7qqkZ/5LFjPYItMXQEg6pW35rYrQRlZ1rnHbxwohYGXWFayD1uxGWgApWEuSArRYePH8qmbm0xgbufviHcVL6jckk3Qdv4OmLmwETTCL03MQFA49QgElmkI= 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=IbMukQYS; 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 1DC1C8E1; Fri, 5 Apr 2024 14:38:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1712320729; bh=yRpitgM+m1pVWlMGu1BVSdU1GFZ43sgEarLLyPEtBAg=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=IbMukQYStkTPpZVpoHIoCX0N5RD6fMzVaHmrVODI5U53Eu6voMFfqy0YhmJCWb474 /DXIOS0a3A31amskVy2dTxywc2UaINNXSG3lbMRxecKL934k0y1KY7zXpDQX2UbSRE d0bxRlZwZUJyJFi4WY58wg5m2FEdwkD6BY+qSiLo= Message-ID: <0179c94f-88c1-4b54-8a61-2834f35325ec@ideasonboard.com> Date: Fri, 5 Apr 2024 15:39:22 +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 4/9] drm: xlnx: zynqmp_dpsub: Anounce supported input formats 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-4-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 aW5lbiA8dG9taS52YWxrZWluZW5AaWRlYXNvbmJvYXJkLmNvbT7CwY4EEwEIADgWIQTEOAw+ ll79gQef86f6PaqMvJYe9QUC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RptBw 3dRq7n+mQChEB1am0BueV1JZaBboIL0AGlSJkm23kw== In-Reply-To: <20240321-dp-live-fmt-v3-4-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: > DPSUB in bridge mode supports multiple input media bus formats. > > Announce the list of supported input media bus formats via > drm_bridge.atomic_get_input_bus_fmts callback. > Introduce a set of live input formats, supported by DPSUB. > Rename zynqmp_disp_layer_drm_formats() to zynqmp_disp_layer_formats() to > reflect semantics for both live and non-live layer format lists. > > Reviewed-by: Laurent Pinchart > Signed-off-by: Anatoliy Klymenko > --- > drivers/gpu/drm/xlnx/zynqmp_disp.c | 76 +++++++++++++++++++++++++++++++++----- > drivers/gpu/drm/xlnx/zynqmp_disp.h | 4 +- > drivers/gpu/drm/xlnx/zynqmp_dp.c | 31 ++++++++++++++++ > drivers/gpu/drm/xlnx/zynqmp_kms.c | 2 +- > 4 files changed, 101 insertions(+), 12 deletions(-) > > diff --git a/drivers/gpu/drm/xlnx/zynqmp_disp.c b/drivers/gpu/drm/xlnx/zynqmp_disp.c > index e6d26ef60e89..abdc3971b193 100644 > --- a/drivers/gpu/drm/xlnx/zynqmp_disp.c > +++ b/drivers/gpu/drm/xlnx/zynqmp_disp.c > @@ -18,6 +18,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -77,12 +78,14 @@ enum zynqmp_dpsub_layer_mode { > /** > * struct zynqmp_disp_format - Display subsystem format information > * @drm_fmt: DRM format (4CC) > + * @bus_fmt: Media bus format > * @buf_fmt: AV buffer format > * @swap: Flag to swap R & B for RGB formats, and U & V for YUV formats > * @sf: Scaling factors for color components > */ > struct zynqmp_disp_format { > u32 drm_fmt; > + u32 bus_fmt; > u32 buf_fmt; > bool swap; > const u32 *sf; > @@ -182,6 +185,12 @@ static const u32 scaling_factors_565[] = { > ZYNQMP_DISP_AV_BUF_5BIT_SF, > }; > > +static const u32 scaling_factors_666[] = { > + ZYNQMP_DISP_AV_BUF_6BIT_SF, > + ZYNQMP_DISP_AV_BUF_6BIT_SF, > + ZYNQMP_DISP_AV_BUF_6BIT_SF, > +}; > + > static const u32 scaling_factors_888[] = { > ZYNQMP_DISP_AV_BUF_8BIT_SF, > ZYNQMP_DISP_AV_BUF_8BIT_SF, > @@ -364,6 +373,41 @@ static const struct zynqmp_disp_format avbuf_gfx_fmts[] = { > }, > }; > > +/* List of live video layer formats */ > +static const struct zynqmp_disp_format avbuf_live_fmts[] = { > + { > + .drm_fmt = DRM_FORMAT_RGB565, > + .bus_fmt = MEDIA_BUS_FMT_RGB666_1X18, > + .buf_fmt = ZYNQMP_DISP_AV_BUF_LIVE_CONFIG_BPC_6 | > + ZYNQMP_DISP_AV_BUF_LIVE_CONFIG_FMT_RGB, > + .sf = scaling_factors_666, > + }, { > + .drm_fmt = DRM_FORMAT_RGB888, > + .bus_fmt = MEDIA_BUS_FMT_RGB888_1X24, > + .buf_fmt = ZYNQMP_DISP_AV_BUF_LIVE_CONFIG_BPC_8 | > + ZYNQMP_DISP_AV_BUF_LIVE_CONFIG_FMT_RGB, > + .sf = scaling_factors_888, > + }, { > + .drm_fmt = DRM_FORMAT_YUV422, > + .bus_fmt = MEDIA_BUS_FMT_UYVY8_1X16, > + .buf_fmt = ZYNQMP_DISP_AV_BUF_LIVE_CONFIG_BPC_8 | > + ZYNQMP_DISP_AV_BUF_LIVE_CONFIG_FMT_YUV422, > + .sf = scaling_factors_888, > + }, { > + .drm_fmt = DRM_FORMAT_YUV444, > + .bus_fmt = MEDIA_BUS_FMT_VUY8_1X24, > + .buf_fmt = ZYNQMP_DISP_AV_BUF_LIVE_CONFIG_BPC_8 | > + ZYNQMP_DISP_AV_BUF_LIVE_CONFIG_FMT_YUV444, > + .sf = scaling_factors_888, > + }, { > + .drm_fmt = DRM_FORMAT_P210, > + .bus_fmt = MEDIA_BUS_FMT_UYVY10_1X20, > + .buf_fmt = ZYNQMP_DISP_AV_BUF_LIVE_CONFIG_BPC_10 | > + ZYNQMP_DISP_AV_BUF_LIVE_CONFIG_FMT_YUV422, > + .sf = scaling_factors_101010, > + }, > +}; > + > static u32 zynqmp_disp_avbuf_read(struct zynqmp_disp *disp, int reg) > { > return readl(disp->avbuf.base + reg); > @@ -883,16 +927,17 @@ zynqmp_disp_layer_find_format(struct zynqmp_disp_layer *layer, > } > > /** > - * zynqmp_disp_layer_drm_formats - Return the DRM formats supported by the layer > + * zynqmp_disp_layer_formats - Return DRM or media bus formats supported by > + * the layer > * @layer: The layer > * @num_formats: Pointer to the returned number of formats > * > - * Return: A newly allocated u32 array that stores all the DRM formats > + * Return: A newly allocated u32 array that stores all DRM or media bus formats > * supported by the layer. The number of formats in the array is returned > * through the num_formats argument. > */ > -u32 *zynqmp_disp_layer_drm_formats(struct zynqmp_disp_layer *layer, > - unsigned int *num_formats) > +u32 *zynqmp_disp_layer_formats(struct zynqmp_disp_layer *layer, > + unsigned int *num_formats) > { > unsigned int i; > u32 *formats; > @@ -903,7 +948,9 @@ u32 *zynqmp_disp_layer_drm_formats(struct zynqmp_disp_layer *layer, > return NULL; > > for (i = 0; i < layer->info->num_formats; ++i) > - formats[i] = layer->info->formats[i].drm_fmt; > + formats[i] = layer->mode == ZYNQMP_DPSUB_LAYER_NONLIVE > + ? layer->info->formats[i].drm_fmt > + : layer->info->formats[i].bus_fmt; I find this quite confusing. Depending on the layer mode, you return different format types. I think it's quite easy to use this kind of function the wrong way. Why not just make two separate functions? Tomi > *num_formats = layer->info->num_formats; > return formats; > @@ -1131,6 +1178,11 @@ static int zynqmp_disp_create_layers(struct zynqmp_disp *disp) > .num_channels = 1, > }, > }; > + static const struct zynqmp_disp_layer_info live_layer_info = { > + .formats = avbuf_live_fmts, > + .num_formats = ARRAY_SIZE(avbuf_live_fmts), > + .num_channels = 0, > + }; > > unsigned int i; > int ret; > @@ -1140,12 +1192,18 @@ static int zynqmp_disp_create_layers(struct zynqmp_disp *disp) > > layer->id = i; > layer->disp = disp; > - layer->info = &layer_info[i]; > - /* For now assume dpsub works in either live or non-live mode for both layers. > + > + /* > + * For now assume dpsub works in either live or non-live mode for both layers. > * Hybrid mode is not supported yet. > */ > - layer->mode = disp->dpsub->dma_enabled ? ZYNQMP_DPSUB_LAYER_NONLIVE > - : ZYNQMP_DPSUB_LAYER_LIVE; > + if (disp->dpsub->dma_enabled) { > + layer->mode = ZYNQMP_DPSUB_LAYER_NONLIVE; > + layer->info = &layer_info[i]; > + } else { > + layer->mode = ZYNQMP_DPSUB_LAYER_LIVE; > + layer->info = &live_layer_info; > + } > > ret = zynqmp_disp_layer_request_dma(disp, layer); > if (ret) > diff --git a/drivers/gpu/drm/xlnx/zynqmp_disp.h b/drivers/gpu/drm/xlnx/zynqmp_disp.h > index 9b8b202224d9..88c285a12e23 100644 > --- a/drivers/gpu/drm/xlnx/zynqmp_disp.h > +++ b/drivers/gpu/drm/xlnx/zynqmp_disp.h > @@ -50,8 +50,8 @@ int zynqmp_disp_setup_clock(struct zynqmp_disp *disp, > void zynqmp_disp_blend_set_global_alpha(struct zynqmp_disp *disp, > bool enable, u32 alpha); > > -u32 *zynqmp_disp_layer_drm_formats(struct zynqmp_disp_layer *layer, > - unsigned int *num_formats); > +u32 *zynqmp_disp_layer_formats(struct zynqmp_disp_layer *layer, > + unsigned int *num_formats); > 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, > diff --git a/drivers/gpu/drm/xlnx/zynqmp_dp.c b/drivers/gpu/drm/xlnx/zynqmp_dp.c > index 4faafdd76798..e3b9eb3d9273 100644 > --- a/drivers/gpu/drm/xlnx/zynqmp_dp.c > +++ b/drivers/gpu/drm/xlnx/zynqmp_dp.c > @@ -22,6 +22,7 @@ > #include > #include > #include > +#include > #include > #include > #include > @@ -1577,6 +1578,35 @@ static const struct drm_edid *zynqmp_dp_bridge_edid_read(struct drm_bridge *brid > return drm_edid_read_ddc(connector, &dp->aux.ddc); > } > > +static u32 *zynqmp_dp_bridge_default_bus_fmts(unsigned int *num_input_fmts) > +{ > + u32 *formats = kzalloc(sizeof(*formats), GFP_KERNEL); > + > + if (formats) > + *formats = MEDIA_BUS_FMT_FIXED; > + *num_input_fmts = !!formats; > + > + return formats; > +} > + > +static u32 * > +zynqmp_dp_bridge_get_input_bus_fmts(struct drm_bridge *bridge, > + struct drm_bridge_state *bridge_state, > + struct drm_crtc_state *crtc_state, > + struct drm_connector_state *conn_state, > + u32 output_fmt, > + unsigned int *num_input_fmts) > +{ > + struct zynqmp_dp *dp = bridge_to_dp(bridge); > + struct zynqmp_disp_layer *layer; > + > + layer = zynqmp_dp_disp_connected_live_layer(dp); > + if (layer) > + return zynqmp_disp_layer_formats(layer, num_input_fmts); > + else > + return zynqmp_dp_bridge_default_bus_fmts(num_input_fmts); > +} > + > static const struct drm_bridge_funcs zynqmp_dp_bridge_funcs = { > .attach = zynqmp_dp_bridge_attach, > .detach = zynqmp_dp_bridge_detach, > @@ -1589,6 +1619,7 @@ static const struct drm_bridge_funcs zynqmp_dp_bridge_funcs = { > .atomic_check = zynqmp_dp_bridge_atomic_check, > .detect = zynqmp_dp_bridge_detect, > .edid_read = zynqmp_dp_bridge_edid_read, > + .atomic_get_input_bus_fmts = zynqmp_dp_bridge_get_input_bus_fmts, > }; > > /* ----------------------------------------------------------------------------- > diff --git a/drivers/gpu/drm/xlnx/zynqmp_kms.c b/drivers/gpu/drm/xlnx/zynqmp_kms.c > index 43bf416b33d5..bf9fba01df0e 100644 > --- a/drivers/gpu/drm/xlnx/zynqmp_kms.c > +++ b/drivers/gpu/drm/xlnx/zynqmp_kms.c > @@ -152,7 +152,7 @@ static int zynqmp_dpsub_create_planes(struct zynqmp_dpsub *dpsub) > unsigned int num_formats; > u32 *formats; > > - formats = zynqmp_disp_layer_drm_formats(layer, &num_formats); > + formats = zynqmp_disp_layer_formats(layer, &num_formats); > if (!formats) > return -ENOMEM; > >