diff mbox

[14/42] drm/omap, omapfb: move exported dispc function declarations to omapdrm/omapfb

Message ID 1456161048-21240-15-git-send-email-tomi.valkeinen@ti.com (mailing list archive)
State New, archived
Headers show

Commit Message

Tomi Valkeinen Feb. 22, 2016, 5:10 p.m. UTC
omapdrm and omapfb still share the same include/video/omapdss.h. We need
to change that so that we can proceed with omapdrm work.

However, it's not trivial to make separate omapfb and omapdrm versions
of omapdss.h, as that file is also included in other places like arch
code, audio code and omap_vout code. So we'll do it piece by piece.

This patch makes private versions of all the dispc function declarations
that are in omapdss.h. For omapdrm we create a new file,
drivers/gpu/drm/omapdrm/dss/omapdss.h, which will contain headers meant
to be visible outside omapdss.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 drivers/gpu/drm/omapdrm/dss/dss.h            |  2 +
 drivers/gpu/drm/omapdrm/dss/omapdss.h        | 61 ++++++++++++++++++++++++++++
 drivers/gpu/drm/omapdrm/omap_drv.h           |  2 +
 drivers/video/fbdev/omap2/omapfb/dss/dispc.h |  1 +
 drivers/video/fbdev/omap2/omapfb/dss/dss.h   | 38 +++++++++++++++++
 include/video/omapdss.h                      | 38 -----------------
 6 files changed, 104 insertions(+), 38 deletions(-)
 create mode 100644 drivers/gpu/drm/omapdrm/dss/omapdss.h

Comments

Laurent Pinchart March 7, 2016, 8:42 a.m. UTC | #1
Hi Tomi,

Thank you for the patch.

On Monday 22 February 2016 19:10:20 Tomi Valkeinen wrote:
> omapdrm and omapfb still share the same include/video/omapdss.h. We need
> to change that so that we can proceed with omapdrm work.
> 
> However, it's not trivial to make separate omapfb and omapdrm versions
> of omapdss.h, as that file is also included in other places like arch
> code, audio code and omap_vout code. So we'll do it piece by piece.
> 
> This patch makes private versions of all the dispc function declarations
> that are in omapdss.h. For omapdrm we create a new file,
> drivers/gpu/drm/omapdrm/dss/omapdss.h, which will contain headers meant
> to be visible outside omapdss.
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>

This looks good to me, but I would squash patches 14/42 to 16/42 together, as 
it will make it easier to review them and make sure everything relevant has 
been moved.

Could you also confirm that the idea is to move anything that is not needed by 
arch/ code away from include/video/omapdss.h ?

> ---
>  drivers/gpu/drm/omapdrm/dss/dss.h            |  2 +
>  drivers/gpu/drm/omapdrm/dss/omapdss.h        | 61 +++++++++++++++++++++++++
>  drivers/gpu/drm/omapdrm/omap_drv.h           |  2 +
>  drivers/video/fbdev/omap2/omapfb/dss/dispc.h |  1 +
>  drivers/video/fbdev/omap2/omapfb/dss/dss.h   | 38 +++++++++++++++++
>  include/video/omapdss.h                      | 38 -----------------
>  6 files changed, 104 insertions(+), 38 deletions(-)
>  create mode 100644 drivers/gpu/drm/omapdrm/dss/omapdss.h

[snip]

> diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dispc.h
> b/drivers/video/fbdev/omap2/omapfb/dss/dispc.h index
> 483744223dd1..e014d0419c58 100644
> --- a/drivers/video/fbdev/omap2/omapfb/dss/dispc.h
> +++ b/drivers/video/fbdev/omap2/omapfb/dss/dispc.h
> @@ -915,4 +915,5 @@ static inline u16 DISPC_MFLAG_THRESHOLD_OFFSET(enum
> omap_plane plane) return 0;
>  	}
>  }
> +
>  #endif

Unrelated change ?
Tomi Valkeinen March 7, 2016, 8:54 a.m. UTC | #2
On 07/03/16 10:42, Laurent Pinchart wrote:
> Hi Tomi,
> 
> Thank you for the patch.
> 
> On Monday 22 February 2016 19:10:20 Tomi Valkeinen wrote:
>> omapdrm and omapfb still share the same include/video/omapdss.h. We need
>> to change that so that we can proceed with omapdrm work.
>>
>> However, it's not trivial to make separate omapfb and omapdrm versions
>> of omapdss.h, as that file is also included in other places like arch
>> code, audio code and omap_vout code. So we'll do it piece by piece.
>>
>> This patch makes private versions of all the dispc function declarations
>> that are in omapdss.h. For omapdrm we create a new file,
>> drivers/gpu/drm/omapdrm/dss/omapdss.h, which will contain headers meant
>> to be visible outside omapdss.
>>
>> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> 
> This looks good to me, but I would squash patches 14/42 to 16/42 together, as 
> it will make it easier to review them and make sure everything relevant has 
> been moved.
> 
> Could you also confirm that the idea is to move anything that is not needed by 
> arch/ code away from include/video/omapdss.h ?

My aim is to move/restructure everything shared by omapfb and omapdss so
that they would be fully independent. But at the moment we've got
structs used between arch/, omapfb and omapdrm, so there are some
challenges there.

include/video/omapdss.h was needed as a public omapdss header as we had
multiple users for omapdss. Now on the omapdrm side we no longer need a
public header at all, so in theory all that we need in omapdss.h (from
omapdrm's perspective) are the parts used from arch/.

But, of course, as omapfb and omap_vout still need support from
omapdss.h, I can't remove them just like that.

Probably I should create a new header for omapfb. Or maybe a new one for
the parts used from arch/.

 Tomi
Laurent Pinchart March 7, 2016, 9:53 a.m. UTC | #3
Hi Tomi,

On Monday 07 March 2016 10:54:05 Tomi Valkeinen wrote:
> On 07/03/16 10:42, Laurent Pinchart wrote:
> > On Monday 22 February 2016 19:10:20 Tomi Valkeinen wrote:
> >> omapdrm and omapfb still share the same include/video/omapdss.h. We need
> >> to change that so that we can proceed with omapdrm work.
> >> 
> >> However, it's not trivial to make separate omapfb and omapdrm versions
> >> of omapdss.h, as that file is also included in other places like arch
> >> code, audio code and omap_vout code. So we'll do it piece by piece.
> >> 
> >> This patch makes private versions of all the dispc function declarations
> >> that are in omapdss.h. For omapdrm we create a new file,
> >> drivers/gpu/drm/omapdrm/dss/omapdss.h, which will contain headers meant
> >> to be visible outside omapdss.
> >> 
> >> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> > 
> > This looks good to me, but I would squash patches 14/42 to 16/42 together,
> > as it will make it easier to review them and make sure everything
> > relevant has been moved.
> > 
> > Could you also confirm that the idea is to move anything that is not
> > needed by arch/ code away from include/video/omapdss.h ?
> 
> My aim is to move/restructure everything shared by omapfb and omapdss so
> that they would be fully independent. But at the moment we've got
> structs used between arch/, omapfb and omapdrm, so there are some
> challenges there.
> 
> include/video/omapdss.h was needed as a public omapdss header as we had
> multiple users for omapdss. Now on the omapdrm side we no longer need a
> public header at all, so in theory all that we need in omapdss.h (from
> omapdrm's perspective) are the parts used from arch/.
> 
> But, of course, as omapfb and omap_vout still need support from
> omapdss.h, I can't remove them just like that.
> 
> Probably I should create a new header for omapfb. Or maybe a new one for
> the parts used from arch/.

Given that some of the infrastructure is shared between omapfb and omap_vout, 
I believe it would make sense to do both.
diff mbox

Patch

diff --git a/drivers/gpu/drm/omapdrm/dss/dss.h b/drivers/gpu/drm/omapdrm/dss/dss.h
index 56ce89d4be27..e00b2679964f 100644
--- a/drivers/gpu/drm/omapdrm/dss/dss.h
+++ b/drivers/gpu/drm/omapdrm/dss/dss.h
@@ -25,6 +25,8 @@ 
 
 #include <linux/interrupt.h>
 
+#include "omapdss.h"
+
 #ifdef pr_fmt
 #undef pr_fmt
 #endif
diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h b/drivers/gpu/drm/omapdrm/dss/omapdss.h
new file mode 100644
index 000000000000..d33a8e4f07d1
--- /dev/null
+++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h
@@ -0,0 +1,61 @@ 
+/*
+ * Copyright (C) 2016 Texas Instruments
+ * Author: Tomi Valkeinen <tomi.valkeinen@ti.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+ * more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __OMAP_DRM_DSS_H
+#define __OMAP_DRM_DSS_H
+
+#include <video/omapdss.h>
+
+u32 dispc_read_irqstatus(void);
+void dispc_clear_irqstatus(u32 mask);
+u32 dispc_read_irqenable(void);
+void dispc_write_irqenable(u32 mask);
+
+int dispc_request_irq(irq_handler_t handler, void *dev_id);
+void dispc_free_irq(void *dev_id);
+
+int dispc_runtime_get(void);
+void dispc_runtime_put(void);
+
+void dispc_mgr_enable(enum omap_channel channel, bool enable);
+bool dispc_mgr_is_enabled(enum omap_channel channel);
+u32 dispc_mgr_get_vsync_irq(enum omap_channel channel);
+u32 dispc_mgr_get_framedone_irq(enum omap_channel channel);
+u32 dispc_mgr_get_sync_lost_irq(enum omap_channel channel);
+bool dispc_mgr_go_busy(enum omap_channel channel);
+void dispc_mgr_go(enum omap_channel channel);
+void dispc_mgr_set_lcd_config(enum omap_channel channel,
+		const struct dss_lcd_mgr_config *config);
+void dispc_mgr_set_timings(enum omap_channel channel,
+		const struct omap_video_timings *timings);
+void dispc_mgr_setup(enum omap_channel channel,
+		const struct omap_overlay_manager_info *info);
+
+int dispc_ovl_check(enum omap_plane plane, enum omap_channel channel,
+		const struct omap_overlay_info *oi,
+		const struct omap_video_timings *timings,
+		int *x_predecim, int *y_predecim);
+
+int dispc_ovl_enable(enum omap_plane plane, bool enable);
+bool dispc_ovl_enabled(enum omap_plane plane);
+void dispc_ovl_set_channel_out(enum omap_plane plane,
+		enum omap_channel channel);
+int dispc_ovl_setup(enum omap_plane plane, const struct omap_overlay_info *oi,
+		bool replication, const struct omap_video_timings *mgr_timings,
+		bool mem_to_mem);
+
+#endif /* __OMAP_DRM_DSS_H */
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.h b/drivers/gpu/drm/omapdrm/omap_drv.h
index 16c3eeeae668..defe74d28b04 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.h
+++ b/drivers/gpu/drm/omapdrm/omap_drv.h
@@ -31,6 +31,8 @@ 
 #include <drm/drm_gem.h>
 #include <drm/omap_drm.h>
 
+#include "dss/omapdss.h"
+
 #define DBG(fmt, ...) DRM_DEBUG(fmt"\n", ##__VA_ARGS__)
 #define VERB(fmt, ...) if (0) DRM_DEBUG(fmt, ##__VA_ARGS__) /* verbose debug */
 
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dispc.h b/drivers/video/fbdev/omap2/omapfb/dss/dispc.h
index 483744223dd1..e014d0419c58 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/dispc.h
+++ b/drivers/video/fbdev/omap2/omapfb/dss/dispc.h
@@ -915,4 +915,5 @@  static inline u16 DISPC_MFLAG_THRESHOLD_OFFSET(enum omap_plane plane)
 		return 0;
 	}
 }
+
 #endif
diff --git a/drivers/video/fbdev/omap2/omapfb/dss/dss.h b/drivers/video/fbdev/omap2/omapfb/dss/dss.h
index b9066afee301..86ed67ba4d58 100644
--- a/drivers/video/fbdev/omap2/omapfb/dss/dss.h
+++ b/drivers/video/fbdev/omap2/omapfb/dss/dss.h
@@ -412,6 +412,44 @@  void dispc_wb_set_channel_in(enum dss_writeback_channel channel);
 int dispc_wb_setup(const struct omap_dss_writeback_info *wi,
 		bool mem_to_mem, const struct omap_video_timings *timings);
 
+u32 dispc_read_irqstatus(void);
+void dispc_clear_irqstatus(u32 mask);
+u32 dispc_read_irqenable(void);
+void dispc_write_irqenable(u32 mask);
+
+int dispc_request_irq(irq_handler_t handler, void *dev_id);
+void dispc_free_irq(void *dev_id);
+
+int dispc_runtime_get(void);
+void dispc_runtime_put(void);
+
+void dispc_mgr_enable(enum omap_channel channel, bool enable);
+bool dispc_mgr_is_enabled(enum omap_channel channel);
+u32 dispc_mgr_get_vsync_irq(enum omap_channel channel);
+u32 dispc_mgr_get_framedone_irq(enum omap_channel channel);
+u32 dispc_mgr_get_sync_lost_irq(enum omap_channel channel);
+bool dispc_mgr_go_busy(enum omap_channel channel);
+void dispc_mgr_go(enum omap_channel channel);
+void dispc_mgr_set_lcd_config(enum omap_channel channel,
+		const struct dss_lcd_mgr_config *config);
+void dispc_mgr_set_timings(enum omap_channel channel,
+		const struct omap_video_timings *timings);
+void dispc_mgr_setup(enum omap_channel channel,
+		const struct omap_overlay_manager_info *info);
+
+int dispc_ovl_check(enum omap_plane plane, enum omap_channel channel,
+		const struct omap_overlay_info *oi,
+		const struct omap_video_timings *timings,
+		int *x_predecim, int *y_predecim);
+
+int dispc_ovl_enable(enum omap_plane plane, bool enable);
+bool dispc_ovl_enabled(enum omap_plane plane);
+void dispc_ovl_set_channel_out(enum omap_plane plane,
+		enum omap_channel channel);
+int dispc_ovl_setup(enum omap_plane plane, const struct omap_overlay_info *oi,
+		bool replication, const struct omap_video_timings *mgr_timings,
+		bool mem_to_mem);
+
 /* VENC */
 int venc_init_platform_driver(void) __init;
 void venc_uninit_platform_driver(void);
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index 7a2724e1622f..0464dd69a87d 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -891,44 +891,6 @@  typedef void (*omap_dispc_isr_t) (void *arg, u32 mask);
 int omap_dispc_register_isr(omap_dispc_isr_t isr, void *arg, u32 mask);
 int omap_dispc_unregister_isr(omap_dispc_isr_t isr, void *arg, u32 mask);
 
-u32 dispc_read_irqstatus(void);
-void dispc_clear_irqstatus(u32 mask);
-u32 dispc_read_irqenable(void);
-void dispc_write_irqenable(u32 mask);
-
-int dispc_request_irq(irq_handler_t handler, void *dev_id);
-void dispc_free_irq(void *dev_id);
-
-int dispc_runtime_get(void);
-void dispc_runtime_put(void);
-
-void dispc_mgr_enable(enum omap_channel channel, bool enable);
-bool dispc_mgr_is_enabled(enum omap_channel channel);
-u32 dispc_mgr_get_vsync_irq(enum omap_channel channel);
-u32 dispc_mgr_get_framedone_irq(enum omap_channel channel);
-u32 dispc_mgr_get_sync_lost_irq(enum omap_channel channel);
-bool dispc_mgr_go_busy(enum omap_channel channel);
-void dispc_mgr_go(enum omap_channel channel);
-void dispc_mgr_set_lcd_config(enum omap_channel channel,
-		const struct dss_lcd_mgr_config *config);
-void dispc_mgr_set_timings(enum omap_channel channel,
-		const struct omap_video_timings *timings);
-void dispc_mgr_setup(enum omap_channel channel,
-		const struct omap_overlay_manager_info *info);
-
-int dispc_ovl_check(enum omap_plane plane, enum omap_channel channel,
-		const struct omap_overlay_info *oi,
-		const struct omap_video_timings *timings,
-		int *x_predecim, int *y_predecim);
-
-int dispc_ovl_enable(enum omap_plane plane, bool enable);
-bool dispc_ovl_enabled(enum omap_plane plane);
-void dispc_ovl_set_channel_out(enum omap_plane plane,
-		enum omap_channel channel);
-int dispc_ovl_setup(enum omap_plane plane, const struct omap_overlay_info *oi,
-		bool replication, const struct omap_video_timings *mgr_timings,
-		bool mem_to_mem);
-
 int omapdss_compat_init(void);
 void omapdss_compat_uninit(void);