Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm: omapdrm: dss: Store dispc ops in dss_device structure

Remove the global dispc ops variable by storing it in the dss_device
structure.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>

authored by

Laurent Pinchart and committed by
Tomi Valkeinen
d3541ca8 72877cf3

+14 -19
+4 -9
drivers/gpu/drm/omapdrm/dss/base.c
··· 18 18 #include <linux/of.h> 19 19 #include <linux/of_graph.h> 20 20 #include <linux/list.h> 21 + 22 + #include "dss.h" 21 23 #include "omapdss.h" 22 24 23 25 static struct dss_device *dss_device; 24 - static const struct dispc_ops *ops; 25 26 26 27 static struct list_head omapdss_comp_list; 27 28 ··· 44 43 } 45 44 EXPORT_SYMBOL(omapdss_set_dss); 46 45 47 - void dispc_set_ops(const struct dispc_ops *o) 46 + const struct dispc_ops *dispc_get_ops(struct dss_device *dss) 48 47 { 49 - ops = o; 50 - } 51 - EXPORT_SYMBOL(dispc_set_ops); 52 - 53 - const struct dispc_ops *dispc_get_ops(void) 54 - { 55 - return ops; 48 + return dss->dispc_ops; 56 49 } 57 50 EXPORT_SYMBOL(dispc_get_ops); 58 51
+4 -2
drivers/gpu/drm/omapdrm/dss/dispc.c
··· 4622 4622 4623 4623 dispc_runtime_put(); 4624 4624 4625 - dispc_set_ops(&dispc_ops); 4625 + dss->dispc_ops = &dispc_ops; 4626 4626 4627 4627 dispc.debugfs = dss_debugfs_create_file(dss, "dispc", dispc_dump_regs, 4628 4628 &dispc); ··· 4637 4637 static void dispc_unbind(struct device *dev, struct device *master, 4638 4638 void *data) 4639 4639 { 4640 + struct dss_device *dss = dispc.dss; 4641 + 4640 4642 dss_debugfs_remove_file(dispc.debugfs); 4641 4643 4642 - dispc_set_ops(NULL); 4644 + dss->dispc_ops = NULL; 4643 4645 4644 4646 pm_runtime_disable(dev); 4645 4647
+2
drivers/gpu/drm/omapdrm/dss/dss.h
··· 271 271 struct dss_pll *plls[4]; 272 272 struct dss_pll *video1_pll; 273 273 struct dss_pll *video2_pll; 274 + 275 + const struct dispc_ops *dispc_ops; 274 276 }; 275 277 276 278 /* core */
+1 -2
drivers/gpu/drm/omapdrm/dss/omapdss.h
··· 733 733 const u32 *(*ovl_get_color_modes)(enum omap_plane_id plane); 734 734 }; 735 735 736 - void dispc_set_ops(const struct dispc_ops *o); 737 - const struct dispc_ops *dispc_get_ops(void); 736 + const struct dispc_ops *dispc_get_ops(struct dss_device *dss); 738 737 739 738 bool omapdss_component_is_display(struct device_node *node); 740 739 bool omapdss_component_is_output(struct device_node *node);
+1 -3
drivers/gpu/drm/omapdrm/omap_crtc.c
··· 117 117 enum omap_channel channel, 118 118 struct omap_dss_device *dst) 119 119 { 120 - const struct dispc_ops *dispc_ops = dispc_get_ops(); 121 - 122 120 if (omap_crtc_output[channel]) 123 121 return -EINVAL; 124 122 125 - if ((dispc_ops->mgr_get_supported_outputs(channel) & dst->id) == 0) 123 + if (!(priv->dispc_ops->mgr_get_supported_outputs(channel) & dst->id)) 126 124 return -EINVAL; 127 125 128 126 omap_crtc_output[channel] = dst;
+2 -3
drivers/gpu/drm/omapdrm/omap_drv.c
··· 520 520 DBG("%s", dev_name(dev)); 521 521 522 522 priv->dev = dev; 523 + priv->dss = omapdss_get_dss(); 524 + priv->dispc_ops = dispc_get_ops(priv->dss); 523 525 524 526 omap_crtc_pre_init(priv); 525 527 526 528 ret = omap_connect_dssdevs(); 527 529 if (ret) 528 530 goto err_crtc_uninit; 529 - 530 - priv->dss = omapdss_get_dss(); 531 - priv->dispc_ops = dispc_get_ops(); 532 531 533 532 soc = soc_device_match(omapdrm_soc_devices); 534 533 priv->omaprev = soc ? (unsigned int)soc->data : 0;