Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp4667554ybc; Fri, 15 Nov 2019 08:12:47 -0800 (PST) X-Google-Smtp-Source: APXvYqyFO7n12nCmrumVVHGH2Rl4KMu9TcEYAkKYtes46l4p097ZzjqKS2v34VAttODou+H4LdFS X-Received: by 2002:a2e:7a07:: with SMTP id v7mr12089610ljc.208.1573834367119; Fri, 15 Nov 2019 08:12:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573834367; cv=none; d=google.com; s=arc-20160816; b=BuXZ4ogJoVR1NOFf3ncY1y7io1ZfAnr8b/oN8oM09YVvTsW+neIWAD4bRLzSYcNLY1 daZlKD1Juai4Mq20MdC6j8C+qIgIU30dgUDvrY41hmo4Jao+s5VbC+L4EKt8XoczvJ8l p9ICQ76g8Ck+1lOSYQiZP7BBdgPqc4XL73SdArSZfFnuBQJuiATPe6jNiwgteUY0DYZb 4p21mdnDGVEgVcLsOrwl8kZcwgEooIt9XYJ5g4TgOstB4tIneJTK9n/zgBegQxS+Wos5 bTE9qk/0QNw1tcEh/dQVBYVjKA/T/3nXqGuYFcjd8RP2+8MocgG6akYa+FMFtFYJoYPC neNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=3WZfjksL+ztzJ7r2w36rI9Y7wvDETjN5QmOdpzQj060=; b=E5lv41xt/QqEqG4LhATNwqs4r13mpYsn+7rXs10sjXg1L8B9mm63dkyZOiYOO/sLJl zTrFdjP9K5e+ChnfELavN64QjByFpdP5nWFJOgyBVjTrXwdrGMmm+y7HqPBRQHTYWMs4 Ks8r8jcA1Enc7wN+b9FEoaPce5lDdngfQbvZhdpm0o8fRy6HdX1maq1I9Vc8xIXMgJSU GILTXpf2inMlmKCl/yl3pYamA2dj1/85aTQ64HuSAxBsW7vqbPiQLlZB4iWHWnu5J2k4 PM5WrFVkgSlAz5h7nea/oUYRBf2GsLopDhatANQWZyN4DMLNxU7a9M6X+6F2993GhymT MPXw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o16si7175733edi.158.2019.11.15.08.12.21; Fri, 15 Nov 2019 08:12:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727632AbfKOQLG (ORCPT + 99 others); Fri, 15 Nov 2019 11:11:06 -0500 Received: from metis.ext.pengutronix.de ([85.220.165.71]:40719 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727520AbfKOQLF (ORCPT ); Fri, 15 Nov 2019 11:11:05 -0500 Received: from lupine.hi.pengutronix.de ([2001:67c:670:100:3ad5:47ff:feaf:1a17] helo=lupine) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1iVeBZ-0002s0-2g; Fri, 15 Nov 2019 17:11:01 +0100 Message-ID: <272dedf2cc25053475e9536b446b434f4754f62c.camel@pengutronix.de> Subject: Re: [PATCH v3 2/3] media: hantro: Support color conversion via post-processing From: Philipp Zabel To: Ezequiel Garcia , linux-media@vger.kernel.org Cc: kernel@collabora.com, Tomasz Figa , linux-rockchip@lists.infradead.org, Heiko Stuebner , Jonas Karlman , Boris Brezillon , Chris Healy , linux-kernel@vger.kernel.org Date: Fri, 15 Nov 2019 17:10:59 +0100 In-Reply-To: References: <20191113175603.24742-1-ezequiel@collabora.com> <20191113175603.24742-3-ezequiel@collabora.com> <1e1c7a0e3d25187723ccac1a8360b5aae9aed8cd.camel@pengutronix.de> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5-1.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2001:67c:670:100:3ad5:47ff:feaf:1a17 X-SA-Exim-Mail-From: p.zabel@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Ezequiel, On Fri, 2019-11-15 at 12:44 -0300, Ezequiel Garcia wrote: > Hello Philipp, > > Thanks for reviewing. > > On Thu, 2019-11-14 at 10:48 +0100, Philipp Zabel wrote: [...] > > Why isn't PP enabled in prepare_run? Does this mean the first frame is > > not post-processed? > > > > No, because hantro_finish_run is called (despite its name) > before the decoding operation is actually triggered. > > I guess this hantro_finish_run name adds some confusion: > prepare_run and finish_run should be something along > start_prepare_run, end_prepare_run. Ah, ok then. I was confused because I just came from looking at coda-vpu code, where finish_run is a callback called after the device has finished processing. Maybe I should rename that as well. > And also, perhaps disabling the post-processor in prepare_run > works just fine. I need to check that. Ok. [...] > > > +#define HANTRO_PP_REG_WRITE_S(vpu, reg_name, val) \ > > > + do { \ > > > + if ((vpu)->variant->postproc_regs->(reg_name).base) \ > > > + hantro_reg_write((vpu), \ > > > + &(vpu)->variant->postproc_regs->(reg_name), \ > > > + (val)); \ > > > + } while (0) > > > > Why all these checks, are any of the register fields optional? > > > > That was the plan. Perhaps now it makes less sense, > but maybe it's safer this way, if it's extended? > > OTOH, we might want to make sure the driver fails (or warns). I think that would be better than silently ignoring them. Although I don't quite see the point in repeatedly checking the presence of mandatory register fields at runtime. regards Philipp