public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 1/1] drm/i915: Drop unused register definitions
Date: Mon, 10 Jan 2022 12:55:36 +0200	[thread overview]
Message-ID: <871r1fc11z.fsf@intel.com> (raw)
In-Reply-To: <20220107164605.bd5t6a2doe227mse@ldmartin-desk2>

On Fri, 07 Jan 2022, Lucas De Marchi <lucas.demarchi@intel.com> wrote:
> On Fri, Jan 07, 2022 at 12:46:48PM +0200, Jani Nikula wrote:
>>I still tell people to 1) split out register definitions to separate
>>patches, and 2) add macros for the entire feature and full contents for
>>each register, even if they remain unused.
>>
>>One of the main reasons is review economics. It's pretty easy to look at
>>a patch adding register contents, review it against the bspec and be
>>done with it. And while you have the right bspec page open, it only
>>takes a very short time to add and review the entire register, instead
>>of having to return to it later. A patch adding just the registers could
>>get reviewed and merged at v1. It's one less patch the developer has to
>>keep carrying and rebasing, and it's one less portion the reviewer has
>>to worry about.
>
> this failed multiple times though, so I'm on the other side of the fence
> and think this actually makes things worse. Main reasons is because we
> have several registers doing things like:
>
> 	#define BLA(idx)	REG_BIT(idx * 2 + 1)
>
> And it's easy to get this wrong when it was not tested. It may be for
> example that one phy or port doesn't follow the same logic.
> When I review code I prefer reviewing code people actually tested.
>
> It's less of an issue when it's a 1:1 map from bspec, but for a lot of
> registers we need just 1 or 2 bits, e.g. for workarounds. Being able to
> filter out workarounds we don't need because we don't even define the
> register/bit is also another con to defining the complete register in a
> separate patch.
>
>
> So from my POV, the cons outweigtht the pros.

Okay, let's not forget this part of the conversation, but let's also not
let this block the cleanup. We don't have to do a blanket removal of
unused stuff before splitting the file up, and we don't have to decide
how we how we approach this in the future before that either, i.e. let's
get the uncontroversial stuff merged.

>
>>
>>Overall it's about getting the easy stuff done and behind you first. And
>>that's a huge part of my whole approach to kernel development, and what
>>I try to tell others to follow.
>>
>>I also think the documentation aspect is still valid, and especially so
>>for older hardware. It may be fine to remove some of the accumulated
>>cruft, *after* the register macros have been split up to smaller files
>>by functionality. But I don't think it should be an indiscriminate mass
>>removal of macros. For example, I don't think I want any of the sideband
>>or VGA or PCI register macros removed.
>>
>>Bottom line, I don't mind adding or having unused register macros at
>>all. Heck, I'd be on board for switching to auto-generated register
>>macros with absolutely everything.
>
> if it can be generated.... Then we'd have some additional headers for
> the accessor functions that deal with index math to the to the right
> bits or the  right register instance.

Yeah, it's somewhat of an unicorn I guess.

BR,
Jani.


-- 
Jani Nikula, Intel Open Source Graphics Center

  reply	other threads:[~2022-01-10 10:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-06 23:08 [Intel-gfx] [PATCH 0/1] Start cleaning up register definitions Matt Roper
2022-01-06 23:08 ` [Intel-gfx] [PATCH 1/1] drm/i915: Drop unused " Matt Roper
2022-01-07 10:46   ` Jani Nikula
2022-01-07 16:46     ` Lucas De Marchi
2022-01-10 10:55       ` Jani Nikula [this message]
2022-01-10 16:11         ` Lucas De Marchi
2022-01-06 23:39 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Start cleaning up " Patchwork
2022-01-06 23:40 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2022-01-07  0:13 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-01-07  9:34 ` [Intel-gfx] [PATCH 0/1] " Jani Nikula
2022-01-07  9:53   ` Jani Nikula
2022-01-07 16:14 ` [Intel-gfx] ✓ Fi.CI.IGT: success for " Patchwork

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=871r1fc11z.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=lucas.demarchi@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox