All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Esaki Tomohito <etom@igel.co.jp>
Cc: "David Airlie" <airlied@linux.ie>,
	nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	"Michel Dänzer" <mdaenzer@redhat.com>,
	"Daniel Stone" <daniel@fooishbar.org>,
	"Lee Jones" <lee.jones@linaro.org>,
	"Rob Clark" <robdclark@chromium.org>,
	"Takanari Hayama" <taki@igel.co.jp>,
	amd-gfx@lists.freedesktop.org, "Ben Skeggs" <bskeggs@redhat.com>,
	"Petr Mladek" <pmladek@suse.com>,
	"Sakari Ailus" <sakari.ailus@linux.intel.com>,
	"Bas Nieuwenhuizen" <bas@basnieuwenhuizen.nl>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Abhinav Kumar" <abhinavk@codeaurora.org>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Sean Paul" <seanpaul@chromium.org>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"Evan Quan" <evan.quan@amd.com>,
	"Mark Yacoub" <markyacoub@chromium.org>,
	"Qingqing Zhuo" <qingqing.zhuo@amd.com>,
	"Pan, Xinhui" <Xinhui.Pan@amd.com>,
	linux-kernel@vger.kernel.org,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"Simon Ser" <contact@emersion.fr>,
	"Dmitry Baryshkov" <dmitry.baryshkov@linaro.org>,
	"Damian Hobson-Garcia" <dhobsong@igel.co.jp>,
	"Christian König" <christian.koenig@amd.com>,
	"Laurent Pinchart" <laurent.pinchart@ideasonboard.com>
Subject: Re: [RFC PATCH v3 2/3] drm: add support modifiers for drivers whose planes only support linear layout
Date: Tue, 18 Jan 2022 11:53:34 +0200	[thread overview]
Message-ID: <YeaOHqfTcf+evbVC@smile.fi.intel.com> (raw)
In-Reply-To: <0cf405a1-0d2d-ed5e-abdf-be645e7a9209@igel.co.jp>

On Mon, Jan 17, 2022 at 02:15:48PM +0900, Esaki Tomohito wrote:
> On 2022/01/14 23:16, Andy Shevchenko wrote:
> > On Fri, Jan 14, 2022 at 07:17:52PM +0900, Tomohito Esaki wrote:
> > > The LINEAR modifier is advertised as default if a driver doesn't specify
> > > modifiers.
> > 
> > ...
> > 
> > > +	const uint64_t default_modifiers[] = {
> > > +		DRM_FORMAT_MOD_LINEAR,
> > > +		DRM_FORMAT_MOD_INVALID
> > 
> > + Comma?
> 
> There is no mention in the coding style about adding/removing a comma to the
> last element of an array. Is there a policy in drm driver?
> 
> I think the advantage of adding a comma to the last element of an array is
> that diff is only one line when an element is added to the end.
> However since INVALID is always the last element in the modifiers array, I
> think it can be either in this case.
> If there is a policy, I will match it.

Indeed, but there is a common sense. The idea behind (multi-line) definitions
that when next time somebody will add an element in the array, there are will
be:

a) no additional churn (like in case of this patch, if the item will be added
   at the bottom;

b) an element that may not be added behind the terminator, which will look
   weird.

That said, the question is if the element is terminator one or not, if not,
comma is better than no comma and vise versa.

-- 
With Best Regards,
Andy Shevchenko



WARNING: multiple messages have this Message-ID (diff)
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Esaki Tomohito <etom@igel.co.jp>
Cc: "David Airlie" <airlied@linux.ie>,
	nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	"Michel Dänzer" <mdaenzer@redhat.com>,
	"Daniel Stone" <daniel@fooishbar.org>,
	"Lee Jones" <lee.jones@linaro.org>,
	"Rob Clark" <robdclark@chromium.org>,
	"Takanari Hayama" <taki@igel.co.jp>,
	amd-gfx@lists.freedesktop.org, "Ben Skeggs" <bskeggs@redhat.com>,
	"Petr Mladek" <pmladek@suse.com>,
	"Sakari Ailus" <sakari.ailus@linux.intel.com>,
	"Bas Nieuwenhuizen" <bas@basnieuwenhuizen.nl>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Abhinav Kumar" <abhinavk@codeaurora.org>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Sean Paul" <seanpaul@chromium.org>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"Evan Quan" <evan.quan@amd.com>,
	"Mark Yacoub" <markyacoub@chromium.org>,
	"Qingqing Zhuo" <qingqing.zhuo@amd.com>,
	"Pan, Xinhui" <Xinhui.Pan@amd.com>,
	linux-kernel@vger.kernel.org, "Simon Ser" <contact@emersion.fr>,
	"Dmitry Baryshkov" <dmitry.baryshkov@linaro.org>,
	"Damian Hobson-Garcia" <dhobsong@igel.co.jp>,
	"Christian König" <christian.koenig@amd.com>,
	"Laurent Pinchart" <laurent.pinchart@ideasonboard.com>
Subject: Re: [Nouveau] [RFC PATCH v3 2/3] drm: add support modifiers for drivers whose planes only support linear layout
Date: Tue, 18 Jan 2022 11:53:34 +0200	[thread overview]
Message-ID: <YeaOHqfTcf+evbVC@smile.fi.intel.com> (raw)
In-Reply-To: <0cf405a1-0d2d-ed5e-abdf-be645e7a9209@igel.co.jp>

On Mon, Jan 17, 2022 at 02:15:48PM +0900, Esaki Tomohito wrote:
> On 2022/01/14 23:16, Andy Shevchenko wrote:
> > On Fri, Jan 14, 2022 at 07:17:52PM +0900, Tomohito Esaki wrote:
> > > The LINEAR modifier is advertised as default if a driver doesn't specify
> > > modifiers.
> > 
> > ...
> > 
> > > +	const uint64_t default_modifiers[] = {
> > > +		DRM_FORMAT_MOD_LINEAR,
> > > +		DRM_FORMAT_MOD_INVALID
> > 
> > + Comma?
> 
> There is no mention in the coding style about adding/removing a comma to the
> last element of an array. Is there a policy in drm driver?
> 
> I think the advantage of adding a comma to the last element of an array is
> that diff is only one line when an element is added to the end.
> However since INVALID is always the last element in the modifiers array, I
> think it can be either in this case.
> If there is a policy, I will match it.

Indeed, but there is a common sense. The idea behind (multi-line) definitions
that when next time somebody will add an element in the array, there are will
be:

a) no additional churn (like in case of this patch, if the item will be added
   at the bottom;

b) an element that may not be added behind the terminator, which will look
   weird.

That said, the question is if the element is terminator one or not, if not,
comma is better than no comma and vise versa.

-- 
With Best Regards,
Andy Shevchenko



WARNING: multiple messages have this Message-ID (diff)
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Esaki Tomohito <etom@igel.co.jp>
Cc: "David Airlie" <airlied@linux.ie>,
	nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	"Michel Dänzer" <mdaenzer@redhat.com>,
	"Lee Jones" <lee.jones@linaro.org>,
	"Rob Clark" <robdclark@chromium.org>,
	"Takanari Hayama" <taki@igel.co.jp>,
	amd-gfx@lists.freedesktop.org, "Ben Skeggs" <bskeggs@redhat.com>,
	"Petr Mladek" <pmladek@suse.com>,
	"Sakari Ailus" <sakari.ailus@linux.intel.com>,
	"Abhinav Kumar" <abhinavk@codeaurora.org>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Sean Paul" <seanpaul@chromium.org>,
	"Evan Quan" <evan.quan@amd.com>,
	"Mark Yacoub" <markyacoub@chromium.org>,
	"Qingqing Zhuo" <qingqing.zhuo@amd.com>,
	"Pan, Xinhui" <Xinhui.Pan@amd.com>,
	linux-kernel@vger.kernel.org,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"Dmitry Baryshkov" <dmitry.baryshkov@linaro.org>,
	"Damian Hobson-Garcia" <dhobsong@igel.co.jp>,
	"Christian König" <christian.koenig@amd.com>,
	"Laurent Pinchart" <laurent.pinchart@ideasonboard.com>
Subject: Re: [RFC PATCH v3 2/3] drm: add support modifiers for drivers whose planes only support linear layout
Date: Tue, 18 Jan 2022 11:53:34 +0200	[thread overview]
Message-ID: <YeaOHqfTcf+evbVC@smile.fi.intel.com> (raw)
In-Reply-To: <0cf405a1-0d2d-ed5e-abdf-be645e7a9209@igel.co.jp>

On Mon, Jan 17, 2022 at 02:15:48PM +0900, Esaki Tomohito wrote:
> On 2022/01/14 23:16, Andy Shevchenko wrote:
> > On Fri, Jan 14, 2022 at 07:17:52PM +0900, Tomohito Esaki wrote:
> > > The LINEAR modifier is advertised as default if a driver doesn't specify
> > > modifiers.
> > 
> > ...
> > 
> > > +	const uint64_t default_modifiers[] = {
> > > +		DRM_FORMAT_MOD_LINEAR,
> > > +		DRM_FORMAT_MOD_INVALID
> > 
> > + Comma?
> 
> There is no mention in the coding style about adding/removing a comma to the
> last element of an array. Is there a policy in drm driver?
> 
> I think the advantage of adding a comma to the last element of an array is
> that diff is only one line when an element is added to the end.
> However since INVALID is always the last element in the modifiers array, I
> think it can be either in this case.
> If there is a policy, I will match it.

Indeed, but there is a common sense. The idea behind (multi-line) definitions
that when next time somebody will add an element in the array, there are will
be:

a) no additional churn (like in case of this patch, if the item will be added
   at the bottom;

b) an element that may not be added behind the terminator, which will look
   weird.

That said, the question is if the element is terminator one or not, if not,
comma is better than no comma and vise versa.

-- 
With Best Regards,
Andy Shevchenko



WARNING: multiple messages have this Message-ID (diff)
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Esaki Tomohito <etom@igel.co.jp>
Cc: dri-devel@lists.freedesktop.org,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	"Pan, Xinhui" <Xinhui.Pan@amd.com>,
	"David Airlie" <airlied@linux.ie>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"Ben Skeggs" <bskeggs@redhat.com>,
	"Michel Dänzer" <mdaenzer@redhat.com>,
	"Simon Ser" <contact@emersion.fr>,
	"Qingqing Zhuo" <qingqing.zhuo@amd.com>,
	"Bas Nieuwenhuizen" <bas@basnieuwenhuizen.nl>,
	"Mark Yacoub" <markyacoub@chromium.org>,
	"Sean Paul" <seanpaul@chromium.org>,
	"Evan Quan" <evan.quan@amd.com>, "Petr Mladek" <pmladek@suse.com>,
	"Sakari Ailus" <sakari.ailus@linux.intel.com>,
	"Lee Jones" <lee.jones@linaro.org>,
	"Abhinav Kumar" <abhinavk@codeaurora.org>,
	"Dmitry Baryshkov" <dmitry.baryshkov@linaro.org>,
	"Rob Clark" <robdclark@chromium.org>,
	amd-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	nouveau@lists.freedesktop.org,
	"Daniel Stone" <daniel@fooishbar.org>,
	"Laurent Pinchart" <laurent.pinchart@ideasonboard.com>,
	"Damian Hobson-Garcia" <dhobsong@igel.co.jp>,
	"Takanari Hayama" <taki@igel.co.jp>
Subject: Re: [RFC PATCH v3 2/3] drm: add support modifiers for drivers whose planes only support linear layout
Date: Tue, 18 Jan 2022 11:53:34 +0200	[thread overview]
Message-ID: <YeaOHqfTcf+evbVC@smile.fi.intel.com> (raw)
In-Reply-To: <0cf405a1-0d2d-ed5e-abdf-be645e7a9209@igel.co.jp>

On Mon, Jan 17, 2022 at 02:15:48PM +0900, Esaki Tomohito wrote:
> On 2022/01/14 23:16, Andy Shevchenko wrote:
> > On Fri, Jan 14, 2022 at 07:17:52PM +0900, Tomohito Esaki wrote:
> > > The LINEAR modifier is advertised as default if a driver doesn't specify
> > > modifiers.
> > 
> > ...
> > 
> > > +	const uint64_t default_modifiers[] = {
> > > +		DRM_FORMAT_MOD_LINEAR,
> > > +		DRM_FORMAT_MOD_INVALID
> > 
> > + Comma?
> 
> There is no mention in the coding style about adding/removing a comma to the
> last element of an array. Is there a policy in drm driver?
> 
> I think the advantage of adding a comma to the last element of an array is
> that diff is only one line when an element is added to the end.
> However since INVALID is always the last element in the modifiers array, I
> think it can be either in this case.
> If there is a policy, I will match it.

Indeed, but there is a common sense. The idea behind (multi-line) definitions
that when next time somebody will add an element in the array, there are will
be:

a) no additional churn (like in case of this patch, if the item will be added
   at the bottom;

b) an element that may not be added behind the terminator, which will look
   weird.

That said, the question is if the element is terminator one or not, if not,
comma is better than no comma and vise versa.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2022-01-18 14:19 UTC|newest]

Thread overview: 72+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-14 10:17 [RFC PATCH v3 0/3] Add support modifiers for drivers whose planes only support linear layout Tomohito Esaki
2022-01-14 10:17 ` Tomohito Esaki
2022-01-14 10:17 ` Tomohito Esaki
2022-01-14 10:17 ` [Nouveau] " Tomohito Esaki
2022-01-14 10:17 ` [RFC PATCH v3 1/3] drm: introduce fb_modifiers_not_supported flag in mode_config Tomohito Esaki
2022-01-14 10:17   ` Tomohito Esaki
2022-01-14 10:17   ` Tomohito Esaki
2022-01-14 10:17   ` [Nouveau] " Tomohito Esaki
2022-01-14 14:43   ` Harry Wentland
2022-01-14 14:43     ` Harry Wentland
2022-01-14 14:43     ` Harry Wentland
2022-01-14 14:43     ` [Nouveau] " Harry Wentland
2022-01-23 22:50   ` Laurent Pinchart
2022-01-23 22:50     ` Laurent Pinchart
2022-01-23 22:50     ` Laurent Pinchart
2022-01-23 22:50     ` [Nouveau] " Laurent Pinchart
2022-01-25  5:19     ` Esaki Tomohito
2022-01-25  5:19       ` Esaki Tomohito
2022-01-25  5:19       ` Esaki Tomohito
2022-01-25  5:19       ` [Nouveau] " Esaki Tomohito
2022-01-14 10:17 ` [RFC PATCH v3 2/3] drm: add support modifiers for drivers whose planes only support linear layout Tomohito Esaki
2022-01-14 10:17   ` Tomohito Esaki
2022-01-14 10:17   ` Tomohito Esaki
2022-01-14 10:17   ` [Nouveau] " Tomohito Esaki
2022-01-14 14:16   ` Andy Shevchenko
2022-01-14 14:16     ` Andy Shevchenko
2022-01-14 14:16     ` Andy Shevchenko
2022-01-14 14:16     ` [Nouveau] " Andy Shevchenko
2022-01-14 15:07     ` Simon Ser
2022-01-14 15:07       ` Simon Ser
2022-01-14 15:07       ` Simon Ser
2022-01-14 15:07       ` [Nouveau] " Simon Ser
2022-01-14 15:17       ` Andy Shevchenko
2022-01-14 15:17         ` Andy Shevchenko
2022-01-14 15:17         ` Andy Shevchenko
2022-01-14 15:17         ` [Nouveau] " Andy Shevchenko
2022-01-14 15:42         ` Simon Ser
2022-01-14 15:42           ` Simon Ser
2022-01-14 15:42           ` Simon Ser
2022-01-14 15:42           ` [Nouveau] " Simon Ser
2022-01-14 16:06           ` Andy Shevchenko
2022-01-14 16:06             ` Andy Shevchenko
2022-01-14 16:06             ` Andy Shevchenko
2022-01-14 16:06             ` [Nouveau] " Andy Shevchenko
2022-01-17  5:15     ` Esaki Tomohito
2022-01-17  5:15       ` Esaki Tomohito
2022-01-17  5:15       ` Esaki Tomohito
2022-01-17  5:15       ` [Nouveau] " Esaki Tomohito
2022-01-18  9:53       ` Andy Shevchenko [this message]
2022-01-18  9:53         ` Andy Shevchenko
2022-01-18  9:53         ` Andy Shevchenko
2022-01-18  9:53         ` [Nouveau] " Andy Shevchenko
2022-01-19  2:35         ` Esaki Tomohito
2022-01-19  2:35           ` Esaki Tomohito
2022-01-19  2:35           ` Esaki Tomohito
2022-01-19  2:35           ` [Nouveau] " Esaki Tomohito
2022-01-19 19:17           ` Andy Shevchenko
2022-01-19 19:17             ` Andy Shevchenko
2022-01-19 19:17             ` Andy Shevchenko
2022-01-19 19:17             ` [Nouveau] " Andy Shevchenko
2022-01-23 22:37   ` Laurent Pinchart
2022-01-23 22:37     ` Laurent Pinchart
2022-01-23 22:37     ` Laurent Pinchart
2022-01-23 22:37     ` [Nouveau] " Laurent Pinchart
2022-01-14 10:17 ` [RFC PATCH v3 3/3] drm: remove allow_fb_modifiers Tomohito Esaki
2022-01-14 10:17   ` Tomohito Esaki
2022-01-14 10:17   ` Tomohito Esaki
2022-01-14 10:17   ` [Nouveau] " Tomohito Esaki
2022-01-23 22:44   ` Laurent Pinchart
2022-01-23 22:44     ` Laurent Pinchart
2022-01-23 22:44     ` Laurent Pinchart
2022-01-23 22:44     ` [Nouveau] " Laurent Pinchart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YeaOHqfTcf+evbVC@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=Xinhui.Pan@amd.com \
    --cc=abhinavk@codeaurora.org \
    --cc=airlied@linux.ie \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=bas@basnieuwenhuizen.nl \
    --cc=bskeggs@redhat.com \
    --cc=christian.koenig@amd.com \
    --cc=contact@emersion.fr \
    --cc=daniel@ffwll.ch \
    --cc=daniel@fooishbar.org \
    --cc=dhobsong@igel.co.jp \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=etom@igel.co.jp \
    --cc=evan.quan@amd.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=markyacoub@chromium.org \
    --cc=mdaenzer@redhat.com \
    --cc=mripard@kernel.org \
    --cc=nouveau@lists.freedesktop.org \
    --cc=pmladek@suse.com \
    --cc=qingqing.zhuo@amd.com \
    --cc=robdclark@chromium.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=seanpaul@chromium.org \
    --cc=taki@igel.co.jp \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.