From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lj1-f175.google.com (mail-lj1-f175.google.com [209.85.208.175]) (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 ABA22253F13 for ; Thu, 15 Jan 2026 02:58:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768445937; cv=none; b=uE7m9mrgcHbHtDrUTGsXoqjevn8W9I6rg+0XJJbt/a0Egfa0n5g0UCNFpFX2JBhT+Xo5FdYV3jMBKpLsE7ylTGGlHRml7gEtWYAy8qiVhR13LuusHok9fb6lgDCJAABBBX+cyTDmcbxLFx4qoqikiNdNXMXQI+YZ8TyqB14fBz4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768445937; c=relaxed/simple; bh=G0j5HAiR0C3JJjOni2dZdfpXBmHvJZ29uZYV9H6XczU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=dHu0x7xFiphXJILt7RxRRdaqhrOzv4kmOrs5iJhqHNbgrQAkOfxtDB75odd+jmp0eOkZwpQiIhIkaUDBP9JyalghgjGbxJwwf9xPG9fOqZsfexWhe8hN9Jt1TVoZCwc3wcCQqANdCUNfzNbn8Nm02B/bTsi2VpLbXJs8H8eg5Rc= 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=QA4C+0WL; arc=none smtp.client-ip=209.85.208.175 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="QA4C+0WL" Received: by mail-lj1-f175.google.com with SMTP id 38308e7fff4ca-3831b6abed6so546141fa.1 for ; Wed, 14 Jan 2026 18:58:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1768445933; x=1769050733; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=04QHhzYz2v+yNJO8IS9lKBiZ6dL208fyd5PVe/BXAQg=; b=QA4C+0WLTqkasx+paTIXJtFZ3sRTPu9GXmpZWevkRG09GO3+zhSp/n0Mtspa5P1OTq tVhoZmctfGe4f/l2sZFeRvRWzCpz0+BL/Zbwe42B2ZxQ+22CE4yU92u9tWOUhDhzgoAn /eXL0FdOBNL18omzGV4RRbWPrWWk2ktImVRC91blG/J8exlKR2bnuEpJrn7SDdVHpVuY uMoPLgIeIsb9klN40N4hCmSszZx6oaZfwTW8du8GRDLnTc/5Qxb20sMGOl53emmx8QQk 2JjQhyorVWhHy3dniZIQ7KG9T/IYMZY9wz5U/ex9SYBMSbAJZrJnnRxf2Ep0BRLecmKI BEpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768445933; x=1769050733; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:date:message-id:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=04QHhzYz2v+yNJO8IS9lKBiZ6dL208fyd5PVe/BXAQg=; b=bepa3QkiKYlL/CXpup9DRgX5cWelCXseQ1NLgAcG29UMnT/RDwHcLt1k8N/06zD0jQ edEbHY6+AWJraIk+XbRbc88KbZAEi+elHvgkc3BFSsGkrVCdBMdB4xQb2DqKAttP2why EtZizy1HADsFKGq1Uq87UqBVSiBYhKxr4TCEs24YbydD0CysfCPuT7XdWudJdT007Wjw BqaA7R9ZNgQWjEbPpQDczPQdEyMOgKmYfcnAaX1HdhVQJUaj74JVRXCspCc5Hy4WSp/F wL5CI8aDI7ZSc6U9ohqDAJgEU26dcJWMiSnEH/e6OQLpDyAdGD/NNl04Yj4XiFC1aqhH /CtA== X-Gm-Message-State: AOJu0YyHrxl8uG1XMsvSQ6floDgBllIcpzDctMldLmWVDJQLoF4JV9zt 2B3gbpzMrM9mS/PkX2UWT94ZmLGo928+aRSCC6bZB4koRU20daw8wnJMQ4zk5M9OiOc= X-Gm-Gg: AY/fxX6M+m3sBM+8FNZxiLysHyETE1uqcm3ouHEB2+4/x5LwKgzDudtWWe1ykyjEYB/ m2QHEWacqBxeX43l6G5iSS1fLwHhrWSR8IkV3tX4Q86wRzM0YExLqOvn6bQKACM4zHNKX/jlaWv wMbpvs7PFkOBCkJ+iSxtOlxDYYbScAX49/LzaiRD+EaCkNXxJxxuRrvAHhPWf31N91ydNH7WL2W d95L0J8jkZmQ4EolVz18RI8yDW0KTD4IiDX/vNnAq7AZEoPqebST55PNVpDE6YHuP35NvI7snZE Hywz9dZtc70Y/xTkdnN1vSJBkOGVZiS99Od2HnTP/+29gx/BHq9xGQV6rMr7ICQlSdhx3ZZzezR gSLf5w5WWEBLWnLPCFr/OTe6Vkp4Do8AiKyKJGAdgR+ryPeEQSkWZZZbRqEdqUV3iUkBJ+osz/G c9FzS6ZRJj4NQKv90lEMG3X/ht0jCfpUmXUdvwv6X44mUgX9heD3EMUDGgdfYRTfJcpg== X-Received: by 2002:a05:6512:4017:b0:592:f383:3aad with SMTP id 2adb3069b0e04-59ba0f9f61emr890004e87.8.1768445932776; Wed, 14 Jan 2026 18:58:52 -0800 (PST) Received: from [192.168.1.100] (91-159-24-186.elisa-laajakaista.fi. [91.159.24.186]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-59ba1045c55sm1219619e87.80.2026.01.14.18.58.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 14 Jan 2026 18:58:51 -0800 (PST) Message-ID: Date: Thu, 15 Jan 2026 04:58:51 +0200 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 v8 1/3] media: qcom: camss: Add common TPG support To: Bryan O'Donoghue , Wenmeng Liu , Robert Foss , Todor Tomov , Mauro Carvalho Chehab Cc: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org References: <20260113-camss_tpg-v8-0-fa2cb186a018@oss.qualcomm.com> <20260113-camss_tpg-v8-1-fa2cb186a018@oss.qualcomm.com> <87a31d4e-b604-4b9a-92e9-75fd2748489a@linaro.org> <98a26638-675b-4654-a940-898ba9e1af9c@oss.qualcomm.com> <641421a6-bf42-49f4-8f94-9cb0bce8e97c@linaro.org> From: Vladimir Zapolskiy In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 1/15/26 03:06, Bryan O'Donoghue wrote: > On 14/01/2026 22:07, Vladimir Zapolskiy wrote: >> Hi Wenmeng. >> >> On 1/14/26 14:18, Wenmeng Liu wrote: >>> >>> Hi Vladimir, >>> >>> >>> On 1/14/2026 1:05 PM, Vladimir Zapolskiy wrote: >>>> Hi Wenmeng. >>>> >>>> On 1/14/26 05:04, Wenmeng Liu wrote: >>>>> Hi Vladimir, >>>>> >>>>> On 1/14/2026 12:27 AM, Vladimir Zapolskiy wrote: >>>>>> Hello Wenmeng. >>>>>> >>>>>> On 1/13/26 11:03, Wenmeng Liu wrote: >>>>>>> Introduce a new common Test Pattern Generator (TPG) implementation >>>>>>> for >>>>>>> Qualcomm CAMSS. This module provides a generic interface for pattern >>>>>>> generation that can be reused by multiple platforms. >>>>>>> >>>>>>> Unlike CSID-integrated TPG, this TPG acts as a standalone block >>>>>>> that emulates both CSIPHY and sensor behavior, enabling flexible test >>>>>>> patterns without external hardware. >>>>>>> >>>>>>> Signed-off-by: Wenmeng Liu >>>>>>> --- >>>>>>>     drivers/media/platform/qcom/camss/Makefile    |   1 + >>>>>>>     drivers/media/platform/qcom/camss/camss-tpg.c | 710 ++++++++++ >>>>>>> ++++++ >>>>>>> ++++++++++ >>>>>>>     drivers/media/platform/qcom/camss/camss-tpg.h | 127 +++++ >>>>>>>     drivers/media/platform/qcom/camss/camss.h     |   5 + >>>>>>>     4 files changed, 843 insertions(+) >>>>>>> >>>>>>> diff --git a/drivers/media/platform/qcom/camss/Makefile b/drivers/ >>>>>>> media/platform/qcom/camss/Makefile >>>>>>> index >>>>>>> 5e349b4915130c71dbff90e73102e46dfede1520..d355e67c25700ac061b878543c32ed8defc03ad0 100644 >>>>>>> --- a/drivers/media/platform/qcom/camss/Makefile >>>>>>> +++ b/drivers/media/platform/qcom/camss/Makefile >>>>>>> @@ -27,5 +27,6 @@ qcom-camss-objs += \ >>>>>>>             camss-vfe.o \ >>>>>>>             camss-video.o \ >>>>>>>             camss-format.o \ >>>>>>> +        camss-tpg.o \ >>>>>> >>>>>> While you're here, please sort and keep the lines in alphabetical >>>>>> order. >>>>> ACK. >>>>> >>>>>> >>>>>>>     obj-$(CONFIG_VIDEO_QCOM_CAMSS) += qcom-camss.o >>>>>>> diff --git a/drivers/media/platform/qcom/camss/camss-tpg.c b/drivers/ >>>>>>> media/platform/qcom/camss/camss-tpg.c >>>>>>> new file mode 100644 >>>>>>> index >>>>>>> 0000000000000000000000000000000000000000..f4c015aafa202e5b64fafa3c543128fda6440b11 >>>>>>> --- /dev/null >>>>>>> +++ b/drivers/media/platform/qcom/camss/camss-tpg.c >>>>>>> @@ -0,0 +1,710 @@ >>>>>>> +// SPDX-License-Identifier: GPL-2.0 >>>>>>> +/* >>>>>>> + * >>>>>>> + * Qualcomm MSM Camera Subsystem - TPG Module >>>>>>> + * >>>>>>> + * Copyright (c) Qualcomm Technologies, Inc. and/or its >>>>>>> subsidiaries. >>>>>>> + */ >>>>>>> +#include >>>>>>> +#include >>>>>>> +#include >>>>>>> +#include >>>>>>> +#include >>>>>>> +#include >>>>>>> +#include >>>>>>> +#include >>>>>>> +#include >>>>>>> +#include >>>>>>> + >>>>>>> +#include "camss-tpg.h" >>>>>>> +#include "camss.h" >>>>>>> + >>>>>>> +const char * const testgen_payload_modes[] = { >>>>>>> +    "Disabled", >>>>>>> +    "Incrementing", >>>>>>> +    "Alternating 0x55/0xAA", >>>>>>> +    "Reserved", >>>>>>> +    "Reserved", >>>>>>> +    "Pseudo-random Data", >>>>>>> +    "User Specified", >>>>>>> +    "Reserved", >>>>>>> +    "Reserved", >>>>>>> +    "Color bars", >>>>>>> +    "Reserved" >>>>>> >>>>>> It makes little sense to mention the unsupported values, and then >>>>>> introduce enum tpg_testgen_mode to list the supported ones. >>>>>> >>>>> This is for ctrl menu, will do as follow: >>>>> static const char * const testgen_payload_modes[] = { >>>>>        [TPG_PAYLOAD_MODE_DISABLED]          = "Disabled", >>>>>        [TPG_PAYLOAD_MODE_INCREMENTING]      = "Incrementing", >>>>>        [TPG_PAYLOAD_MODE_ALTERNATING_55_AA]       = "Alternating >>>>> 0x55/0xAA", >>>>>        [TPG_PAYLOAD_MODE_RANDOM]      = "Pseudo-random Data", >>>>>        [TPG_PAYLOAD_MODE_USER_SPECIFIED]    = "User Specified", >>>>>        [TPG_PAYLOAD_MODE_COLOR_BARS]        = "Color bars", >>>>> }; >>>>> >>>> >>>> This is also not perfect, still userspace is misinformed about a number >>>> of possible TPG modes vs. a number of actually supported TPG modes. >>>> >>> 0x0: INCREMENTING >>> 0x1: ALTERNATING_55_AA >>> 0x4: RANDOM >>> 0x5: USER_SPECIFIED >>> 0x8: COLOR_BARS >>> >>> These values come from the register configuration, these pattern values >>> are consistent with the CSID TPG. >> >> Userspace should not be aware of such low level details as register values, >> there are many abstraction layers in-between to hide this type of >> information. >> >> Writing proper values to registers should be a concern on the driver level, >> it sounds improper to push this simple task and responsibility to >> userspace. > > I think we should stick to the same format as is already upstream for > the CSID version of this - which is the same data. > It is not the same and it will not be the same, if the currently presented version is taken. If TPG modes in CSID are continuous, here they are not, so it makes a big difference for userspace, and better it should be removed. -- Best wishes, Vladimir