]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/omap: move dispc related dss-feat funcs to dispc
authorTomi Valkeinen <tomi.valkeinen@ti.com>
Thu, 5 Nov 2015 17:54:33 +0000 (19:54 +0200)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Mon, 3 Apr 2017 09:36:40 +0000 (12:36 +0300)
omapdrm still uses a few non-dispc functions: dss_feat_get_num_mgrs(),
dss_feat_get_num_ovls() and  dss_feat_get_supported_color_modes(). We
want to provide omapdrm a single dispc_ops function pointer struct so
that omapdrm will use either the current omapdss or the new omapdss6
driver depending on the platform.

Those three functions are really dispc functions, but are located in the
dss_features.c for legacy reasons.

This patch adds similar functionss to the dispc, and changes omapdrm to
use those new functions. Underneath the functions still call the
functions from dss_feature.c.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
drivers/gpu/drm/omapdrm/dss/dispc.c
drivers/gpu/drm/omapdrm/dss/dss_features.c
drivers/gpu/drm/omapdrm/dss/dss_features.h
drivers/gpu/drm/omapdrm/dss/omapdss.h
drivers/gpu/drm/omapdrm/omap_drv.c
drivers/gpu/drm/omapdrm/omap_irq.c
drivers/gpu/drm/omapdrm/omap_plane.c

index d956e6266368afd6c4378e049d6c778f3d31f884..53d08dc4ef5a7a5f45f5490f644edd0517cf6789 100644 (file)
@@ -1135,6 +1135,18 @@ static u32 dispc_ovl_get_burst_size(enum omap_plane plane)
        return unit * 8;
 }
 
+enum omap_color_mode dispc_ovl_get_color_modes(enum omap_plane plane)
+{
+       return dss_feat_get_supported_color_modes(plane);
+}
+EXPORT_SYMBOL(dispc_ovl_get_color_modes);
+
+int dispc_get_num_ovls(void)
+{
+       return dss_feat_get_num_ovls();
+}
+EXPORT_SYMBOL(dispc_get_num_ovls);
+
 static void dispc_mgr_enable_cpr(enum omap_channel channel, bool enable)
 {
        if (channel == OMAP_DSS_CHANNEL_DIGIT)
@@ -2967,6 +2979,12 @@ void dispc_pck_free_enable(bool enable)
        REG_FLD_MOD(DISPC_CONTROL, enable ? 1 : 0, 27, 27);
 }
 
+int dispc_get_num_mgrs(void)
+{
+       return dss_feat_get_num_mgrs();
+}
+EXPORT_SYMBOL(dispc_get_num_mgrs);
+
 static void dispc_mgr_enable_fifohandcheck(enum omap_channel channel, bool enable)
 {
        mgr_fld_write(channel, DISPC_MGR_FLD_FIFOHANDCHECK, enable);
index ee5b93ce2763d73cfbebd6f8b00db561bd604a2c..26c29332b8e3dc09014383f328843960443816ab 100644 (file)
@@ -774,13 +774,11 @@ int dss_feat_get_num_mgrs(void)
 {
        return omap_current_dss_features->num_mgrs;
 }
-EXPORT_SYMBOL(dss_feat_get_num_mgrs);
 
 int dss_feat_get_num_ovls(void)
 {
        return omap_current_dss_features->num_ovls;
 }
-EXPORT_SYMBOL(dss_feat_get_num_ovls);
 
 unsigned long dss_feat_get_param_min(enum dss_range_param param)
 {
@@ -806,7 +804,6 @@ enum omap_color_mode dss_feat_get_supported_color_modes(enum omap_plane plane)
 {
        return omap_current_dss_features->supported_color_modes[plane];
 }
-EXPORT_SYMBOL(dss_feat_get_supported_color_modes);
 
 enum omap_overlay_caps dss_feat_get_overlay_caps(enum omap_plane plane)
 {
index bb4b7f0e642be8a9028fcdac5b41d287ba7c1cc6..bcec68ba8db94b8e06b7825b17a044f726dfa8d8 100644 (file)
@@ -104,4 +104,8 @@ void dss_features_init(enum omapdss_version version);
 enum omap_display_type dss_feat_get_supported_displays(enum omap_channel channel);
 enum omap_dss_output_id dss_feat_get_supported_outputs(enum omap_channel channel);
 
+int dss_feat_get_num_mgrs(void);
+int dss_feat_get_num_ovls(void);
+enum omap_color_mode dss_feat_get_supported_color_modes(enum omap_plane plane);
+
 #endif
index dab367ae5ca1ad55ddf65807c9862f0b5f521b85..4d3999c18fa2ff207c56b801fe59f67ce900f37e 100644 (file)
@@ -860,6 +860,9 @@ void dispc_free_irq(void *dev_id);
 int dispc_runtime_get(void);
 void dispc_runtime_put(void);
 
+int dispc_get_num_ovls(void);
+int dispc_get_num_mgrs(void);
+
 void dispc_mgr_enable(enum omap_channel channel, bool enable);
 u32 dispc_mgr_get_vsync_irq(enum omap_channel channel);
 u32 dispc_mgr_get_framedone_irq(enum omap_channel channel);
@@ -872,6 +875,7 @@ void dispc_mgr_set_timings(enum omap_channel channel,
                const struct videomode *vm);
 void dispc_mgr_setup(enum omap_channel channel,
                const struct omap_overlay_manager_info *info);
+enum omap_dss_output_id dispc_mgr_get_supported_outputs(enum omap_channel channel);
 u32 dispc_mgr_gamma_size(enum omap_channel channel);
 void dispc_mgr_set_gamma(enum omap_channel channel,
                         const struct drm_color_lut *lut,
@@ -883,6 +887,7 @@ 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 videomode *vm, bool mem_to_mem);
+enum omap_color_mode dispc_ovl_get_color_modes(enum omap_plane plane);
 
 enum omap_dss_output_id dispc_mgr_get_supported_outputs(enum omap_channel channel);
 
index ce0a1c04403db0651a7221efd35350c2298007ad..db0b485ef6c2b2de74ee8a58eddd1eb26ef3d41d 100644 (file)
@@ -320,8 +320,8 @@ static int omap_modeset_init(struct drm_device *dev)
 {
        struct omap_drm_private *priv = dev->dev_private;
        struct omap_dss_device *dssdev = NULL;
-       int num_ovls = dss_feat_get_num_ovls();
-       int num_mgrs = dss_feat_get_num_mgrs();
+       int num_ovls = dispc_get_num_ovls();
+       int num_mgrs = dispc_get_num_mgrs();
        int num_crtcs;
        int i, id = 0;
        int ret;
index 59f21add6f1924b505c2d90dab4a114acac94cec..a3fd6e8266c861050623aa55b692c7b989005eb9 100644 (file)
@@ -249,7 +249,7 @@ static const u32 omap_underflow_irqs[] = {
 int omap_drm_irq_install(struct drm_device *dev)
 {
        struct omap_drm_private *priv = dev->dev_private;
-       unsigned int num_mgrs = dss_feat_get_num_mgrs();
+       unsigned int num_mgrs = dispc_get_num_mgrs();
        unsigned int max_planes;
        unsigned int i;
        int ret;
index 386d90af70f7bf06b871bfd00ff5928dd40d345c..1067695af4011cf20565795f8031d0b6198c9db0 100644 (file)
@@ -352,7 +352,7 @@ struct drm_plane *omap_plane_init(struct drm_device *dev,
 
        omap_plane->nformats = omap_framebuffer_get_formats(
                        omap_plane->formats, ARRAY_SIZE(omap_plane->formats),
-                       dss_feat_get_supported_color_modes(id));
+                       dispc_ovl_get_color_modes(id));
        omap_plane->id = id;
        omap_plane->name = plane_names[id];