Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Jani Nikula <jani.nikula@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 2/7] drm/i915: Extract intel_dp_has_dsc()
Date: Tue, 21 May 2024 21:26:25 +0300	[thread overview]
Message-ID: <ZkznUVgYqPOxhbGQ@intel.com> (raw)
In-Reply-To: <87seybqyrc.fsf@intel.com>

On Tue, May 21, 2024 at 12:51:03PM +0300, Jani Nikula wrote:
> On Mon, 20 May 2024, Ville Syrjälä <ville.syrjala@linux.intel.com> wrote:
> > On Mon, May 20, 2024 at 01:47:34PM +0300, Jani Nikula wrote:
> >> On Fri, 17 May 2024, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> >> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >> >
> >> > Extract a helper to check whether the source+sink combo
> >> > supports DSC. That basic check is needed both during mode
> >> > validation and compute config. We'll also need to add extra
> >> > checks to both places, so having a single place for it is nicer.
> >> >
> >> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >> > ---
> >> >  drivers/gpu/drm/i915/display/intel_dp.c | 16 ++++++++++++++--
> >> >  1 file changed, 14 insertions(+), 2 deletions(-)
> >> >
> >> > diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> >> > index 1e88449fe5f2..7bf283b4df7f 100644
> >> > --- a/drivers/gpu/drm/i915/display/intel_dp.c
> >> > +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> >> > @@ -1220,6 +1220,19 @@ bool intel_dp_need_bigjoiner(struct intel_dp *intel_dp,
> >> >  	       connector->force_bigjoiner_enable;
> >> >  }
> >> >  
> >> > +static bool intel_dp_has_dsc(struct intel_connector *connector)
> >> 
> >> Why not const?
> >
> > We've generally not consted these things. And then whenver add
> > one const somewhere it usually ends up getting in the way later,
> > not because we need mutability but simply because we want to
> > call something that doesn't have the const.
> >
> > I suppose if we do want to start consting things more we should
> > just do some kind of bigger pass over the whole codebase so that
> > that there's less chance of pain later.
> >
> > We're also not using container_of_const() for these right now,
> > so the const can vanish semi-accidentally when casting things.
> >
> > I suppose this thing might be low level enough that the const
> > could be kept. I'll have another think about it.
> 
> It's just that this series drops a bunch of const because of this, which
> feels like the opposite of what you usually do. :)

I suppose.

My current rule of thumb is:
- atomic object states and fbs should be const if possible
- everything else is not

I wouldn't mind making more things const, but I suspect
there are several sizeable rabbit holes that need to be
dug out beforehand.

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2024-05-21 18:26 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-17 14:53 [PATCH 0/7] drm/i915: DSC stuff Ville Syrjala
2024-05-17 14:53 ` [PATCH 1/7] drm/i915: Drop redundant dsc_decompression_aux check Ville Syrjala
2024-05-17 14:53 ` [PATCH 2/7] drm/i915: Extract intel_dp_has_dsc() Ville Syrjala
2024-05-20 10:47   ` Jani Nikula
2024-05-20 16:00     ` Ville Syrjälä
2024-05-21  9:51       ` Jani Nikula
2024-05-21 18:26         ` Ville Syrjälä [this message]
2024-05-22  9:05           ` Jani Nikula
2024-05-17 14:53 ` [PATCH 3/7] drm/i915: Handle MST in intel_dp_has_dsc() Ville Syrjala
2024-05-17 14:53 ` [PATCH 4/7] drm/i915: Use intel_dp_has_dsc() during .compute_config() Ville Syrjala
2024-05-17 14:53 ` [PATCH 5/7] drm/i915: Reuse intel_dp_supports_dsc() for MST Ville Syrjala
2024-05-17 14:53 ` [PATCH 6/7] drm/i915: Utilize edp_disable_dsc from VBT Ville Syrjala
2024-05-17 14:53 ` [PATCH 7/7] drm/i915: Remove bogus MST check in intel_dp_has_audio() Ville Syrjala
2024-05-20 11:02   ` Jani Nikula
2024-05-17 15:38 ` ✗ Fi.CI.SPARSE: warning for drm/i915: DSC stuff Patchwork
2024-05-17 16:01 ` ✗ Fi.CI.BAT: failure " Patchwork
2024-05-20 11:03 ` [PATCH 0/7] " Jani Nikula
2024-06-12 14:58 ` ✗ Fi.CI.SPARSE: warning for drm/i915: DSC stuff (rev2) Patchwork
2024-06-12 14:59 ` ✓ Fi.CI.BAT: success " Patchwork
2024-06-14  0:50 ` ✗ Fi.CI.IGT: failure " 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=ZkznUVgYqPOxhbGQ@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox