Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp684034lqh; Fri, 31 May 2024 13:07:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUZ9OLfE3ASj0tfaIyok8hbby6jHW/jpjnuN4qTb/QluUCExXJRPLrHXPnhjpL/fjzsJjuBZ03Jm1PcrOWgpxPyLM3cDfLLytYpiu9Wvg== X-Google-Smtp-Source: AGHT+IFW+WSN3yoIFkXbi4CFhyDH69AOijmB20HP1qG8cjmqLqGbp/zfLj+zJfXmBx3VdPeKkN54 X-Received: by 2002:a2e:86c4:0:b0:2df:8bef:d900 with SMTP id 38308e7fff4ca-2ea9512b126mr20830821fa.16.1717186066599; Fri, 31 May 2024 13:07:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717186066; cv=pass; d=google.com; s=arc-20160816; b=HFPNWZlbzjj3SXJqFEfy5xAvzz760kJzdJQIOqf+ElDdHxAmxc7p36PLF9XHNpWufv PXp/Ka95qbDr48C1hk1ZlkgEdL44qu7bw4/RueVoqS70KGGOL/EWxfn/FzdyrvF25KIY ZUSrDQOMcZKba0XQuULa6s8FBgKWg2l0d/oomO1S+oOpMtIKD+jSZwR4ICZt7L9zMgNb EvNHWmYvaISXh3mfmNgKSMDpzVKoAOWfMxyEHPK5xbXXPyS3W+MuiXZMenzbC7ztcwSp uz6feNJE42/OzmT6rmRLWSVvCGPImhB0R4x7gbvPt1s+sY2EDCxRkGBoCMbmrFN1Bmhq 0kQw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=xsWyvZJ7smsYEwcJt3QXuB4RboSifhUzN4Y/+3fVgYs=; fh=ZP2MJiaHss/+zcntd97cbt53kl9m+wKncnBYhnWa3bY=; b=T/B5ZzNIactuLmpKuRTOkk0clAwCj9+bnqsDgQgYxdVkfH/CvkG55Ao6LQAu7P2Kux cwdCvhhNO2E7RgSC0CbuZ+YMMpkBWMJZw7t4727oBz1yjNAlWqupwcSY1W7kL5/shgO0 GnWY9dm4C7ZknrFxvorD14sdMgxG7U0Rb83tHWzyPlJrgUVFisaBHw6Somu9JkW6ODEq YRMT1yhTvM017h/Jlt8WUysVv6SapYB9N7mmta6cJ31Qz48RVCt2eOBBRDGYIIviX85Q hzLD9XJZOus+n7kksRAh0HwGdAuixCg25N9vuEGxrDG9LirQM7dmJFdxoCxpT1QzXSIU sIVA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hJg4jqYM; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-197419-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197419-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57a31c62e2esi1307451a12.234.2024.05.31.13.07.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 13:07:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-197419-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 header.i=@linaro.org header.s=google header.b=hJg4jqYM; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-197419-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-197419-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.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 507DE1F2B076 for ; Fri, 31 May 2024 20:07:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1AEEA17E458; Fri, 31 May 2024 20:07:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="hJg4jqYM" Received: from mail-lj1-f172.google.com (mail-lj1-f172.google.com [209.85.208.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9717E17D371 for ; Fri, 31 May 2024 20:07:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717186054; cv=none; b=WbRMrBwvNoN/hcpOP4ye2+r1knIET6RMX2vuJdyWeBlaCruAwxCK9wX1zOkNvEALq0xBN8y4/cBzGtUaxlkgca2+9wgYDz0VWpl91O8RpsphvdAIiU52GqPYcKmKRwUrWWLbyK+g6nMQDNuNfc4MZq3GrwhKCt0Ajw1Gv2PXJcE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717186054; c=relaxed/simple; bh=AXQkgT8bLCi+J4VLmDhYURPEkLAsLkNbwsYyTx65pa0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=qNg5SRAU75yP8QfbVNyK+i53d+A+gzgEhm0uI+70Eq/DIEMwzOjHVyYeXdPa68U7rrtWZhNGuqXHhl8VQueD1qw+Dvt4iM6ZOCZitwxecWog7fHpkUa0V7QlEVmY7NWUbVVot7WP3dTFRdpU6ZMRnARjWdIiNCSkVl8DNFdUQxw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=hJg4jqYM; arc=none smtp.client-ip=209.85.208.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-lj1-f172.google.com with SMTP id 38308e7fff4ca-2e95a7545bdso24671081fa.2 for ; Fri, 31 May 2024 13:07:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717186051; x=1717790851; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=xsWyvZJ7smsYEwcJt3QXuB4RboSifhUzN4Y/+3fVgYs=; b=hJg4jqYMRB6/OPS0xylEDzORAYAiZe/o9aK4L2Oei4zja0XlbQtcDYCmic0ha+X4Wz c5AxPPoeAHlS98yU253OKF9uCWFCdu1FaWPK9EajjnsBENTVpiyIwsrh1zvAsNhIGaZt hefq/wk96DeCDV0RPs+dYSr1fu/+iw5g7k5f6wQUL6BWeIP9kKQ8OL1QDf1i7Rn+frvR /waFBOdpMNfXSMKvgypd02uOxdhe/JbTt6oYl9peKYA2Jhi2Rti4LW7tb0yf+AnPcuLB uhnK9CGtylUGGVKnSRr27p6DmnFnXx0995nvVztC0Anz3dCbECzHzpy8VES788sps/03 6isw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717186051; x=1717790851; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xsWyvZJ7smsYEwcJt3QXuB4RboSifhUzN4Y/+3fVgYs=; b=quODZw1xBgWg/dQmqzev97/MlujfTEYcMq8Ys6nvrQtbplenZl39H7mMCC/Jq8eLZj 1wAtS6Vg1KZS32mgZ2E10a706mttOWT4lZeshDDdt5StxMktIgy3jnqzZxdGoa7cnmrh Ap43wsuobaEJ/9J1hYbIJYWoS6MEvlkMEA2HzKlwb1hBt4X65z8mSq59+Kbo0r/bFI0H SrCoTnk0n14UvFZnVLWaCU3lGe6xMQ4yrIGRztmdcViDj8zdd9Dk09tpEibAKBHtmP7+ FOwisYJLGF4KIyD58WqojQ/Vsnzx+0vm71EuTuBF6T42Uny8N8Vid91e8Q0mRq0FaprF G82A== X-Forwarded-Encrypted: i=1; AJvYcCXfIw6dDyRMComispfEznq9pzx2TrQu/yvznxeCfoMdTA+m6x4vT4CuyAt0ayMISZABvCF7fFmzduo7YKn4YY9Em+KRJ8mY/897Ld/v X-Gm-Message-State: AOJu0YxJveyxtga7glfqSDcPxv3S2NIIkk0ZKz9EfW7yfCHrrNJOglR1 LAFZW7lnxGKCYe+WNHFYO3HgakWJxHPCZfV0sTY0xN7DDn2utLMS8eYDZPuA7g0= X-Received: by 2002:a05:651c:1a28:b0:2e1:cb22:a4d with SMTP id 38308e7fff4ca-2ea951e0c9cmr24442131fa.36.1717186050858; Fri, 31 May 2024 13:07:30 -0700 (PDT) Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-2ea91cf0b83sm4022111fa.116.2024.05.31.13.07.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 13:07:30 -0700 (PDT) From: Dmitry Baryshkov Date: Fri, 31 May 2024 23:07:24 +0300 Subject: [PATCH v4 1/9] drm/connector: hdmi: accept NULL for Audio Infoframe Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240531-bridge-hdmi-connector-v4-1-5110f7943622@linaro.org> References: <20240531-bridge-hdmi-connector-v4-0-5110f7943622@linaro.org> In-Reply-To: <20240531-bridge-hdmi-connector-v4-0-5110f7943622@linaro.org> To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Rob Clark , Abhinav Kumar , Sean Paul , Marijn Suijten Cc: dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org, Dmitry Baryshkov X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1693; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=AXQkgT8bLCi+J4VLmDhYURPEkLAsLkNbwsYyTx65pa0=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBmWi4A4mslqnmrqRRzX6aSZEDOT1WCm1EzeG9wr U/QUtoki1qJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZlouAAAKCRCLPIo+Aiko 1SUjB/0e2GTfiChGvovX7efLQ0j2ffZdGrlSDSwGrLLZc+B6/ZbDne/yndL1jZu8s9RmnWztqwB gyZSl06x0cl55ESAcn+6WVktsGPpk8dZKMqFe1OQT25lqL3uyPrIhuigQ64W/EX8+9+KLn2wn08 9hTe/0RG1CmTUWbzzYL0AiCvqkaU19lt1SvNH3x3XULdutaam97jjHCbJhbwpvIDL/TSCltQ4tY mPl51o4WSuBlaVIcumVOiCYt/lpmn1dywPMY31gJl6e+eTGqZFOa9TfDdA86+YHdhQo+CuadVd2 JaOYarn+U4myQ9cBkESIesfM8s8SMqUBofMb2JCj2rwpgoou X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A Allow passing NULL as audio infoframe as a way to disable Audio Infoframe generation. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/display/drm_hdmi_state_helper.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/display/drm_hdmi_state_helper.c b/drivers/gpu/drm/display/drm_hdmi_state_helper.c index ce96837eea65..5356723d21f5 100644 --- a/drivers/gpu/drm/display/drm_hdmi_state_helper.c +++ b/drivers/gpu/drm/display/drm_hdmi_state_helper.c @@ -681,7 +681,7 @@ EXPORT_SYMBOL(drm_atomic_helper_connector_hdmi_update_infoframes); /** * drm_atomic_helper_connector_hdmi_update_audio_infoframe - Update the Audio Infoframe * @connector: A pointer to the HDMI connector - * @frame: A pointer to the audio infoframe to write + * @frame: A pointer to the audio infoframe to write or NULL to disable sending the frame * * This function is meant for HDMI connector drivers to update their * audio infoframe. It will typically be used in one of the ALSA hooks @@ -704,10 +704,16 @@ drm_atomic_helper_connector_hdmi_update_audio_infoframe(struct drm_connector *co mutex_lock(&connector->hdmi.infoframes.lock); - memcpy(&infoframe->data, frame, sizeof(infoframe->data)); - infoframe->set = true; + if (frame) { + memcpy(&infoframe->data, frame, sizeof(infoframe->data)); + infoframe->set = true; + + ret = write_infoframe(connector, infoframe); + } else { + infoframe->set = false; - ret = write_infoframe(connector, infoframe); + ret = clear_infoframe(connector, infoframe); + } mutex_unlock(&connector->hdmi.infoframes.lock); -- 2.39.2