Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp5092694ybe; Tue, 17 Sep 2019 02:27:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqzD2a4doak1Q7a5Q/5WeuJiOaoGDlgR5h6kbANYYagEWLd60mj1XK9eX7YXf74AQ7AOkxB/ X-Received: by 2002:aa7:d2c4:: with SMTP id k4mr3437437edr.169.1568712451548; Tue, 17 Sep 2019 02:27:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568712451; cv=none; d=google.com; s=arc-20160816; b=KFfNJ4yBogjYsb743cfYtYHB1b/e10KwpEQgZBlZZjQAOouJB3LzCHYi0cPQ4U869Q iQE+/SpHHk2TrGk7fEu2lR74o0k7yDLGrWb6nfGtjB1TFUR+tENbBdfNwSPGzXBkjVyJ +mUKPLupUpXY8cAuxHL8OyneH1D6jbZy7+X6U6mHKAwYPTljBT9X+20Cyk7L2UWYzz9W YAcmQL6k0QQd1iX9QqcFt73OKoGuBwafizstB130hH+GsZzLjQJ2bdn65Ld8JhtqAH1s 4vFDDes71DHcXrwWkxjyojccDsaert7iet4cPg2FHsK8raPZFKIVRrThGGo7rQ3qHfN9 BYzA== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=2Wl6obJ2QcdqwebrUsBa63QXWC5RCUfFV7IoOn2Y6ks=; b=wUu45pI7mdLASqZrsGI0lGvJtx4AbnDuvenTHdnDE85/7p6px7nlNrWdKxXQUAxkl4 5013GOH4fgTGkYrttSZTha4h7orzQP9iIIcAFDpXy1rcVP2IcBptMJdCHdPfHti2vLoG IvXQnNyrvXK4xNPMGaZFMurSmJbLsZBjJ6ISYF3o3Qv3CPenSaZwXTT8sDeot5FHOME6 H0F0LS1iOOaZipFUN2LFZH1Th+ridYd0wrXqd0XWCzRgxbtiPf9XwN4Qc7IR9z1rqz9z GG3KODSXC4EOhHoV2gGc8m+wvPUVuVJP5KYt5KMytHOnsvWe1hgMnZClO6vdVHW5TWXj yyMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=AVIBQ75F; 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 q1si1029041edj.354.2019.09.17.02.27.08; Tue, 17 Sep 2019 02:27:31 -0700 (PDT) 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; dkim=pass header.i=@linuxfoundation.org header.s=google header.b=AVIBQ75F; 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 S2391981AbfIQCmn (ORCPT + 99 others); Mon, 16 Sep 2019 22:42:43 -0400 Received: from mail-io1-f67.google.com ([209.85.166.67]:35592 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729003AbfIQCmm (ORCPT ); Mon, 16 Sep 2019 22:42:42 -0400 Received: by mail-io1-f67.google.com with SMTP id q10so4004769iop.2 for ; Mon, 16 Sep 2019 19:42:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=2Wl6obJ2QcdqwebrUsBa63QXWC5RCUfFV7IoOn2Y6ks=; b=AVIBQ75Fe0Muk7Kro+HRBd9acd/TcmFSpKrAm21T7nRalgmecRgqOV098heI5zDGM3 dgnI3auvF0WjVYo0AF4/fojMIKm9+vJmCOFuPEkUojCxQnCXRtzPQ4f3GObDsqtAioMy /WBKTY7tLL7CY5KMwQpOsRaQdPBN+RXxAuvlw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=2Wl6obJ2QcdqwebrUsBa63QXWC5RCUfFV7IoOn2Y6ks=; b=qlo/ZLv7ecbzljMzeOeS0E12RjdXg+83OzjPygaDmqETrMqVxYgBwtCVm3IHpDa+zZ vorsYin99c9j1B+cXycnagauGzcocx0PpFYnWXH+EphGTI9GMha/v5rlmHJtN9UsZZu9 4yaxWrwvz0rKHWD9eeGzBDejlEhgd83hmhePkncNgqP7hHxHcxnVc2xj9Wu/3OaeQZea wRkPoHH6bC1TY/TCqzK51OWwnNd/fctoCLZYKCfGTjT3lRDt+jZlj+2EUF1eUc+J6L5R 6n4GKqT3IObT+LS43FnKNeBL86+E1WB4qqpBhWAIVx7fUrKt+kyC3gIzD8GP12dlUsAD SUAw== X-Gm-Message-State: APjAAAVWqxAwl/aAapSyLXmPsmpN3+PJgyNgP6yYnlNJ/9SYMI6fwych gamAryBMhAG0FdIBBOEid1Ut2A== X-Received: by 2002:a6b:9107:: with SMTP id t7mr900685iod.150.1568688161845; Mon, 16 Sep 2019 19:42:41 -0700 (PDT) Received: from [192.168.1.112] (c-24-9-64-241.hsd1.co.comcast.net. [24.9.64.241]) by smtp.gmail.com with ESMTPSA id v13sm457996iot.50.2019.09.16.19.42.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Sep 2019 19:42:41 -0700 (PDT) Subject: Re: [PATCH v4 3/5] vimc: move duplicated IS_SRC and IS_SINK to common header To: Helen Koike , mchehab@kernel.org, andrealmeid@collabora.com, dafna.hirschfeld@collabora.com, hverkuil-cisco@xs4all.nl Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Shuah Khan References: <8dbc93c2a7291d942d2d37491833444d77316211.1567822793.git.skhan@linuxfoundation.org> <124fe9af-5540-770e-d124-99e2b3b4e39a@linuxfoundation.org> <431c6d0a-724b-1b78-685c-95bfa8f5c39e@collabora.com> From: Shuah Khan Message-ID: Date: Mon, 16 Sep 2019 20:42:40 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <431c6d0a-724b-1b78-685c-95bfa8f5c39e@collabora.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/16/19 4:42 AM, Helen Koike wrote: > > > On 9/15/19 8:52 PM, Shuah Khan wrote: >> On 9/15/19 1:25 PM, Helen Koike wrote: >>> Hi Shuah, >>> >>> On 9/6/19 11:42 PM, Shuah Khan wrote: >>>> Move duplicated IS_SRC and IS_SINK dfines to common header. Rename >>>> them to VIMC_IS_SRC and VIM_IS_SINK. >>>> >>>> Signed-off-by: Shuah Khan >>>> --- >>>>   drivers/media/platform/vimc/vimc-common.h  |  4 ++++ >>>>   drivers/media/platform/vimc/vimc-debayer.c | 11 ++++------- >>>>   drivers/media/platform/vimc/vimc-scaler.c  |  8 +++----- >>>>   3 files changed, 11 insertions(+), 12 deletions(-) >>>> >>>> diff --git a/drivers/media/platform/vimc/vimc-common.h b/drivers/media/platform/vimc/vimc-common.h >>>> index 87ee84f78322..236412ad7548 100644 >>>> --- a/drivers/media/platform/vimc/vimc-common.h >>>> +++ b/drivers/media/platform/vimc/vimc-common.h >>>> @@ -27,6 +27,10 @@ >>>>     #define VIMC_FRAME_INDEX(lin, col, width, bpp) ((lin * width + col) * bpp) >>>>   +/* Source and sink pad checks */ >>>> +#define VIMC_IS_SRC(pad)    (pad) >>>> +#define VIMC_IS_SINK(pad)    (!(pad)) >>> >>> This is true now, but it might not be true in the future. >>> In the output video device (that was sent by André but not yet upstream) for instance, only have a single >>> source pad (which I suppose the index will be 0), and this macro won't be true. >>> >> >>> Maybe we could check pad flags in sd->entity->pads[index].flags ? >>> >> >> I think this change should be done in André's patch? > > Could be yes, making it generic since the start would be nice, > but I don't mind updating this latter when needed. Let's go with that then. This way we can get this series in and then we can clean this up in André's patch. > > Then: > > Acked-by: Helen Koike > >> thanks, -- Shuah