From: Jani Nikula <jani.nikula@linux.intel.com>
To: Casey Bowman <casey.g.bowman@intel.com>,
Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
intel-gfx@lists.freedesktop.org
Cc: thomas.hellstrom@linux.intel.com, lucas.demarchi@intel.com,
chris@chris-wilson.co.uk
Subject: Re: [Intel-gfx] [PATCH v3 1/2] drm/i915/gt: Split intel-gtt functions by arch
Date: Wed, 30 Mar 2022 20:25:01 +0300 [thread overview]
Message-ID: <878rsrbbf6.fsf@intel.com> (raw)
In-Reply-To: <dc652e22-913e-3a18-8062-202629c54b33@intel.com>
On Wed, 30 Mar 2022, Casey Bowman <casey.g.bowman@intel.com> wrote:
> On 3/30/22 02:55, Tvrtko Ursulin wrote:
>> I mean I could suggest to do something about the incosistency of:
>>
>> static inline void intel_gt_gmch_gen5_chipset_flush(struct intel_gt *gt)
>>
>> vs:
>>
>> static inline int intel_gt_gmch_gen5_probe(struct i915_ggtt *ggtt)
>>
>> Since I value more for function name to tell me on what it operates
>> instead where it is placed. So I'd personally rename the second class
>> to i915_ggtt. It would also be consistent with other exported
>> functions which take struct i915_ggtt like i915_ggtt_enable_guc,
>> i915_ggtt_resume and so. But opinions will differ so I can live with
>> it as is as well.
>>
>
> @Jani/Lucas, do you guys have any opinion on changing the prefix to a
> functionality-based name over location-based?
>
> If we have any standard we're trying to adhere to here, I can change it
> for the standard.
> I'd like to make everyone happy, if possible. :P
For display code I'm pretty strongly in favour of file name based symbol
prefixes. And basically a file should be a collection of related
functionality around a theme, so in that sense it's not merely location
based. Indeed the file name should be functionality based!
Also for display code we tend to have tons of functions that take
similar first (context) parameters, everywhere, and we also change the
parameters being passed while refactoring. It would be counter
productive to name the functions based on the first parameter.
Random example, display/intel_dp.h, it's all about display port, almost
all functions are named intel_dp_*, but if they were named by first
parameter, we'd have intel_dp, intel_encoder, intel_atomic_state,
drm_i915_private, intel_crtc_state, intel_digital_port, etc. It's the
intel_dp that best describes them as a group, so that's in the file and
function names.
Now, I'm not going to put my foot down on gem or gt stuff, but I
*personally* find the logic there confusing.
BR,
Jani.
--
Jani Nikula, Intel Open Source Graphics Center
next prev parent reply other threads:[~2022-03-30 17:25 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-29 23:58 [Intel-gfx] [PATCH v3 0/2] Splitting intel-gtt calls for non-x86 platforms Casey Bowman
2022-03-29 23:58 ` [Intel-gfx] [PATCH v3 1/2] drm/i915/gt: Split intel-gtt functions by arch Casey Bowman
2022-03-30 9:55 ` Tvrtko Ursulin
2022-03-30 10:23 ` Jani Nikula
2022-03-30 16:31 ` Casey Bowman
2022-03-30 16:42 ` Casey Bowman
2022-03-30 17:25 ` Jani Nikula [this message]
2022-03-30 18:36 ` Casey Bowman
2022-03-30 10:16 ` Jani Nikula
2022-03-30 16:32 ` Casey Bowman
2022-03-29 23:58 ` [Intel-gfx] [PATCH v3 2/2] drm/i915: Require INTEL_GTT to depend on X86 Casey Bowman
2022-03-30 0:27 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for Splitting intel-gtt calls for non-x86 platforms (rev3) 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=878rsrbbf6.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=casey.g.bowman@intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@lists.freedesktop.org \
--cc=lucas.demarchi@intel.com \
--cc=thomas.hellstrom@linux.intel.com \
--cc=tvrtko.ursulin@linux.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 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.