From patchwork Fri Mar 14 15:29:22 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Khimich X-Patchwork-Id: 874608 Received: from mail-lj1-f169.google.com (mail-lj1-f169.google.com [209.85.208.169]) (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 38A58202991; Fri, 14 Mar 2025 15:29:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741966189; cv=none; b=b8Vxbm6cVZrELZmS5miYy0d9s24j4d2vv2uFYgplQMNrA29h65nilHWHZFPQfdIELqLedNE2YR7f30viN3jQZb2tw1z18tB5OHbH0ZvhNBfntU7qcA15U3G2sV+2qiTPAnHbHPXKB/Dr2rSPgtN04ZdK93dxQT4SyRAOEJFbX44= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741966189; c=relaxed/simple; bh=3cmE2i1Gz9lClv3Jfpe/1r3UhrAIU3SNzkgw702sHyQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Pzt4YLPEjyHrdNVFvjaL6QeP69sWH/rkKOVhwAc4ypqlJbnOWsaAq5Rl0SzyqQoiZrWN+gWcDZFAgdyuNMxpHOYr7vIOqScw2LNV39vYjidiTlwZ/tmmVMD53/kpo72NjVAQfHSz6Q9u2viludB7TscZeLQm/rFjhyotb5xtv2Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=A3BJR+05; arc=none smtp.client-ip=209.85.208.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="A3BJR+05" Received: by mail-lj1-f169.google.com with SMTP id 38308e7fff4ca-30bf5d7d107so19330721fa.2; Fri, 14 Mar 2025 08:29:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741966185; x=1742570985; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=g2TBxm9b4Z7DvE3zMi2yjLlJGaJTiMHJTb4BUjWKoMs=; b=A3BJR+05HQePvJEAmwRku6BSqPbRDeOuNLH4A4mTHyYc8BDk87pNr2BQ9Vy+vsuSSn gIOJNudDSg8LMGeLaIYJVjD7/wK5hmWwR4hp5utJBqFK5BqYI5xbUtR5kgMkxTooczYx 5DrG7AbTXwTjC4uDewRfRUuYyu+PcjtIiLHFeapM5CMr4mH0RCCRvJYTXfpf/JJEh406 7ADi9NX5hQPSXAhwbWnS3Pmk2HuL8pHaOR6tihNlVI46kW9w3uuNOCDBVRTeoxVp4IcC gTNZ8F24U1u4HxXXPFXuKzs+Y91/i2z9GlNSBnZcdxACxw6e/YGMllXalVHYeV0HSlxI fi9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741966185; x=1742570985; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=g2TBxm9b4Z7DvE3zMi2yjLlJGaJTiMHJTb4BUjWKoMs=; b=eR/I/I8VkHZpml+HgI/bKwl0diqZg/W48JeT9kPsiu/gv716neFvCwQeX4zX+ZvFcn hpjcrbNA8/kLjDObTsSH3oVb2PIpY5S0aZmWiMYepmZWltOCUrYmSTt4rVYmpbdGTLNJ VfEbQ0eeR8YnL72ya7YVSQBEzk992TvKfbQwe/ypS9FwWi7ARBhhly8PC0gPv4y7LjXl 8Gzj/E6uEAZ1mWc2hwunVbF6dROpRRoRNyeKBInUg8T9keGTrmh2SfL1dYUcR+z40zJu qcVFcU80mzlzT/zEnhRmcrgujIL+q0J6VNq9Cl4RtbIa4JlIYA4EsmHVBErpZ3RRMZXO JP5w== X-Forwarded-Encrypted: i=1; AJvYcCXCTitxXjcoKMPsRPuKsWsSHq4lBDLSUIyR5AJ88t6I9EtLV//3VVb29waSnDcXdiDusshSVXvsGmI52Ss=@vger.kernel.org X-Gm-Message-State: AOJu0Yx+ZsFLEVNYbCAZC32fZ/jnxdPxSeC/pa3rWdWqE+AaLaxai+6t zDtJVL+n+cRjpOtsE6O4UBlMzpfiG8DgvlnhVpDcnkB+Q05wd/SzEymLF4nAWvM= X-Gm-Gg: ASbGncsDmYIHVQmVQ/PFz7j7IS8AWt7/WKFJfTomnV9xONGrkidDhFQ8ED7FGIs1AIC nyBs4Oo4hypyB9g/k8WWqAQ35ERkNfH+DunLBEFrzCTX8KQhcroPBTgKnwF5NiIwCg5vqj9zOlw Ug45iOAPoQTy6mQgyU383zbGi6lBracJeLSDVcLi2RNaa5Wxwv6NFeWkcjZzJo6aJAeCtMq0Hjc G18/2cJipheAq2Ijf0zrXLTwmfIDTRX6w1rzI8U3ds8bwDcpFPyrK5BMsk2cb5ryzKhgNspVmOc rXQXIT5RSy7yKR7ngOrl59ixCyvJ2h6DBIeXjH/Bt980DwDMcvM0UVS/auk5JgdVo8Hc X-Google-Smtp-Source: AGHT+IHz3UFJwnIa4DizqArqEXe7UJKpqN6ShlYP0/kZkaZxijazQ/Qj3vUgdb2JaYqJb+fk32p4pg== X-Received: by 2002:a05:651c:198c:b0:30c:1441:9e84 with SMTP id 38308e7fff4ca-30c4a860201mr11324771fa.13.1741966185322; Fri, 14 Mar 2025 08:29:45 -0700 (PDT) Received: from skhimich.dev.yadro.com (avpn02.yadro.com. [89.207.88.245]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-30c3f0e99f6sm6253581fa.37.2025.03.14.08.29.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Mar 2025 08:29:43 -0700 (PDT) From: Sergey Khimich To: linux-media@vger.kernel.org Cc: Philipp Zabel , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Vladimir Yakovlev , Maksim Turok Subject: [PATCH 01/18] media: coda: Add print if irq isn't present Date: Fri, 14 Mar 2025 18:29:22 +0300 Message-Id: <20250314152939.2759573-2-serghox@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20250314152939.2759573-1-serghox@gmail.com> References: <20250314152939.2759573-1-serghox@gmail.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Vladimir Yakovlev Use dev_err_probe for print and return error if irq isn't present Co-developed-by: Sergey Khimich Signed-off-by: Sergey Khimich Signed-off-by: Vladimir Yakovlev --- drivers/media/platform/chips-media/coda/coda-common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/chips-media/coda/coda-common.c b/drivers/media/platform/chips-media/coda/coda-common.c index 289a076c3bcc..84b9b75b382e 100644 --- a/drivers/media/platform/chips-media/coda/coda-common.c +++ b/drivers/media/platform/chips-media/coda/coda-common.c @@ -3178,7 +3178,7 @@ static int coda_probe(struct platform_device *pdev) if (irq < 0) irq = platform_get_irq(pdev, 0); if (irq < 0) - return irq; + return dev_err_probe(&pdev->dev, irq, "Failed to get irq 0 (bit)\n"); ret = devm_request_irq(&pdev->dev, irq, coda_irq_handler, 0, CODA_NAME "-video", dev); From patchwork Fri Mar 14 15:29:24 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Khimich X-Patchwork-Id: 874607 Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com [209.85.208.178]) (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 ED070202F9A; Fri, 14 Mar 2025 15:29:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741966193; cv=none; b=tz/C17+ghFcFjxw6yyCAFNHSOo1h7lVFUupI80wPPlJ4HjBllUgc2mPPtaNyixyfEHBW8GHVGUwiANWKFs0aVpr05wMWuRa3rvtHtkBrhh3BcpF7nNbv5MnzX9fuSJQwZIAgM5iWbHLn7hoVRjLhRl1xrUnOP8+FvIZeX9NVLIk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741966193; c=relaxed/simple; bh=dDfjSEMJqcbiFRRTXRgiBy29koeayW0JN3uv77D2LIs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=coY2gYWOsr9Wz2lfnKYn/m6r7FK92lUBkBjKJCfgAtB9QJaWvUHs/ahO5hvTx5ryBJAO/Nc/yGmgu3rW4ZqeX9ymvY/9QyNutCMlLCn9KQua8ezN47a7tyoi0eIx3I3h068rBRe/i+2k8VQ66li0ddySZVUCLjaIRVdK+Gy0K38= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ncarldHI; arc=none smtp.client-ip=209.85.208.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ncarldHI" Received: by mail-lj1-f178.google.com with SMTP id 38308e7fff4ca-30c461a45f8so13563981fa.1; Fri, 14 Mar 2025 08:29:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741966189; x=1742570989; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=B+KjLHCq3Sx2kKjWPeGqmXEWfZAFtx8T+aLve8LuxuM=; b=ncarldHIG8NIB88IQ2IHHVYNfQwCDin5d+1xVKCdwYfvBeUYtGAu2cgCYn5ueIEEjS 7zYnerUkSwxo5KTZ2czeY4efq/KyGvgePnbf3FYsbUqV0ZxJorDfsMijYK3iTSIaxKaa Y4hn2r+7EvUGab3uLJovMGVoVYN3d1yvVlhh3paRWEvpqeqD+GtPUwA6w6liI+uVcS51 976ZjgWbnuf3Dz8HN8u/lBWboRKbSImzZmpREF5yK/paDRhnJUjZgvsjqZBw1d8mFeSu 79DwIPi3taI2hyxDx1DU6t4k5groJqDlicleCEn5IDlQclP/AqNBnasQtmXteK2JvI2a pp1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741966189; x=1742570989; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=B+KjLHCq3Sx2kKjWPeGqmXEWfZAFtx8T+aLve8LuxuM=; b=MaHG5TgiOekxYjTd7kMoB1TKceekeFM/+bafrvDU+y4OmNxdUxQi94JfgE97OZpuk8 cEBLKBRprAXAUGI+aEkpg6+1Eu8CSPrs2+7qj1CQsQE8anZQpWd6DcJO/tc3WpYQaPIy VcxBJvTqbLQj1GyBJLSz0eAE9659TYvYsZ0FRWW9Z0Z7NjwUaYaurbC2pMvuQ2oydqvY JAts+Hz8Jx2+jZE6Kloq47rWSdKWtA3zP2ejuPN2KIrq/3N7pLiRGUQha41txhbZyBdw OurI4o8PrD+ZhhY1R34x42CDQO5Hpse2o7j8Sn09RNqdYBJdnWYXEMh7ZFvyWki0+VvK FVhg== X-Forwarded-Encrypted: i=1; AJvYcCVYmOSWZgxZjHnedQL7nl6eKc+i6r4iP22i10Ic0tqYXgqoltDHjuRbZnCnhx/zSwCbERVTcow1ungaySo=@vger.kernel.org X-Gm-Message-State: AOJu0YwnCEAPK0ZX03bYqelrS0hIOFbCSMaVrup6GnxL8HhjXKpjS7vs B32NRr2MmcaU5L6Z2vQZsw1F4yMnq/N0ccKO65sBEoBvnfXZijOpF4E5o+eMC78= X-Gm-Gg: ASbGnctnK3aeNV+o+zcEQ+i7X3JOHTCAfHWyicsGCv7hY18Y+NVby39wN2Q5OmhmGlo R1mYdp/mI9lJpOEka3jDKKo0kry5m+rZtuvadECsdXYNX704OSlv1ZfE+OdgKJOPP1qrOQcBFPt Roin5e8cBKOLgeJ1IkXjfva0mWwgxuzWKOnOmI+YEPhCop/FV8gJGB0Np6nth9PEh0r34mwpvHB foGOW7R5qBvEGbmzqWcyd/aqSte9fz4HmlDN8SPF4xcmJccHq5idHYSK3wXYsVfDMwCIklOQJmY hZQrXNIQiPyJaiE9UugPCMvaRx3WOk+NYbrG+HuTGmjC4sCi+cwZF4PELCrpxe5KQK/B X-Google-Smtp-Source: AGHT+IFt63GiJvYRhTbIvjnwU/PlkPSNrf5lKrSkW7Do/SjlTvnqNK4g893isi48FwqEKoOZwM5BoA== X-Received: by 2002:a05:651c:220c:b0:30b:cc6a:fff7 with SMTP id 38308e7fff4ca-30c4a852e04mr11269241fa.6.1741966189312; Fri, 14 Mar 2025 08:29:49 -0700 (PDT) Received: from skhimich.dev.yadro.com (avpn02.yadro.com. [89.207.88.245]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-30c3f0e99f6sm6253581fa.37.2025.03.14.08.29.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Mar 2025 08:29:48 -0700 (PDT) From: Sergey Khimich To: linux-media@vger.kernel.org Cc: Philipp Zabel , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Vladimir Yakovlev , Maksim Turok Subject: [PATCH 03/18] dt-bindings: media: coda: Fix resets count Date: Fri, 14 Mar 2025 18:29:24 +0300 Message-Id: <20250314152939.2759573-4-serghox@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20250314152939.2759573-1-serghox@gmail.com> References: <20250314152939.2759573-1-serghox@gmail.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Vladimir Yakovlev Change resets count because now we use get array function and reset signas may be more than 1. Co-developed-by: Sergey Khimich Signed-off-by: Sergey Khimich Signed-off-by: Vladimir Yakovlev --- Documentation/devicetree/bindings/media/coda.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/media/coda.yaml b/Documentation/devicetree/bindings/media/coda.yaml index c9d5adbc8c4a..3cb0e9afc100 100644 --- a/Documentation/devicetree/bindings/media/coda.yaml +++ b/Documentation/devicetree/bindings/media/coda.yaml @@ -60,7 +60,7 @@ properties: maxItems: 1 resets: - maxItems: 1 + minItems: 1 iram: $ref: /schemas/types.yaml#/definitions/phandle From patchwork Fri Mar 14 15:29:26 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Khimich X-Patchwork-Id: 874606 Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) (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 3C48420409B; Fri, 14 Mar 2025 15:29:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741966198; cv=none; b=HSX/POz3sbcM+gigjgpr3hCbcQmZcL71oJcXqOCy4qOtAWgBeWzSYy1AWNLbNdnV3NPyeDrKEEwwWJ3apuklaQdyeDnhdpDNLpdijO+mF1n9fDYskgNvtNXQVPM1bU/iune5NE00K4t63PicfBvpImxPVyud0GLUjdc4hR0Eb/k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741966198; c=relaxed/simple; bh=I7pVhZ1m4laGSD4+BO4jNvJfowqtXOPdcOK/Y3r1/sQ=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Nq7/boTTYCtX8tYxWr72b2WbCy0FY3HV2E/b09QM2B76PaS3zP65TZRinWxINYiCbC5ARbJw/c69RToCJsJPjtudQ+7n4YhtJnhzZhCEwY8p8znLZ+uOw00ZK+5tndqcd5EsDFl5p1aDg7gP7BoP9qRMnxUWt+OMpjeS3v1+Qz4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=CK4geyJe; arc=none smtp.client-ip=209.85.208.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="CK4geyJe" Received: by mail-lj1-f170.google.com with SMTP id 38308e7fff4ca-3061513d353so26982721fa.2; Fri, 14 Mar 2025 08:29:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741966194; x=1742570994; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=VBp+MyC/2lSvCtiHJgVjLDnI7aoBViMmFmchAxQ69hQ=; b=CK4geyJeJHm3EBoCdlLIN28FzgAkaexz41GkxNs1ySooeEcZ+diKLKjnzUzFGBpSSJ NLc1NZYFDewyw2moyhc66LuJ+1I+ge0YVWV/KmG1wLrK+ES3rU6+cVyNDRERJs+B5w5o jS3BE/yj3/Z3TM+Kttm0uSAbccVyGyBTkdVRIK5MBSRYEMl67rXOdd1ITa9TNftL7sD6 jPkkRSwdc1N1KQwyAowAINZqNJQ+/naxk41IRMoS0gOKMTR42ouZKmhNJTLNHJ3KXnKG Qpl5u4w2nzP3lusW3/LWF+Az+1vqiMQnFpXIto9gPIA8D7PNttDOdHgMiYACvZ0OE7Vq LBpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741966194; x=1742570994; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VBp+MyC/2lSvCtiHJgVjLDnI7aoBViMmFmchAxQ69hQ=; b=XA1OMrn5DNvw2MPaVJocCyA/W3g+Y75onZPKXJafAzdcjGoHLNXz9tptOA7Jv2DAd6 SO+hFb0VyHZeahkvGJxOaDDfDK+BnU9KVmjLagWbDoaI6UL1V/pCkowDbyXj49wlIay7 m6V0J8VMmLodLx0B4jlg2Cu68dzHFG+7kvulcgA5VwsCzXm0zKTCBTj7kF0YZuHUrTN4 1pRA+3/5bMrJnWA4s6j5BLB6CHhzAFEFra3CmURGRsmWKDF264B7FE7DVEVBfrDglz8A +efufKowYkYS08DTjY2ystLpvJimrKrGwrSLudphCYAemEokrFu8kP50LfAPSTNi540c a1sg== X-Forwarded-Encrypted: i=1; AJvYcCWsvRgZRHBt2qRLiUrueECIMo09dZOgX16haf8bLZT+9fbkUOEje1s9oWOYh06soyX6qKccqPIxv5Oeryk=@vger.kernel.org X-Gm-Message-State: AOJu0YxQMWzYLy+3CvOZq4G94GwXf5R1NWrBbY9nQaWyVjGGcYousAnH i/ndHTuJMRM2F+loSLEj62bFRK2fCkrrSePiUBV20e1Xr+GBVfpiGAQB00eobbE= X-Gm-Gg: ASbGncuYamqVVc/knG6QWxgdxetRxWkKVuze/IDKKfGEIQqbsPP7KS9g+MoAADPKCto 5d6FFPBttMshk59y550gVxiRWFHUIDpAL1vZ2B5vJa/ewSafAEzg96rQaSWk0q5BCj4sZIkMuVv sXRWDAJ7rSqhE8JX5fov7pHHsViDoeCJz7/Bza/Mm6sGkctl61kiKBhLpcTY7bR+O5O44oda5Ea gdj5+3O31vJGs1uMdJ0XbJ69aaW9VtO4NBwiLTk6MQmQLmms9WNVtuuF5fb7O3KF8HA5tnt/2yb NFW9HT1xvl+wxWXeb3iZAW2Fvz/y1ZIEls5vaXWbJ9pFRFqLyc0on1+wMArabyF/ie4Tvt679fr Lv3o= X-Google-Smtp-Source: AGHT+IG6QmzrcKWEFKz5AmgDsW3ngveYSn6bnD0b9EFvZzQXH1KPuBgJtH1TC0C2lneQJGDjamI/gQ== X-Received: by 2002:a2e:a370:0:b0:30b:c5e7:6e61 with SMTP id 38308e7fff4ca-30c4a875eb8mr9982751fa.20.1741966193506; Fri, 14 Mar 2025 08:29:53 -0700 (PDT) Received: from skhimich.dev.yadro.com (avpn02.yadro.com. [89.207.88.245]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-30c3f0e99f6sm6253581fa.37.2025.03.14.08.29.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Mar 2025 08:29:53 -0700 (PDT) From: Sergey Khimich To: linux-media@vger.kernel.org Cc: Philipp Zabel , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Vladimir Yakovlev , Maksim Turok Subject: [PATCH 05/18] media: coda: using threaded_irq for 0 (bit) interrupt Date: Fri, 14 Mar 2025 18:29:26 +0300 Message-Id: <20250314152939.2759573-6-serghox@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20250314152939.2759573-1-serghox@gmail.com> References: <20250314152939.2759573-1-serghox@gmail.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Sergey Khimich Use threaded_irq for 0 (bit) interrupt instead of lowlevel locked irq. Signed-off-by: Sergey Khimich --- drivers/media/platform/chips-media/coda/coda-common.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/chips-media/coda/coda-common.c b/drivers/media/platform/chips-media/coda/coda-common.c index 64ba17d8adfb..b240091cdc9d 100644 --- a/drivers/media/platform/chips-media/coda/coda-common.c +++ b/drivers/media/platform/chips-media/coda/coda-common.c @@ -3184,8 +3184,10 @@ static int coda_probe(struct platform_device *pdev) if (irq < 0) return dev_err_probe(&pdev->dev, irq, "Failed to get irq 0 (bit)\n"); - ret = devm_request_irq(&pdev->dev, irq, coda_irq_handler, 0, - CODA_NAME "-video", dev); + ret = devm_request_threaded_irq(&pdev->dev, irq, NULL, + coda_irq_handler, + IRQF_ONESHOT, + CODA_NAME "-video", (void *)(dev)); if (ret < 0) { dev_err(&pdev->dev, "failed to request irq: %d\n", ret); return ret; From patchwork Fri Mar 14 15:29:28 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Khimich X-Patchwork-Id: 874605 Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com [209.85.208.174]) (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 B27C32045A0; Fri, 14 Mar 2025 15:29:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741966200; cv=none; b=NNDpJ5FXpGVql7LYCbuTseBTZSgfRyZ305lsStiiNIxMXFT4QV44KvbOyBrpHNvhqRQZuNKlpXy818yICdvEXePqG72IOEP6ZSKUkg+9uBVsOrBzBTNYcu4OZeEALIBpvA1SL1d8XsEU1QJIf0L3yo99QLsk9H0CFMcFs9mm3wI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741966200; c=relaxed/simple; bh=F85xUi/UAHMny6c6TSIiGL9bA21s135Gdddyr3EpVHA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=e464+P2cmYeFv8QJXzINT4ELDu9bnbFuNqWSyT7WMVrrKB72yenNLbQfhf8gxDoQydwV5In5K6Ic2epCuPlZ9Uh0sfo4DaP0CIzZcT8eQC8/OCdgh9mm+KLfhlehDDa3UddJxLuI3FNYzH1ov9b0YxrftFYaIzn/pF3QvTKu+VI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Hr9p+hu+; arc=none smtp.client-ip=209.85.208.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Hr9p+hu+" Received: by mail-lj1-f174.google.com with SMTP id 38308e7fff4ca-307bc125e2eso24927761fa.3; Fri, 14 Mar 2025 08:29:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741966196; x=1742570996; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=AIOyg9U7oN/4rti1p3xjWta08jOexNwOZk/0TKQp7eQ=; b=Hr9p+hu+bEiJt41pO1+zMU34eop4wdA8skQYIm4XIlEd+7iOEXNjD57QTCgWr/BMWl gCL69lXZInm47KRzHDRrAm+Z6e1MV8+ii9LcIGAUe4W1/NFMRmK7cYlrib6dSggOqS9Q 3sExMSK1qYqaAvrv5ZzFDrAYwI9dq3X/16HfXtqBjc84TiWaOUkk+5ePNQLlam96IWib AOWhqBsGggR1jJgqF6vrmG5R/xPpsREgErXURZ/+X2sZTR+ePGzn/NzzfmSbJlqpbZo1 OIWUKPwsvfVfAslaTCw5tkgPW4sDCYp25PVy4eOFEA3W3aocaEq46SIwHrJENnQW/pV+ 852A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741966196; x=1742570996; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AIOyg9U7oN/4rti1p3xjWta08jOexNwOZk/0TKQp7eQ=; b=f7Gi29bS/Vq9tqBDbxJraTwDjTbdxIioDiqX2k4mskZ05JosPZDI5jwAT1KkT0P8E+ WFNphsN+d3xafcm0FwiFXR4upHJp8VMf9Mewbb6yspYdEzGfFV2bKK+AM7wcsh19fj38 L5lad5pJTM1odgz3V3jlp2LWYH0oThAESqvTiU3hSgOsVuS7smKJT4wPYcACzoldW+Zg jhPTV8d/eE71KsUOVOlgUlzvCu7Dn1Ulz/cZ1gSmWut9Gsd3bnU9bk8vutnZIZnDqri9 ab3D2jl1PjGg0VhAFsPYz1BO70yA2Ahh+MDPtf46Y2SAn3a/EZ5zPUZ+TeC0uyfa2gDM 4qWg== X-Forwarded-Encrypted: i=1; AJvYcCVFdMCPHWx1HuJWTMQkNoTEUTcMBe2/qr+3sVuOmkWVZSEcAK3rqycdPIuspmQmBeuLeDFS4y3GwBxjUMA=@vger.kernel.org X-Gm-Message-State: AOJu0YzvaZ00PLfIoffu9f1oAgxSHpxwC3A0g2deY/rviH8MhoBRB767 8e3QMGiA7Y3xDGohzkW1rbK+9ef5tNy3Tkg0nuTLFDv4biPKRJCcXzhy3bSERoU= X-Gm-Gg: ASbGncsHObd6nQyi1tps3nrWqxQwNQQvKp6EcvISErUyxccNYZRELQch4kAxhbnLHDa kZCQOrH7cPl2ns5dHoa5zF8p1AMSmvMh2NvSabGFOGQYoKV078BGRzywnx7G4MAUivSynZwfA7J YfBTp1YTkvHCQC5P0gl7fwrGmAo9B5+8KXYVV+WvZAtPaxIepjPrPcNPCR66xEqbX8X/2cRNi/H fUFZGswV6qYLE+Ipt6CmmT4tjG27n5eb89Rd+YbXHfgZuedzFw8xckSoaAXOKtgO400AvAXA0Zp axkpyClt57R80oeyRLbe+h2gYjhDr984BVCqpO+REvZLj2zjB190/CPywXju4fOiybt8gi4wEYG ATSc= X-Google-Smtp-Source: AGHT+IGI7akv8kxmPGyPe1epF+PCgNrUQ7LPeG2tv+/tXFRjBU3B63HCGyKWeADVlTHzDItEFj+/rg== X-Received: by 2002:a05:651c:210a:b0:30b:bf6f:66a3 with SMTP id 38308e7fff4ca-30c4a875ec3mr12115761fa.17.1741966195869; Fri, 14 Mar 2025 08:29:55 -0700 (PDT) Received: from skhimich.dev.yadro.com (avpn02.yadro.com. [89.207.88.245]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-30c3f0e99f6sm6253581fa.37.2025.03.14.08.29.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Mar 2025 08:29:55 -0700 (PDT) From: Sergey Khimich To: linux-media@vger.kernel.org Cc: Philipp Zabel , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Vladimir Yakovlev , Maksim Turok Subject: [PATCH 07/18] media: coda: Add fake IRQ check Date: Fri, 14 Mar 2025 18:29:28 +0300 Message-Id: <20250314152939.2759573-8-serghox@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20250314152939.2759573-1-serghox@gmail.com> References: <20250314152939.2759573-1-serghox@gmail.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Sergey Khimich Sometimes we receive fake interrupts. It's better to check status register and trace fake irq if occurred. Signed-off-by: Sergey Khimich --- .../media/platform/chips-media/coda/coda-bit.c | 16 +++++++++++++++- drivers/media/platform/chips-media/coda/trace.h | 16 ++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/chips-media/coda/coda-bit.c b/drivers/media/platform/chips-media/coda/coda-bit.c index 84ded154adfe..3e3bb3d64ec9 100644 --- a/drivers/media/platform/chips-media/coda/coda-bit.c +++ b/drivers/media/platform/chips-media/coda/coda-bit.c @@ -2635,9 +2635,23 @@ irqreturn_t coda_irq_handler(int irq, void *data) { struct coda_dev *dev = data; struct coda_ctx *ctx; + u32 status; /* read status register to attend the IRQ */ - coda_read(dev, CODA_REG_BIT_INT_STATUS); + status = coda_read(dev, CODA_REG_BIT_INT_STATUS); + if (!status) { + /* + * Sometimes we received wrong interrupts + * That's why we check status + * and if one of it is zero - wait next interrupts + * You need check your HW configuration + */ + dev_warn_ratelimited(dev->dev, "Fake irq status=0x%X\n", + status); + trace_coda_wrong_irq(dev); + return IRQ_HANDLED; + } + coda_write(dev, 0, CODA_REG_BIT_INT_REASON); coda_write(dev, CODA_REG_BIT_INT_CLEAR_SET, CODA_REG_BIT_INT_CLEAR); diff --git a/drivers/media/platform/chips-media/coda/trace.h b/drivers/media/platform/chips-media/coda/trace.h index abc6a01a74e9..15a96bab10ad 100644 --- a/drivers/media/platform/chips-media/coda/trace.h +++ b/drivers/media/platform/chips-media/coda/trace.h @@ -10,6 +10,22 @@ #include "coda.h" +TRACE_EVENT(coda_wrong_irq, + TP_PROTO(struct coda_dev *dev), + + TP_ARGS(dev), + + TP_STRUCT__entry( + __field(struct coda_dev *, dev) + ), + + TP_fast_assign( + __entry->dev = dev; + ), + + TP_printk(" dev = 0x%p", __entry->dev) +); + TRACE_EVENT(coda_bit_run, TP_PROTO(struct coda_ctx *ctx, int cmd), From patchwork Fri Mar 14 15:29:30 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Khimich X-Patchwork-Id: 874604 Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com [209.85.208.174]) (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 0E177204878; Fri, 14 Mar 2025 15:30:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741966203; cv=none; b=HPN7okMUxnqkHVR8cndgnbsLNDH4No7+ovpRJPl6lcjxy5gn+qXttfu7yegMt9i4uqYxmQNPcDi2xKibMOl2aHi869JHw7u8Q0WS7qvhCuowPGt+LDLu2bpyNnUeloF/gJ2gei/GLIrBZkozrCMnJLmXu05CXI1LEXNfdeFQ0eM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741966203; c=relaxed/simple; bh=JPs95P7qvX/qFz5WsWKK3n3NUUKZ6s2zBvn8J8WqHVo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=PtsFJdZeBMKQbo8fGrGQSqa1jGGg4rzvBVCkvZ07L2YCzoLHq0EacJuH7xROqn7/ul1xm/zhywnckpAYp4XT6+LsbS+2W5l1N74iqTIKuybcIxdVvrbBD5s4iQwIm+cAPzJTahWUKbMSNwb78qVcm2VGYYxOLPuZNSHKu9QKtUg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=C+34aM4p; arc=none smtp.client-ip=209.85.208.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="C+34aM4p" Received: by mail-lj1-f174.google.com with SMTP id 38308e7fff4ca-30c091b54aaso20478241fa.3; Fri, 14 Mar 2025 08:30:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741966200; x=1742571000; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=YKH3xVYSpPOpJIjUR/N4nEe7ND+fn1lAzizapSf4YhI=; b=C+34aM4pXfPplsV9+sYH58HVTMcNc4CkePwAb/68zm1d5ctin3Zh2PrXoGpTkfHvAf U3IoDU+jYgLxHxDgC7q7tkh1V5WRV9B1T6IrkCSYxFcXqR/Kix0HXhoGs/+eymDFNcw/ /n2ukX296YRQc7A+ENgMCDgXQaoTQaJEaPhwaSbXqlHDaKp5QiMAQwWDDe5vLHocYXRC FUC+TNDjgA3VUdPByofARNWm5J1zOOGpY+mn/WsncP72qIp7sK7nIYo+cWtFL9FIpZUC WsrkIjWOfHfgcMz70A4/iI8fwn8diurQxwW5KNAVqsaT5fn2618gXKPGH2fWG6D0ePq6 t10Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741966200; x=1742571000; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YKH3xVYSpPOpJIjUR/N4nEe7ND+fn1lAzizapSf4YhI=; b=crnUVHhnh4zBSSIgr/CbRXalC1MzUS+5MS0prI1CUo+obf7EpLjt7fUrloObo3N7/v j7kXSxtSSDiTkbEhOpaML0tSkaRrDNKO8wDNVmEFIINrrOV13m9rOpMjFaEYh6LVcMpU TUjwlBL2RXYxNY628EUREyNb6CTuhmfwcUViJTa0thxtYBo/BRGJGxy3igZU9FbKLZxY 5MqxFKewp0CucAASJA4k7AfHlWf+ESGtScZ/d+BHyU4ocuXDT67+YVECOiDAOyNt77Ti uNMsSVADpv3kBv9aXMqNIswGXa8kBH1NxcUyMLPAJTnnTo0whSG6SMQFT6L/G/yKRor/ NenA== X-Forwarded-Encrypted: i=1; AJvYcCUPjTgUcK52AloC00Z3738TrascDT0V0IG2W8EY7Yogd7hCLJiVZu/A/kfA2H3TdUjXT03TCxCBTu3K6ZU=@vger.kernel.org X-Gm-Message-State: AOJu0Yxt+5T9vK9sRT+q6CrjSj78/WYgxw6X7lSSvL9LoxA3u17BLLQD fOeFF/B5y/ls3vZ4lT8i9qFsnbEXrUQ8/vU/0XBKBYL0S0D1ge1HltEj1pPMAlY= X-Gm-Gg: ASbGncu5vUXDe4KgGWcMRLn32msuIlGPcGXxJzlugTcyarDxhkySFnAPcGMvcFm3RG/ mEFgQI5LC/3jhLYRt9zfCTTb6XrreKjDMkAvZoS0Zie8hwKrtIJ6+/LkYhEDFWpHLzFTvE31trF 0ZDvniqbprGd8s3UcgPdTIiZjJWlWt6FGf/nuiCpnD6g63syenGMDzJmyxP69onpJ4MNu6OgRLW LlqsH7jd0NtCGXuWRXZf5tQuazbKGsyepuQ30sN22U8V9mUivrMHH9v9GNOh5zuiaV3M39s2osK t6vCpatkcV8uQQH9RVtYyvftFq5bMGkIJ70sEm0z3tWWZhLHZX/7Ix9AZhmTH0M7E5W4 X-Google-Smtp-Source: AGHT+IEpMlGIGU3WJ4ajdiFf6dboPCoZO9zDyRpfdZ6iR2pH1veBmqUleTEpCrOhFfmWzrP22oby6Q== X-Received: by 2002:a2e:bc1d:0:b0:30b:b987:b6a7 with SMTP id 38308e7fff4ca-30c4a64ead1mr11410261fa.0.1741966199540; Fri, 14 Mar 2025 08:29:59 -0700 (PDT) Received: from skhimich.dev.yadro.com (avpn02.yadro.com. [89.207.88.245]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-30c3f0e99f6sm6253581fa.37.2025.03.14.08.29.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Mar 2025 08:29:58 -0700 (PDT) From: Sergey Khimich To: linux-media@vger.kernel.org Cc: Philipp Zabel , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Vladimir Yakovlev , Maksim Turok Subject: [PATCH 09/18] media: coda: Fix max h.264 level for CODA_DX6 Date: Fri, 14 Mar 2025 18:29:30 +0300 Message-Id: <20250314152939.2759573-10-serghox@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20250314152939.2759573-1-serghox@gmail.com> References: <20250314152939.2759573-1-serghox@gmail.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Vladimir Yakovlev CODA_DX6 has h.264 decoder but v4l2_ctrls of level wasn't setting for this device. Co-developed-by: Sergey Khimich Signed-off-by: Sergey Khimich Signed-off-by: Vladimir Yakovlev --- drivers/media/platform/chips-media/coda/coda-common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/chips-media/coda/coda-common.c b/drivers/media/platform/chips-media/coda/coda-common.c index 33c7e8398f31..555b73816952 100644 --- a/drivers/media/platform/chips-media/coda/coda-common.c +++ b/drivers/media/platform/chips-media/coda/coda-common.c @@ -2440,8 +2440,8 @@ static void coda_decode_ctrls(struct coda_ctx *ctx) max = V4L2_MPEG_VIDEO_H264_LEVEL_4_0; else if (ctx->dev->devtype->product == CODA_960) max = V4L2_MPEG_VIDEO_H264_LEVEL_4_1; - else - return; + else /* CODA_DX6 */ + max = V4L2_MPEG_VIDEO_H264_LEVEL_3_0; ctx->h264_level_ctrl = v4l2_ctrl_new_std_menu(&ctx->ctrls, &coda_ctrl_ops, V4L2_CID_MPEG_VIDEO_H264_LEVEL, max, 0, max); if (ctx->h264_level_ctrl) From patchwork Fri Mar 14 15:29:32 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Khimich X-Patchwork-Id: 874603 Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com [209.85.208.180]) (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 B3B43204F6C; Fri, 14 Mar 2025 15:30:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741966206; cv=none; b=hQPvDE/F7RscKlV34u5Q6pe/M1Zh/HJJEqq5wbuOGinBdulH0MvhJyFc3ZBrNNL+N0VNFWBK55ICKJcbx23VgOmEUOGmt2WXFOQv0Yq+AITPXnRoc0wGaj2iGCm3pN4RopYuRyh/Aj2QDsygPImGHn5mORvy8uZkwcZxAUSSukE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741966206; c=relaxed/simple; bh=iLbNHxnZFdW7NufxIvEf3x0IAc/VSokrS+nHxqQFBe4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=eK/YMIyVRiRnenqOFDvRGG85lguaipTNT9duUHqUH25qvz372HKUO42kt7SPS490eE/6uP8m4+ARLGd3W88+E82z6tyhcO47rRP7NuhRa8qBx2Cay/DbkVvNJHMbpAEaDD+eFc2cg8WTzcqK8fLHBFZGOn/8yPcdZDrH4cqXfuU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=RIjKAPhb; arc=none smtp.client-ip=209.85.208.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RIjKAPhb" Received: by mail-lj1-f180.google.com with SMTP id 38308e7fff4ca-30761be8fcfso24667471fa.0; Fri, 14 Mar 2025 08:30:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741966202; x=1742571002; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WAe7Mq9PAoLxsqmL3ma6QJkF2PJXg5Q8DTTiDZQANqc=; b=RIjKAPhbCG2ypJsb/F1O2HrRYZnEwx88QyeFT8zgH4jLSyK//Iz0PHL7m3cHgMoucp BGI2TmkUcLF4XSfehRb7UIGtzOZgYXl3Uun63vxFH85Qxs/F3py/0+u5nZe9Aq6dU7Tg 4RDAY8ssrv8wM9LJFcfXUp+S9HqcpVEztN7Y2tuYiBm8ebBpfW0ECJM0oulbFqJ6FFT+ W06cabTCNdkmDAlV6XZqrL8o51U5QDPZ56F9sROdb1eg2LlcInTiNW53EVbQ1VBv1Vsk rEa/WnDg2PMiUOXtW9BNbMOHIsaG+2JbV5VKYyEGQ4s8+mzZYPkFnrunVzwIZSeMYlNG l/Tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741966202; x=1742571002; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WAe7Mq9PAoLxsqmL3ma6QJkF2PJXg5Q8DTTiDZQANqc=; b=ZzfKBYZkbrSW8gOekoR+GMF5eK+XYf7YXCAmdfq8MADfki9oq4ywnQhjfkVJfA9BLq AcvfJOOvZHHMXDtwCsb0AgBog0ng/Z9E22SNC5RK67hsZhz2wOEsU1w1ry4prDIFWdPw EYhsjdyqNSHXsN4XFjlv3OfNN7R6LZeBc4yBnquDsqhkaBmUc4XDDwstqToGEdB/U0hS iU68AyMIcYLU++fmEMD9e+FkRYEogt35Q+yUpkrQU9TTECvMwIKyIxBCjf+xv5HQAT2c c+vsahR3FFp343X9z0s7RZxUcX9n/uwuxGl/c02qgNmAlSSmLWd6C0+Z+IjhsbP4HiEl iO6w== X-Forwarded-Encrypted: i=1; AJvYcCV09OGMuzKyawlFNqdDHSlrnawFSMcLZPWL3eONI5dofi5Mj6w9ryk5NEvw3on7pqxz3m4YnO4bmHTIge0=@vger.kernel.org X-Gm-Message-State: AOJu0Yz/zXRR3gpcg9tav49HxnRNvc9/msucBCZIlU0mCzhfJGZhTqs9 kaJ67ano1xVHj+l4TUnQAQKq121+VJUC3V1R5D5qNu98zo1oFCwDlQw6wL9wsGE= X-Gm-Gg: ASbGncuHILsTH82XxavYSnkqfYS20+gWau232t7opjoM2Lh49KFFiBuWThM6hvXwNLb gEfjwwJRBqB6Lb7HF9j+2FOL7ufa/ENFH4E32B9BQ0cL7/Brjo5huhRCmPHl1HirG2d+J1DckPx qQVTIag4kn2LwaDdzl64NqBRP8Pxc+W9LFGPZVf87bkVvZPCZSuoGynewp1G/C7rRgg2sp+Uelo wK1xrwCN9crl7QYCT513XCWx/odpjctaAt1EWdOUDm+fJFQlkw1Arpjdcqdn7kF4loCMFYjN+JM fWP0GXqpZOG9r1236tkTDj3P27wlHWJ+AsCDHqSfu+UlFiRjIvoX2qg1gGAVMcFc+X43 X-Google-Smtp-Source: AGHT+IHgMHyFZg83gyxkscaVVuzrEiCvVQb0cElVQ6Sj6WCyMl+WLpiWNxs1mRZkFu8V2UVDyshoTA== X-Received: by 2002:a2e:860f:0:b0:30b:e3d9:37e5 with SMTP id 38308e7fff4ca-30c4a861b95mr9020241fa.13.1741966201847; Fri, 14 Mar 2025 08:30:01 -0700 (PDT) Received: from skhimich.dev.yadro.com (avpn02.yadro.com. [89.207.88.245]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-30c3f0e99f6sm6253581fa.37.2025.03.14.08.30.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Mar 2025 08:30:01 -0700 (PDT) From: Sergey Khimich To: linux-media@vger.kernel.org Cc: Philipp Zabel , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Vladimir Yakovlev , Maksim Turok Subject: [PATCH 11/18] media: coda: Print size of encoded buff in other place Date: Fri, 14 Mar 2025 18:29:32 +0300 Message-Id: <20250314152939.2759573-12-serghox@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20250314152939.2759573-1-serghox@gmail.com> References: <20250314152939.2759573-1-serghox@gmail.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Vladimir Yakovlev Print debug log containing size of encoded buff along with other info of encoded buffer. This improves readability of the log. Co-developed-by: Sergey Khimich Signed-off-by: Sergey Khimich Signed-off-by: Vladimir Yakovlev --- drivers/media/platform/chips-media/coda/coda-bit.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/chips-media/coda/coda-bit.c b/drivers/media/platform/chips-media/coda/coda-bit.c index 05d62c7bc692..c323bc96b998 100644 --- a/drivers/media/platform/chips-media/coda/coda-bit.c +++ b/drivers/media/platform/chips-media/coda/coda-bit.c @@ -1665,7 +1665,6 @@ static void coda_finish_encode(struct coda_ctx *ctx) vb2_set_plane_payload(&dst_buf->vb2_buf, 0, wr_ptr - start_ptr); } - coda_dbg(1, ctx, "frame size = %u\n", wr_ptr - start_ptr); coda_read(dev, CODA_RET_ENC_PIC_SLICE_NUM); val = coda_read(dev, CODA_RET_ENC_PIC_FLAG); @@ -1696,9 +1695,9 @@ static void coda_finish_encode(struct coda_ctx *ctx) if (ctx->gopcounter < 0) ctx->gopcounter = ctx->params.gop_size - 1; - coda_dbg(1, ctx, "job finished: encoded %c frame (%d)%s\n", + coda_dbg(1, ctx, "job finished: encoded %c frame (%d)%s size=%d\n", coda_frame_type_char(dst_buf->flags), dst_buf->sequence, - (dst_buf->flags & V4L2_BUF_FLAG_LAST) ? " (last)" : ""); + (dst_buf->flags & V4L2_BUF_FLAG_LAST) ? " (last)" : "", wr_ptr - start_ptr); } static void coda_seq_end_work(struct work_struct *work) From patchwork Fri Mar 14 15:29:34 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Khimich X-Patchwork-Id: 874602 Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com [209.85.208.174]) (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 01384205509; Fri, 14 Mar 2025 15:30:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741966210; cv=none; b=mySMOa+MdYPdXxXJD/neP6/p0lLtBfRl+qSFzxDZSyb3nyzJWU2WaX7RH6oQwFWrz/CPsXVucnRFkFvNT35pE1hRJfa6vmNwcd3B+76OMMG9xwH7sW8w/g/Fnn9NhHBeIcssNezPXKtILCY8HdXdjCuqEuVKLArf24hLPM/o4A8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741966210; c=relaxed/simple; bh=IYw8bQmY0zhIJDGNiGACVKHm0UdYuajycgMpjcWVlR8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ELJt5Mgcdyn+KNtH1v4T11UyjZZNJgRZsJ3sTPxTetNitXHshvjqgiiepqcQJHcQgGppFMK0fqfnikEXWGiXn0gPEBOxuSLDp4f6pjlXHv380RHxUguAI15imyyY41UkD4XXmElt5xFAWiWsvobl3ebUoxB6wgSDYCh1+hRK08s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ZMoqIfE+; arc=none smtp.client-ip=209.85.208.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZMoqIfE+" Received: by mail-lj1-f174.google.com with SMTP id 38308e7fff4ca-30761be8fa8so24261741fa.2; Fri, 14 Mar 2025 08:30:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741966206; x=1742571006; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=DqgNTYoxC0fFFzF4qZiqTPN5SVQGUZ+pgTF4nitLk24=; b=ZMoqIfE+1KpCr45/qvoyR7EZePoXcHnaJGlG/cst9P/JDOVZxSvRWVibYsaGhUTWsx 4z89+c5JIAveikCK+lcQwCFk8MqhRSvGyKloJMNBRGCq0wk6RuOetnYATHvZ07uKfKId mlIsENhSKAoBxPtBFKi/jwAIe+/OUfaz8YDSnRj0iOqFPnvYCq2e3uKxu1F604oHNw+A llxZMr0FBR2MzQQzoGUFcPeYVni9TWJGIU2mFu9L8wSPE1Uk1WUJIB4NLP3Op9BX33Jc yxtPdQJZXmTrl50U6YwM3133vACIHmT9oV3AcTRvJxldrLGXDKZXMxSRfx9FZof72vMr pWew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741966206; x=1742571006; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DqgNTYoxC0fFFzF4qZiqTPN5SVQGUZ+pgTF4nitLk24=; b=H8s688weozZNhnFXGD+JO2YtymZUWM94nzrcZ1IBPT/3/DVT/uTr1iKRNLhaDR0R43 H7Pwc/9duzbdZNuFX9mnmloen2t+O6+FLDH4NwrSx/20wDnggpedT0wK3wLeEAFsSJaM kd1/hbuePCCkmTmn0DUyQIkT7dzpP81AfB+nHWLB16mD6VYG34F+41Xub7qg5SQ8WQOf XhZ6h8A6Vo1+6fYhdf3I/Vn7Jy/4JAiaxk4BgHjWhOi6pyF06qXC/azjLkrZ2TudYD75 RPOn/28eXjJG1PuyjiSzjcclwt8QyX2Qnbk5KXZBoTy7ziTPzhTsqYOhBicUt88iqlke 07DA== X-Forwarded-Encrypted: i=1; AJvYcCUK+9mltXqsIGh2P8z7e7cu9NbE904WRhroq4BkEZR1+DVNQ1zm9p2veL/sxDwOYZ7o3EoYXfNlpvLUm3o=@vger.kernel.org X-Gm-Message-State: AOJu0YwK7Er2GOK1KX5ACBCg7iakCCNU81AhYXoi8d50skV/MnzE4krE 4H9n6jAbucAmOqut8Sf04eAynqm9gHlM6iabJ74gUe+8di3i5pvpqTMzajQa+Rw= X-Gm-Gg: ASbGncsIUapqhy1kCsKjaXFmPPNVpWSuNNNdfeiZ+AV1Ey27ToVoBJt2Xi2ZCIL4LZb aDfYyuPNQ8BKog0bihOh/rtGgfvBI8kf0H3cbrZZgWpqrJM5j1AvXTE8LHAiriSVtOT+cgNuwLJ z6Lt94aNZ1DL9uiPWMTDtdco8o3kzoz1JVESPt1QBjIG+FWPFOh1OJCBGZBRyp0NdVZ4+30oCyQ 6anaHpY7rKFWQJWPr3DtiIruwQI4YlPXpq2fVydFoSuHTNrojPUuLrVcrCnWP9p5TgD0B5njCWK K0DKgPQBj4moIOvogQI0XmyxxgbLON1kU80UmLxoJ1bhaofmBPPD6hB+0P46XEG19s4h X-Google-Smtp-Source: AGHT+IFkDKyABkKs01BMWlaO0zX3qY3/V3ioYwTNprK0FuL0fAgXrS0KkPQvm/KLdUlZXideJA8RlA== X-Received: by 2002:a05:651c:b22:b0:30b:fe19:b07a with SMTP id 38308e7fff4ca-30c4a8cea76mr10216971fa.25.1741966206282; Fri, 14 Mar 2025 08:30:06 -0700 (PDT) Received: from skhimich.dev.yadro.com (avpn02.yadro.com. [89.207.88.245]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-30c3f0e99f6sm6253581fa.37.2025.03.14.08.30.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Mar 2025 08:30:05 -0700 (PDT) From: Sergey Khimich To: linux-media@vger.kernel.org Cc: Philipp Zabel , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Vladimir Yakovlev , Maksim Turok Subject: [PATCH 13/18] media: coda: Fix support for all mpeg4 levels Date: Fri, 14 Mar 2025 18:29:34 +0300 Message-Id: <20250314152939.2759573-14-serghox@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20250314152939.2759573-1-serghox@gmail.com> References: <20250314152939.2759573-1-serghox@gmail.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Vladimir Yakovlev Mpeg-4 level also depends on img resolution. Therefore, driver must support all levels in the range of supported resolutions. Coda's hw can calculate level automatically. Co-developed-by: Sergey Khimich Signed-off-by: Sergey Khimich Signed-off-by: Vladimir Yakovlev --- drivers/media/platform/chips-media/coda/coda-common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/chips-media/coda/coda-common.c b/drivers/media/platform/chips-media/coda/coda-common.c index 555b73816952..29b01ade8829 100644 --- a/drivers/media/platform/chips-media/coda/coda-common.c +++ b/drivers/media/platform/chips-media/coda/coda-common.c @@ -2383,7 +2383,7 @@ static void coda_encode_ctrls(struct coda_ctx *ctx) v4l2_ctrl_new_std_menu(&ctx->ctrls, &coda_ctrl_ops, V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL, V4L2_MPEG_VIDEO_MPEG4_LEVEL_5, - ~(1 << V4L2_MPEG_VIDEO_MPEG4_LEVEL_5), + 0, V4L2_MPEG_VIDEO_MPEG4_LEVEL_5); } v4l2_ctrl_new_std_menu(&ctx->ctrls, &coda_ctrl_ops, From patchwork Fri Mar 14 15:29:36 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Khimich X-Patchwork-Id: 874601 Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com [209.85.208.173]) (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 17DC7205AC7; Fri, 14 Mar 2025 15:30:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741966214; cv=none; b=MWenkWnTJ302B+hxVeKj/aVyXY0l3ViFPapNMt0UMILQ4a2anqKR6sCIw71srK+dgQy1YH6AHDpV5pXzazv3EpaNLnDtf2iH95r4IhsIgeCAAtLyjrrZ88jY6y9HZkKvQt0iSgfONvuQDJ0UGQzT03yA4CyICVLyz82a9E2kQTE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741966214; c=relaxed/simple; bh=HBais1f2vz4kMRf/cldht6E+mcty9TdtSZxdPWoqcfs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=cyHPxFfPrPY1Sx8A1JNN2u/GfU0f8AMFrykTa8RYZLrwLoo/1eigUEPtji41zaMc5HhCxxDSOseoLw/NqzmLjz6OTo/UyxZ3RDDEWbgInzKYmSUyY2c6/o3JJbw2ADbBrl1JLSpjco1jysI9ZofP1kL2KlLmVc3kdT/wMzRCIm8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=I2BDEDFU; arc=none smtp.client-ip=209.85.208.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="I2BDEDFU" Received: by mail-lj1-f173.google.com with SMTP id 38308e7fff4ca-30762598511so23188721fa.0; Fri, 14 Mar 2025 08:30:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741966211; x=1742571011; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=uwwz1u8FJDnJhqE7LdfxAKBgdcZ4z4VuuYDXy4Qw3lk=; b=I2BDEDFUroHrDr9hl0hUaMh1yORGflu1T38vEaJXt0S3KUvVkH+ra+auXtd0Km2Egf ouj+X4+daPfyZ14LJb1aG56cJPWqoplk3NwmHym9xu+cmYNAGKGAUWK25Du4WBt1DhFz 26xeWr4VHq8aANO/RetvU635ENhbAZ/UGPrhZv3WKur8UQDliCNzQMGmoEvJFyaWPe5n tE3z6CrmSCTgJZvpy0zvJyNjrlBheHkk6miCWxB/05fed4VPqPXgDP6F5usPvO0oJ6bB AeCJXUJHJMXNI5meEba1bLjs+hfD+GnoUGxmbYiUsSOhkB8Kbkz/X0vmixUBypNjfWF+ Tb2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741966211; x=1742571011; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uwwz1u8FJDnJhqE7LdfxAKBgdcZ4z4VuuYDXy4Qw3lk=; b=VFSgMm8WbqI+0ZttZEeoNmigs4UYKHHGxzxNjl26rUDSKXOjBCeHATBV2cARdHx9R2 +NtIP8dbqcXZPunyFguhnjHXzXw1Q6id5y56ypW5XuxoGQ1WIsyK3UkGmsQ6gDetS3Tv tzfFf5eA3qo/WBmfhXCrI/1QFEAlHkjI2MF4stFfvXzG2xUoK/BGfOFGeGAepUd9vbks Y+wQTaBFoTaQe9aIWvE6mcQZDT54rQp9dNCg5p321hLLBTuh5zUoNVs8QH/W61sVCeYW jc1ev03eYkc5VLkqxUO88IE3oMkZXPAdF2TYEM7nWn2IE7BsTgbodmM1YlSbSev1PSOg JIaA== X-Forwarded-Encrypted: i=1; AJvYcCVHMDDixpE2fCa0SvkKI5zsolKiwE5f1l8gEJ/rhnphrdrSzhoCrMub3mbtm/kYYh86+EMeZ7mBsIbvZZk=@vger.kernel.org X-Gm-Message-State: AOJu0YzmRRi3QumaifyQxBtReeKK0qX63RC0KekcYA/s08UQjra1hbcn jza11Kym/c2oORwMIztXSLKgycfxw+KcwqyRo1lHUNtTkrWY/a+IRiy5Ur/JwkQ= X-Gm-Gg: ASbGncu3XJMLZeoc7l8VSPMZfZaQz7L35i+BEpHBrGJzUZm9AMehNb7xZVhaNGjwVrB WSrjaAVySRD6bHhVSX0aK2bN35fppEeZhg36iS1HJr4YC9BKURig20Jkfh4vVmZ8FL+GrHTRpdH /sWso6BncG7wSsxq1sYtacbSt+xkvvBaP81cus9bG71iUU6+fZlFLJoIoAak0Esu+XAAMxYJAsk GVoLP2M4Edya2sgKXhTdm6KcRMniV4WIA5aCTWE4wL67nXFm4WbB3pwTa0EIJHo4B2uyPvkAInQ ym1NIRBtdE6BCHOkp2Jo9Dq5K/f29mb846YaRouPupXxpmg2FzS5f2KpQLZgNsYzTZWz X-Google-Smtp-Source: AGHT+IEhwe/I7cON1IM9+xq7BbkWIky5UqcKei97voBNkrPmSwIuzbNjKLzE12QptgVORsDRWur/vA== X-Received: by 2002:a2e:a781:0:b0:30b:a92c:7dd9 with SMTP id 38308e7fff4ca-30c4a875fd8mr9921781fa.17.1741966210634; Fri, 14 Mar 2025 08:30:10 -0700 (PDT) Received: from skhimich.dev.yadro.com (avpn02.yadro.com. [89.207.88.245]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-30c3f0e99f6sm6253581fa.37.2025.03.14.08.30.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Mar 2025 08:30:10 -0700 (PDT) From: Sergey Khimich To: linux-media@vger.kernel.org Cc: Philipp Zabel , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Vladimir Yakovlev , Maksim Turok Subject: [PATCH 15/18] media: coda: Use v4l2_ctrl to set gamma for h264enc Date: Fri, 14 Mar 2025 18:29:36 +0300 Message-Id: <20250314152939.2759573-16-serghox@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20250314152939.2759573-1-serghox@gmail.com> References: <20250314152939.2759573-1-serghox@gmail.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Vladimir Yakovlev We can use v4l2_ctrl (V4L2_CID_GAMMA) to set gamma for configuration h.264 encoder. Co-developed-by: Sergey Khimich Signed-off-by: Sergey Khimich Signed-off-by: Vladimir Yakovlev --- .../platform/chips-media/coda/coda-bit.c | 28 ++++++------------- .../platform/chips-media/coda/coda-common.c | 7 +++++ .../media/platform/chips-media/coda/coda.h | 4 +++ 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/drivers/media/platform/chips-media/coda/coda-bit.c b/drivers/media/platform/chips-media/coda/coda-bit.c index 50350d657f91..782b299e9b12 100644 --- a/drivers/media/platform/chips-media/coda/coda-bit.c +++ b/drivers/media/platform/chips-media/coda/coda-bit.c @@ -35,9 +35,6 @@ #define CODA7_PS_BUF_SIZE 0x28000 #define CODA9_PS_SAVE_SIZE (512 * 1024) -#define CODA_DEFAULT_GAMMA 4096 -#define CODA9_DEFAULT_GAMMA 24576 /* 0.75 * 32768 */ - static void coda_free_bitstream_buffer(struct coda_ctx *ctx); static inline int coda_is_initialized(struct coda_dev *dev) @@ -1065,7 +1062,7 @@ static int coda_start_encoding(struct coda_ctx *ctx) struct coda_q_data *q_data_src, *q_data_dst; u32 bitstream_buf, bitstream_size; struct vb2_v4l2_buffer *buf; - int gamma, ret, value; + int ret, value; u32 dst_fourcc; int num_fb; u32 stride; @@ -1251,13 +1248,14 @@ static int coda_start_encoding(struct coda_ctx *ctx) value = 0; - if (dev->devtype->product == CODA_960) - gamma = CODA9_DEFAULT_GAMMA; - else - gamma = CODA_DEFAULT_GAMMA; - if (gamma > 0) { - coda_write(dev, (gamma & CODA_GAMMA_MASK) << CODA_GAMMA_OFFSET, - CODA_CMD_ENC_SEQ_RC_GAMMA); + if (ctx->params.gamma > 0) { + if (dev->devtype->product == CODA_960) + value |= 1 << CODA9_OPTION_GAMMA_OFFSET; + else if (dev->devtype->product == CODA_DX6) + value |= 1 << CODADX6_OPTION_GAMMA_OFFSET; + else + value |= 1 << CODA7_OPTION_GAMMA_OFFSET; + coda_write(dev, ctx->params.gamma, CODA_CMD_ENC_SEQ_RC_GAMMA); } if (ctx->params.h264_min_qp || ctx->params.h264_max_qp) { @@ -1269,15 +1267,7 @@ static int coda_start_encoding(struct coda_ctx *ctx) if (dev->devtype->product == CODA_960) { if (ctx->params.h264_max_qp) value |= 1 << CODA9_OPTION_RCQPMAX_OFFSET; - if (CODA_DEFAULT_GAMMA > 0) - value |= 1 << CODA9_OPTION_GAMMA_OFFSET; } else { - if (CODA_DEFAULT_GAMMA > 0) { - if (dev->devtype->product == CODA_DX6) - value |= 1 << CODADX6_OPTION_GAMMA_OFFSET; - else - value |= 1 << CODA7_OPTION_GAMMA_OFFSET; - } if (ctx->params.h264_min_qp) value |= 1 << CODA7_OPTION_RCQPMIN_OFFSET; if (ctx->params.h264_max_qp) diff --git a/drivers/media/platform/chips-media/coda/coda-common.c b/drivers/media/platform/chips-media/coda/coda-common.c index 9b443ddabeab..9ca459793050 100644 --- a/drivers/media/platform/chips-media/coda/coda-common.c +++ b/drivers/media/platform/chips-media/coda/coda-common.c @@ -2205,6 +2205,9 @@ static int coda_s_ctrl(struct v4l2_ctrl *ctrl) ctx->params.bitrate = ctrl->val / 1000; ctx->params.bitrate_changed = true; break; + case V4L2_CID_GAMMA: + ctx->params.gamma = ctrl->val; + break; case V4L2_CID_MPEG_VIDEO_GOP_SIZE: ctx->params.gop_size = ctrl->val; break; @@ -2311,9 +2314,13 @@ static const struct v4l2_ctrl_ops coda_ctrl_ops = { static void coda_encode_ctrls(struct coda_ctx *ctx) { int max_gop_size = (ctx->dev->devtype->product == CODA_DX6) ? 60 : 99; + u32 def_gamma = (ctx->dev->devtype->product == CODA_960) ? + CODA9_DEFAULT_GAMMA : CODA_DEFAULT_GAMMA; v4l2_ctrl_new_std(&ctx->ctrls, &coda_ctrl_ops, V4L2_CID_MPEG_VIDEO_BITRATE, 0, 32767000, 1000, 0); + v4l2_ctrl_new_std(&ctx->ctrls, &coda_ctrl_ops, + V4L2_CID_GAMMA, 0, 0x7FFFFFFF, 1, def_gamma); v4l2_ctrl_new_std(&ctx->ctrls, &coda_ctrl_ops, V4L2_CID_MPEG_VIDEO_GOP_SIZE, 0, max_gop_size, 1, 16); v4l2_ctrl_new_std(&ctx->ctrls, &coda_ctrl_ops, diff --git a/drivers/media/platform/chips-media/coda/coda.h b/drivers/media/platform/chips-media/coda/coda.h index ddfd0a32c653..007f56b24c61 100644 --- a/drivers/media/platform/chips-media/coda/coda.h +++ b/drivers/media/platform/chips-media/coda/coda.h @@ -29,6 +29,9 @@ #define CODA_MAX_FRAMEBUFFERS 19 #define FMO_SLICE_SAVE_BUF_SIZE (32) +#define CODA_DEFAULT_GAMMA 4096 +#define CODA9_DEFAULT_GAMMA 24576 /* 0.75 * 32768 */ + /* * This control allows applications to read the per-stream * (i.e. per-context) Macroblocks Error Count. This value @@ -150,6 +153,7 @@ struct coda_params { u32 vbv_size; u32 slice_max_bits; u32 slice_max_mb; + u32 gamma; bool force_ipicture; bool gop_size_changed; bool bitrate_changed; From patchwork Fri Mar 14 15:29:38 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Khimich X-Patchwork-Id: 874600 Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com [209.85.208.170]) (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 43C112063C9; Fri, 14 Mar 2025 15:30:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741966218; cv=none; b=uDQNhApkBWOHrwtppi/5atE3Raj3tXsx9tfISa8nqYjMApw+0AEaEtBvAwXzJZ77aZmGimqxnZWLFhNWQguqVO+DT3kQ2wAZYg7CqAUE+2MTeuA2hDVdT4DnWIXaUeClQmzLXMAyTaLRZeemjmbxiEzbxXPan9xYWezKvxdH3nI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741966218; c=relaxed/simple; bh=5N2u8G6nb3cU5p7Tgm2pr0o+VlSCPNUWeJNIpV8hJ1Q=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ExZAJNcsJQ4fAIBszwdKEGf3M+AV6Ioc3ZipyXsL8hOywrDx+/ewYfba8Jim73RA9HoijQA6nH/OIDNZ86izdOWdvl/vOQIKxbjLePYOtS4dl8vxhtBY3W36wbCbVXIb1f/Cy/P1D0cOnSaH+/CtHNkI2pwEkREli1tRRzVTMao= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=KCKUOGSB; arc=none smtp.client-ip=209.85.208.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KCKUOGSB" Received: by mail-lj1-f170.google.com with SMTP id 38308e7fff4ca-30bae572157so22728581fa.3; Fri, 14 Mar 2025 08:30:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1741966213; x=1742571013; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=bNpMyAE2KOtdYpDUOPGQQ6FLlEA9+rQvOWYfiYfH2DM=; b=KCKUOGSB9c8IBiXWr4yDW8VIam7LQBUkfLOjvKJU02KgHCDV63yue2NxR/9DrUSSjz fWVlsU6Ao3Kb1EZ4kXJfUyFiAIbAyFebzu2TTdMQi7TZHstI5z1E+dLW33KJ48CD5eLM CTx2294z/3VlpwuXH0OMmCZOyBgS+de1X7yN9poKsGL/LrDMzqMC0GtpbpiWtFo8fCqL LhH4KNL8uQQsWhUe4xki3TX49sG5WJ+Vq16gXjUHGRYsSidiBuBp/glAuUZ5K4ksCQsK m///6XJRzDqLgyMLW4u8nOzXL8IfKL+t3/b3OSa6IPC1bmTKMmcgu4waR28WtugoAwi7 GCjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1741966213; x=1742571013; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bNpMyAE2KOtdYpDUOPGQQ6FLlEA9+rQvOWYfiYfH2DM=; b=ktMTtRe4FyjW7Iw5QqfvZtqtq9klOid9tk1qsUquhJ9giwrcS8agd3wsNRnm6MhWmK x+hgUxNYGtB2XroN4gaZfLB/18zHvPZdrXx9zxoXXlAV5+O2hAvmmsVEqBr2TcIKFFad gG3PnBLVHbSEUbHv60gQDatJqgPBfJp43rQ5UCyKH+cu15UqPo0kRO8mf8ROktdBIOi9 fidk3paUhQok0zlyaXQVn5zSdW4XVfV+UgxV9nPNy3GJTMl3M7wfmKZX/zqqLgl4Qd0V lJqe/MGnDwgKPiTgdCmT5Iw8wOps8iti8zwD2vdsvfCqx+b7mAzS4vetBJa6nUg2KLmd 2HoA== X-Forwarded-Encrypted: i=1; AJvYcCX3h0XiG64MJLML40NbXqAasQAZF+IH24P4qkKCcXhGNZCFLMteulc6LKafz5wi4O1HtoOKQeOYf9TRLWI=@vger.kernel.org X-Gm-Message-State: AOJu0YyLsM9QFgMq+m+BSMQ59Z8hJmlVBuGg54NTGacTgLA+jCcyPXTL RwKyMdjsfxt3k2Q+I5AaGJSdkj2hTWFu4XRYLXHJJko9AVzQutlFcTxJ+QY38aw= X-Gm-Gg: ASbGncuoAWl02fm+EUU4onP1KtaH77a8Hm0R3H8xoySQTC/5jaj8S9mTDQ4+Rvx6iX+ 4ckcVWQROaesDOYzbHfwEcC0uR4jaPOewV4RqkIAiHjHvfvkkJEQd+KnO2GC6vhmWk+3rjD88PM Lihwoiw+DsXmoGywBiBHR2vzBRk3U9AYceUZiImxdoKruibWe1WJkIrOZ9Aifv6OMPkMDFoZMp/ NW1tsN39AiQSWF/IP0OtvWhJUuL+4daM4q3dqCOxtt+fpvtg9xxmVA7KKvGpGco0YS7u78hkJlw fvuioPbbg4tMneoHePGL7KYJcbOlo8f6GFBjYI9W62iMGnnmwbIvxt+gF5MA27H8bFW4 X-Google-Smtp-Source: AGHT+IHFPlWpJwPb3KXLidiQ6UDzni1mwX2TdcWkQTVFuYE2n9zkAzmgPnikFA3MjhpzFumWLUq0Ig== X-Received: by 2002:a2e:be27:0:b0:30c:177c:9e64 with SMTP id 38308e7fff4ca-30c4a8d975fmr12410391fa.35.1741966212759; Fri, 14 Mar 2025 08:30:12 -0700 (PDT) Received: from skhimich.dev.yadro.com (avpn02.yadro.com. [89.207.88.245]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-30c3f0e99f6sm6253581fa.37.2025.03.14.08.30.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Mar 2025 08:30:12 -0700 (PDT) From: Sergey Khimich To: linux-media@vger.kernel.org Cc: Philipp Zabel , Mauro Carvalho Chehab , linux-kernel@vger.kernel.org, Vladimir Yakovlev , Maksim Turok Subject: [PATCH 17/18] media: coda: Use preferred usleep_range than udelay Date: Fri, 14 Mar 2025 18:29:38 +0300 Message-Id: <20250314152939.2759573-18-serghox@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20250314152939.2759573-1-serghox@gmail.com> References: <20250314152939.2759573-1-serghox@gmail.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Vladimir Yakovlev usleep_range is preferred over udelay. see Documentation/timers/timers-howto.rst Co-developed-by: Sergey Khimich Signed-off-by: Sergey Khimich Signed-off-by: Vladimir Yakovlev --- drivers/media/platform/chips-media/coda/coda-common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/chips-media/coda/coda-common.c b/drivers/media/platform/chips-media/coda/coda-common.c index 3782219c8a2b..b73b09b3baf9 100644 --- a/drivers/media/platform/chips-media/coda/coda-common.c +++ b/drivers/media/platform/chips-media/coda/coda-common.c @@ -2873,7 +2873,7 @@ static int coda_hw_init(struct coda_dev *dev) data = coda_read(dev, CODA_REG_BIT_CODE_RESET); data |= CODA_REG_RESET_ENABLE; coda_write(dev, data, CODA_REG_BIT_CODE_RESET); - udelay(10); + usleep_range(10, 20); data &= ~CODA_REG_RESET_ENABLE; coda_write(dev, data, CODA_REG_BIT_CODE_RESET); coda_write(dev, CODA_REG_RUN_ENABLE, CODA_REG_BIT_CODE_RUN);