From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915/bios: store child devices in a list
Date: Thu, 7 Nov 2019 12:40:42 +0200 [thread overview]
Message-ID: <20191107104042.GY1208@intel.com> (raw)
In-Reply-To: <87d0e42j0t.fsf@intel.com>
On Thu, Nov 07, 2019 at 10:22:10AM +0200, Jani Nikula wrote:
> On Wed, 06 Nov 2019, Ville Syrjälä <ville.syrjala@linux.intel.com> wrote:
> > On Wed, Nov 06, 2019 at 06:45:31PM +0200, Jani Nikula wrote:
> >> Using the array is getting clumsy. Make things a bit more dynamic.
> >>
> >> In code, start migrating towards calling the new struct child_device
> >> "child" and the VBT-originating struct child_device_config "config".
> >>
> >> Remove early returns on not having child devices when the end result
> >> after "iterating" the empty list would be the same.
> >>
> >> Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
> >> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> >>
> >> ---
> >>
> >> The end goal: allow more meta information to be added to the new
> >> child_device struct, independent of DDI port info being used or not on
> >> the platform, and eventually migrate ddi_port_info to it as well,
> >> unifying the stuff across platforms.
> >>
> >> Currently it's not easily possible to associate for example the DSC
> >> compression data to the child device for non-DDI platforms or for DSI
> >> outputs. This lets us add the compression data (pointer) to struct
> >> child_device.
> >> ---
> >> drivers/gpu/drm/i915/display/intel_bios.c | 203 ++++++++++------------
> >> drivers/gpu/drm/i915/i915_drv.h | 3 +-
> >> 2 files changed, 97 insertions(+), 109 deletions(-)
> >>
> >> diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
> >> index a03f56b7b4ef..025074862ab0 100644
> >> --- a/drivers/gpu/drm/i915/display/intel_bios.c
> >> +++ b/drivers/gpu/drm/i915/display/intel_bios.c
> >> @@ -58,6 +58,12 @@
> >> * that.
> >> */
> >>
> >> +/* Wrapper for VBT child device config */
> >> +struct child_device {
> >> + struct child_device_config config;
> >> + struct list_head node;
> >
> > The wrapper is a bit unfortunate. I don't suppose we could just shove
> > the list head into the existing struct and adjust what needs adjusting?
>
> The existing struct is used for serialization and the size is checked
> against what's in vbt etc. I might also add stuff in the wrapper struct,
> at least intermediately, so it's kind of useful. I don't really think
> the wrapper is all that bad.
>
> >
> >> +};
> >> +
> >> #define SLAVE_ADDR1 0x70
> >> #define SLAVE_ADDR2 0x72
> >>
> >> @@ -449,8 +455,9 @@ static void
> >> parse_sdvo_device_mapping(struct drm_i915_private *dev_priv, u8 bdb_version)
> >> {
> >> struct sdvo_device_mapping *mapping;
> >> - const struct child_device_config *child;
> >> - int i, count = 0;
> >> + const struct child_device_config *config;
> >
> > This thing could at least can live inside the loop. Though the rename is
> > also a bit unfortunate, leading to a needlessly large diff. Avoiding the
> > wrapper struct would also avoid that. I guess another option would
> > be to select a different name for the wrapper pointer here and keep the
> > original name for the actual thing.
>
> The main problem with avoiding the rename is to come up with a better
> name for the wrapper structure. :) Child and config seemed apt, but I do
> understand the downsides. I'd just like to have names that we can use
> througout. Maybe we can stick to child for struct child_device_config,
> but what do we call the whole wrapper struct and local vars?
> Suggestions?
I suck at naming things. If no better name comes up I guess we could at
least split the rename to a separate patch. Would be easier to see
what's actually changing with the introduction of the list.
--
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
WARNING: multiple messages have this Message-ID (diff)
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH] drm/i915/bios: store child devices in a list
Date: Thu, 7 Nov 2019 12:40:42 +0200 [thread overview]
Message-ID: <20191107104042.GY1208@intel.com> (raw)
Message-ID: <20191107104042.j4t_xZLnYLJln0J_t2iHDuevk9JMSfp1Ig4_ut2Ka-A@z> (raw)
In-Reply-To: <87d0e42j0t.fsf@intel.com>
On Thu, Nov 07, 2019 at 10:22:10AM +0200, Jani Nikula wrote:
> On Wed, 06 Nov 2019, Ville Syrjälä <ville.syrjala@linux.intel.com> wrote:
> > On Wed, Nov 06, 2019 at 06:45:31PM +0200, Jani Nikula wrote:
> >> Using the array is getting clumsy. Make things a bit more dynamic.
> >>
> >> In code, start migrating towards calling the new struct child_device
> >> "child" and the VBT-originating struct child_device_config "config".
> >>
> >> Remove early returns on not having child devices when the end result
> >> after "iterating" the empty list would be the same.
> >>
> >> Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
> >> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> >>
> >> ---
> >>
> >> The end goal: allow more meta information to be added to the new
> >> child_device struct, independent of DDI port info being used or not on
> >> the platform, and eventually migrate ddi_port_info to it as well,
> >> unifying the stuff across platforms.
> >>
> >> Currently it's not easily possible to associate for example the DSC
> >> compression data to the child device for non-DDI platforms or for DSI
> >> outputs. This lets us add the compression data (pointer) to struct
> >> child_device.
> >> ---
> >> drivers/gpu/drm/i915/display/intel_bios.c | 203 ++++++++++------------
> >> drivers/gpu/drm/i915/i915_drv.h | 3 +-
> >> 2 files changed, 97 insertions(+), 109 deletions(-)
> >>
> >> diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
> >> index a03f56b7b4ef..025074862ab0 100644
> >> --- a/drivers/gpu/drm/i915/display/intel_bios.c
> >> +++ b/drivers/gpu/drm/i915/display/intel_bios.c
> >> @@ -58,6 +58,12 @@
> >> * that.
> >> */
> >>
> >> +/* Wrapper for VBT child device config */
> >> +struct child_device {
> >> + struct child_device_config config;
> >> + struct list_head node;
> >
> > The wrapper is a bit unfortunate. I don't suppose we could just shove
> > the list head into the existing struct and adjust what needs adjusting?
>
> The existing struct is used for serialization and the size is checked
> against what's in vbt etc. I might also add stuff in the wrapper struct,
> at least intermediately, so it's kind of useful. I don't really think
> the wrapper is all that bad.
>
> >
> >> +};
> >> +
> >> #define SLAVE_ADDR1 0x70
> >> #define SLAVE_ADDR2 0x72
> >>
> >> @@ -449,8 +455,9 @@ static void
> >> parse_sdvo_device_mapping(struct drm_i915_private *dev_priv, u8 bdb_version)
> >> {
> >> struct sdvo_device_mapping *mapping;
> >> - const struct child_device_config *child;
> >> - int i, count = 0;
> >> + const struct child_device_config *config;
> >
> > This thing could at least can live inside the loop. Though the rename is
> > also a bit unfortunate, leading to a needlessly large diff. Avoiding the
> > wrapper struct would also avoid that. I guess another option would
> > be to select a different name for the wrapper pointer here and keep the
> > original name for the actual thing.
>
> The main problem with avoiding the rename is to come up with a better
> name for the wrapper structure. :) Child and config seemed apt, but I do
> understand the downsides. I'd just like to have names that we can use
> througout. Maybe we can stick to child for struct child_device_config,
> but what do we call the whole wrapper struct and local vars?
> Suggestions?
I suck at naming things. If no better name comes up I guess we could at
least split the rename to a separate patch. Would be easier to see
what's actually changing with the introduction of the list.
--
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2019-11-07 10:40 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-06 16:45 [PATCH] drm/i915/bios: store child devices in a list Jani Nikula
2019-11-06 16:45 ` [Intel-gfx] " Jani Nikula
2019-11-06 20:16 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2019-11-06 20:16 ` [Intel-gfx] " Patchwork
2019-11-06 20:37 ` [PATCH] " Ville Syrjälä
2019-11-06 20:37 ` [Intel-gfx] " Ville Syrjälä
2019-11-07 8:22 ` Jani Nikula
2019-11-07 8:22 ` [Intel-gfx] " Jani Nikula
2019-11-07 10:40 ` Ville Syrjälä [this message]
2019-11-07 10:40 ` Ville Syrjälä
2019-11-06 20:42 ` ✗ Fi.CI.BAT: failure for " Patchwork
2019-11-06 20:42 ` [Intel-gfx] " 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=20191107104042.GY1208@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@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.