diff mbox

[11/13] drm/omapdrm: Nuke omap_framebuffer_get_next_connector()

Message ID 20180405151400.11326-11-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ville Syrjälä April 5, 2018, 3:13 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

omap_framebuffer_get_next_connector() uses plane->fb which we want to
deprecate for atomic drivers. As omap_framebuffer_get_next_connector()
is unused just nuke the entire function.

Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/omapdrm/omap_fb.c | 27 ---------------------------
 drivers/gpu/drm/omapdrm/omap_fb.h |  2 --
 2 files changed, 29 deletions(-)

Comments

Daniel Vetter April 5, 2018, 4:50 p.m. UTC | #1
On Thu, Apr 05, 2018 at 06:13:58PM +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> omap_framebuffer_get_next_connector() uses plane->fb which we want to
> deprecate for atomic drivers. As omap_framebuffer_get_next_connector()
> is unused just nuke the entire function.
> 
> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Yeah was slightly worried how to fix up this one, but we're lucky!

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
>  drivers/gpu/drm/omapdrm/omap_fb.c | 27 ---------------------------
>  drivers/gpu/drm/omapdrm/omap_fb.h |  2 --
>  2 files changed, 29 deletions(-)
> 
> diff --git a/drivers/gpu/drm/omapdrm/omap_fb.c b/drivers/gpu/drm/omapdrm/omap_fb.c
> index 5fd22ca73913..b54bcaad5cd1 100644
> --- a/drivers/gpu/drm/omapdrm/omap_fb.c
> +++ b/drivers/gpu/drm/omapdrm/omap_fb.c
> @@ -309,33 +309,6 @@ void omap_framebuffer_unpin(struct drm_framebuffer *fb)
>  	mutex_unlock(&omap_fb->lock);
>  }
>  
> -/* iterate thru all the connectors, returning ones that are attached
> - * to the same fb..
> - */
> -struct drm_connector *omap_framebuffer_get_next_connector(
> -		struct drm_framebuffer *fb, struct drm_connector *from)
> -{
> -	struct drm_device *dev = fb->dev;
> -	struct list_head *connector_list = &dev->mode_config.connector_list;
> -	struct drm_connector *connector = from;
> -
> -	if (!from)
> -		return list_first_entry_or_null(connector_list, typeof(*from),
> -						head);
> -
> -	list_for_each_entry_from(connector, connector_list, head) {
> -		if (connector != from) {
> -			struct drm_encoder *encoder = connector->encoder;
> -			struct drm_crtc *crtc = encoder ? encoder->crtc : NULL;
> -			if (crtc && crtc->primary->fb == fb)
> -				return connector;
> -
> -		}
> -	}
> -
> -	return NULL;
> -}
> -
>  #ifdef CONFIG_DEBUG_FS
>  void omap_framebuffer_describe(struct drm_framebuffer *fb, struct seq_file *m)
>  {
> diff --git a/drivers/gpu/drm/omapdrm/omap_fb.h b/drivers/gpu/drm/omapdrm/omap_fb.h
> index 94ad5f9e4404..c20cb4bc714d 100644
> --- a/drivers/gpu/drm/omapdrm/omap_fb.h
> +++ b/drivers/gpu/drm/omapdrm/omap_fb.h
> @@ -38,8 +38,6 @@ int omap_framebuffer_pin(struct drm_framebuffer *fb);
>  void omap_framebuffer_unpin(struct drm_framebuffer *fb);
>  void omap_framebuffer_update_scanout(struct drm_framebuffer *fb,
>  		struct drm_plane_state *state, struct omap_overlay_info *info);
> -struct drm_connector *omap_framebuffer_get_next_connector(
> -		struct drm_framebuffer *fb, struct drm_connector *from);
>  bool omap_framebuffer_supports_rotation(struct drm_framebuffer *fb);
>  void omap_framebuffer_describe(struct drm_framebuffer *fb, struct seq_file *m);
>  
> -- 
> 2.16.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Tomi Valkeinen April 6, 2018, 6:10 a.m. UTC | #2
On 05/04/18 19:50, Daniel Vetter wrote:
> On Thu, Apr 05, 2018 at 06:13:58PM +0300, Ville Syrjala wrote:
>> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>>
>> omap_framebuffer_get_next_connector() uses plane->fb which we want to
>> deprecate for atomic drivers. As omap_framebuffer_get_next_connector()
>> is unused just nuke the entire function.
>>
>> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
>> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Yeah was slightly worried how to fix up this one, but we're lucky!
> 
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

I tried to remove it just a week ago, but Sebastian said that it's used
by a unmerged series about DSI command mode displays, so I dropped the
patch.

In the unmerged series, it's used by omap_framebuffer_dirty() ([PATCHv3
3/8] drm/omap: add support for manually updated displays). So we have a
framebuffer, and we want to know which crtcs need to be flushed.

 Tomi
Daniel Vetter April 9, 2018, 8:41 a.m. UTC | #3
On Fri, Apr 06, 2018 at 09:10:43AM +0300, Tomi Valkeinen wrote:
> On 05/04/18 19:50, Daniel Vetter wrote:
> > On Thu, Apr 05, 2018 at 06:13:58PM +0300, Ville Syrjala wrote:
> >> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >>
> >> omap_framebuffer_get_next_connector() uses plane->fb which we want to
> >> deprecate for atomic drivers. As omap_framebuffer_get_next_connector()
> >> is unused just nuke the entire function.
> >>
> >> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
> >> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > Yeah was slightly worried how to fix up this one, but we're lucky!
> > 
> > Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> 
> I tried to remove it just a week ago, but Sebastian said that it's used
> by a unmerged series about DSI command mode displays, so I dropped the
> patch.
> 
> In the unmerged series, it's used by omap_framebuffer_dirty() ([PATCHv3
> 3/8] drm/omap: add support for manually updated displays). So we have a
> framebuffer, and we want to know which crtcs need to be flushed.

You can't do that in atomic drivers.

You need to take appropriate locks and do the full ->state->fb deref.
Also, there's a gazillion of copies for generic framebuffer_dirty
implementations floating around, pleas try to coordinate with those.
-Daniel
Tomi Valkeinen April 16, 2018, 1:29 p.m. UTC | #4
On 09/04/18 11:41, Daniel Vetter wrote:
> On Fri, Apr 06, 2018 at 09:10:43AM +0300, Tomi Valkeinen wrote:
>> On 05/04/18 19:50, Daniel Vetter wrote:
>>> On Thu, Apr 05, 2018 at 06:13:58PM +0300, Ville Syrjala wrote:
>>>> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>>>>
>>>> omap_framebuffer_get_next_connector() uses plane->fb which we want to
>>>> deprecate for atomic drivers. As omap_framebuffer_get_next_connector()
>>>> is unused just nuke the entire function.
>>>>
>>>> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
>>>> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
>>>
>>> Yeah was slightly worried how to fix up this one, but we're lucky!
>>>
>>> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>>
>> I tried to remove it just a week ago, but Sebastian said that it's used
>> by a unmerged series about DSI command mode displays, so I dropped the
>> patch.
>>
>> In the unmerged series, it's used by omap_framebuffer_dirty() ([PATCHv3
>> 3/8] drm/omap: add support for manually updated displays). So we have a
>> framebuffer, and we want to know which crtcs need to be flushed.
> 
> You can't do that in atomic drivers.
> 
> You need to take appropriate locks and do the full ->state->fb deref.
> Also, there's a gazillion of copies for generic framebuffer_dirty
> implementations floating around, pleas try to coordinate with those.

Ok. In that case we need to refresh the manual update series to do
things differently. For this patch:

Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>

 Tomi
diff mbox

Patch

diff --git a/drivers/gpu/drm/omapdrm/omap_fb.c b/drivers/gpu/drm/omapdrm/omap_fb.c
index 5fd22ca73913..b54bcaad5cd1 100644
--- a/drivers/gpu/drm/omapdrm/omap_fb.c
+++ b/drivers/gpu/drm/omapdrm/omap_fb.c
@@ -309,33 +309,6 @@  void omap_framebuffer_unpin(struct drm_framebuffer *fb)
 	mutex_unlock(&omap_fb->lock);
 }
 
-/* iterate thru all the connectors, returning ones that are attached
- * to the same fb..
- */
-struct drm_connector *omap_framebuffer_get_next_connector(
-		struct drm_framebuffer *fb, struct drm_connector *from)
-{
-	struct drm_device *dev = fb->dev;
-	struct list_head *connector_list = &dev->mode_config.connector_list;
-	struct drm_connector *connector = from;
-
-	if (!from)
-		return list_first_entry_or_null(connector_list, typeof(*from),
-						head);
-
-	list_for_each_entry_from(connector, connector_list, head) {
-		if (connector != from) {
-			struct drm_encoder *encoder = connector->encoder;
-			struct drm_crtc *crtc = encoder ? encoder->crtc : NULL;
-			if (crtc && crtc->primary->fb == fb)
-				return connector;
-
-		}
-	}
-
-	return NULL;
-}
-
 #ifdef CONFIG_DEBUG_FS
 void omap_framebuffer_describe(struct drm_framebuffer *fb, struct seq_file *m)
 {
diff --git a/drivers/gpu/drm/omapdrm/omap_fb.h b/drivers/gpu/drm/omapdrm/omap_fb.h
index 94ad5f9e4404..c20cb4bc714d 100644
--- a/drivers/gpu/drm/omapdrm/omap_fb.h
+++ b/drivers/gpu/drm/omapdrm/omap_fb.h
@@ -38,8 +38,6 @@  int omap_framebuffer_pin(struct drm_framebuffer *fb);
 void omap_framebuffer_unpin(struct drm_framebuffer *fb);
 void omap_framebuffer_update_scanout(struct drm_framebuffer *fb,
 		struct drm_plane_state *state, struct omap_overlay_info *info);
-struct drm_connector *omap_framebuffer_get_next_connector(
-		struct drm_framebuffer *fb, struct drm_connector *from);
 bool omap_framebuffer_supports_rotation(struct drm_framebuffer *fb);
 void omap_framebuffer_describe(struct drm_framebuffer *fb, struct seq_file *m);