All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Lyude Paul <lyude@redhat.com>,
	intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Cc: David Airlie <airlied@linux.ie>,
	linux-kernel@vger.kernel.org,
	Chris Wilson <chris@chris-wilson.co.uk>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	Sean Paul <sean@poorly.run>
Subject: Re: [PATCH v2 1/2] drm/i915/dp_mst: Cast intel_connector->port as drm_dp_mst_port
Date: Tue, 07 Apr 2020 09:40:02 +0300	[thread overview]
Message-ID: <87eeszlry5.fsf@intel.com> (raw)
In-Reply-To: <20200406200646.1263435-1-lyude@redhat.com>

On Mon, 06 Apr 2020, Lyude Paul <lyude@redhat.com> wrote:
> The only reason for having this cast as void * before was because we
> originally needed to use drm_dp_mst_get_port_validated() and friends in
> order to (attempt to) safely access MST ports. However, we've since
> improved how reference counting works with ports and mstbs such that we
> can now rely on drm_dp_mst_port structs remaining in memory for as long
> as the driver needs. This means we don't really need to cast this as
> void* anymore, and can just access the struct directly.

To/from void* does not need a cast in C anyway. ;)

Acked-by: Jani Nikula <jani.nikula@intel.com>

>
> We'll also need this for the next commit, so that we can remove
> drm_dp_mst_port_has_audio().
>
> Signed-off-by: Lyude Paul <lyude@redhat.com>
> Reviewed-by: Sean Paul <sean@poorly.run>
> ---
>  drivers/gpu/drm/i915/display/intel_display_types.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
> index 5a0adf14ebef..0ddc98afe252 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_types.h
> +++ b/drivers/gpu/drm/i915/display/intel_display_types.h
> @@ -438,7 +438,7 @@ struct intel_connector {
>  	   state of connector->polled in case hotplug storm detection changes it */
>  	u8 polled;
>  
> -	void *port; /* store this opaque as its illegal to dereference it */
> +	struct drm_dp_mst_port *port;
>  
>  	struct intel_dp *mst_port;

-- 
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

WARNING: multiple messages have this Message-ID (diff)
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Lyude Paul <lyude@redhat.com>,
	intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Cc: David Airlie <airlied@linux.ie>,
	linux-kernel@vger.kernel.org,
	Chris Wilson <chris@chris-wilson.co.uk>
Subject: Re: [Intel-gfx] [PATCH v2 1/2] drm/i915/dp_mst: Cast intel_connector->port as drm_dp_mst_port
Date: Tue, 07 Apr 2020 09:40:02 +0300	[thread overview]
Message-ID: <87eeszlry5.fsf@intel.com> (raw)
In-Reply-To: <20200406200646.1263435-1-lyude@redhat.com>

On Mon, 06 Apr 2020, Lyude Paul <lyude@redhat.com> wrote:
> The only reason for having this cast as void * before was because we
> originally needed to use drm_dp_mst_get_port_validated() and friends in
> order to (attempt to) safely access MST ports. However, we've since
> improved how reference counting works with ports and mstbs such that we
> can now rely on drm_dp_mst_port structs remaining in memory for as long
> as the driver needs. This means we don't really need to cast this as
> void* anymore, and can just access the struct directly.

To/from void* does not need a cast in C anyway. ;)

Acked-by: Jani Nikula <jani.nikula@intel.com>

>
> We'll also need this for the next commit, so that we can remove
> drm_dp_mst_port_has_audio().
>
> Signed-off-by: Lyude Paul <lyude@redhat.com>
> Reviewed-by: Sean Paul <sean@poorly.run>
> ---
>  drivers/gpu/drm/i915/display/intel_display_types.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
> index 5a0adf14ebef..0ddc98afe252 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_types.h
> +++ b/drivers/gpu/drm/i915/display/intel_display_types.h
> @@ -438,7 +438,7 @@ struct intel_connector {
>  	   state of connector->polled in case hotplug storm detection changes it */
>  	u8 polled;
>  
> -	void *port; /* store this opaque as its illegal to dereference it */
> +	struct drm_dp_mst_port *port;
>  
>  	struct intel_dp *mst_port;

-- 
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
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: Jani Nikula <jani.nikula@linux.intel.com>
To: Lyude Paul <lyude@redhat.com>,
	intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Cc: "Sean Paul" <sean@poorly.run>,
	"Joonas Lahtinen" <joonas.lahtinen@linux.intel.com>,
	"Rodrigo Vivi" <rodrigo.vivi@intel.com>,
	"David Airlie" <airlied@linux.ie>,
	"Daniel Vetter" <daniel@ffwll.ch>,
	"Chris Wilson" <chris@chris-wilson.co.uk>,
	"Ville Syrjälä" <ville.syrjala@linux.intel.com>,
	"Imre Deak" <imre.deak@intel.com>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/2] drm/i915/dp_mst: Cast intel_connector->port as drm_dp_mst_port
Date: Tue, 07 Apr 2020 09:40:02 +0300	[thread overview]
Message-ID: <87eeszlry5.fsf@intel.com> (raw)
In-Reply-To: <20200406200646.1263435-1-lyude@redhat.com>

On Mon, 06 Apr 2020, Lyude Paul <lyude@redhat.com> wrote:
> The only reason for having this cast as void * before was because we
> originally needed to use drm_dp_mst_get_port_validated() and friends in
> order to (attempt to) safely access MST ports. However, we've since
> improved how reference counting works with ports and mstbs such that we
> can now rely on drm_dp_mst_port structs remaining in memory for as long
> as the driver needs. This means we don't really need to cast this as
> void* anymore, and can just access the struct directly.

To/from void* does not need a cast in C anyway. ;)

Acked-by: Jani Nikula <jani.nikula@intel.com>

>
> We'll also need this for the next commit, so that we can remove
> drm_dp_mst_port_has_audio().
>
> Signed-off-by: Lyude Paul <lyude@redhat.com>
> Reviewed-by: Sean Paul <sean@poorly.run>
> ---
>  drivers/gpu/drm/i915/display/intel_display_types.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
> index 5a0adf14ebef..0ddc98afe252 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_types.h
> +++ b/drivers/gpu/drm/i915/display/intel_display_types.h
> @@ -438,7 +438,7 @@ struct intel_connector {
>  	   state of connector->polled in case hotplug storm detection changes it */
>  	u8 polled;
>  
> -	void *port; /* store this opaque as its illegal to dereference it */
> +	struct drm_dp_mst_port *port;
>  
>  	struct intel_dp *mst_port;

-- 
Jani Nikula, Intel Open Source Graphics Center

  parent reply	other threads:[~2020-04-07  6:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-06 20:06 [PATCH v2 1/2] drm/i915/dp_mst: Cast intel_connector->port as drm_dp_mst_port Lyude Paul
2020-04-06 20:06 ` Lyude Paul
2020-04-06 20:06 ` [Intel-gfx] " Lyude Paul
2020-04-06 20:06 ` [PATCH v2 2/2] drm/dp_mst: Remove drm_dp_mst_has_audio() Lyude Paul
2020-04-06 20:06   ` Lyude Paul
2020-04-06 20:06   ` [Intel-gfx] " Lyude Paul
2020-04-06 22:09 ` [Intel-gfx] ✓ Fi.CI.BAT: success for series starting with [v2,1/2] drm/i915/dp_mst: Cast intel_connector->port as drm_dp_mst_port Patchwork
2020-04-07  6:40 ` Jani Nikula [this message]
2020-04-07  6:40   ` [PATCH v2 1/2] " Jani Nikula
2020-04-07  6:40   ` [Intel-gfx] " Jani Nikula
2020-04-07  7:30 ` [Intel-gfx] ✓ Fi.CI.IGT: success for series starting with [v2,1/2] " 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=87eeszlry5.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=airlied@linux.ie \
    --cc=chris@chris-wilson.co.uk \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lyude@redhat.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=sean@poorly.run \
    /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.