omapdrm: Reverse direction of DSS device (dis)connect operations
Subsystems (3)
v2 cover omapdrm: Reverse direction of DSS device (dis)connect operations
Hello,
This patch series is a first step towards moving the omapdrm driver away from the custom bridge and panel drivers to drm_bridge and drm_panel.
The main blocker to transition to drm_bridge and drm_panel is the direction of the bridge operations. While the omapdrm driver manages its components from sink to source (panel to DSS output), the drm_bridge API is manages bridges in the source to sink direction. This makes the two models incompatible, and requires reversing the direction of operations inside omapdrm.
Don't rejoice too fast, we're still far from a complete transition, but this first step paves the way by reworking the driver's internals to make source to sink order possible. It then transitions the connect and disconnect operations (the omapdrm equivalent of the drm_bridge attach and detach operations) to the new direction.
The series contains patches previously posted by Jyri and Peter that I have found helpful. Please see the individual patches for changes compared to the original versions (trivial conflict resolutions caused by a rebase are not mentioned).
The patches are based on top of the "[PATCH v2 0/6] omapdrm: struct_mutex removal" patch series I've sent yesterday, itself based on top of Dave's drm-next branch. They can be found at
git://linuxtv.org/pinchartl/media.git omapdrm/bridge
The series has been tested on a Pandaboard with the HDMI and DVI outputs, and on a TI AM57xx EVM with the LCD and HDMI outputs. All patches have been tested individually on the Pandaboard.
Compared to v1, patch "drm/omap: dss: Remove omapdss_hdmi_ops set_infoframe operation" has been dropped, and patch "drm/omap: dss: Handle DPI and SDI port initialization failures" added. Other small changes are documented in individual patches.
Jyri Sarha (1):
drm/omap: dss: Move platform_device_register from core.c to dss.c
probe
Laurent Pinchart (55):
drm/omap: dss: Gather OMAP DSS components at probe time drm/omap: dss: Handle DPI and SDI port initialization failures drm/omap: dss: Remove omapdss_atv_ops get_wss and set_wss operations drm/omap: dss: Remove DSS encoders get_timings operation drm/omap: dss: Remove unused omapdss_default_get_timings() drm/omap: dss: Constify omap_dss_driver operations structure drm/omap: displays: Remove videomode from omap_dss_device structure drm/omap: dss: Remove omap_dss_device panel fields drm/omap: dss: Rename omap_dss_device list field to output_list drm/omap: dss: Create global list of all omap_dss_device instances drm/omap: dss: Create and use omapdss_device_is_registered() drm/omap: dss: Rework output lookup by port node drm/omap: dss: Allow looking up any device by port drm/omap: dss: Move common device operations to common structure drm/omap: dss: Add functions to connect and disconnect devices drm/omap: dss: Move debug message and checks to connection handlers drm/omap: dss: Move src and dst check and set to connection handlers drm/omap: displays: Remove input omap_dss_device from panel data drm/omap: dsi: Simplify debugfs implementation
drm/omap: Move DSI debugfs clocks dump to dsi%u_clks files drm/omap: dss: Remove output devices list
drm/omap: dss: Rename for_each_dss_dev macro to for_each_dss_display drm/omap: dss: Make omap_dss_get_next_device() more generic drm/omap: dss: Split omapdss_register_display()
drm/omap: dss: Remove panel devices list
drm/omap: dss: Move and rename omap_dss_(get|put)_device() drm/omap: dss: Store dss_device pointer in omap_dss_device drm/omap: dss: Move DSS mgr ops and private data to dss_device drm/omap: dss: Modify omapdss_find_output_from_display() to return
channel
drm/omap: dss: Replace omap_dss_device port number with bitmask drm/omap: dss: Extend omapdss_of_find_source_for_first_ep() to sinks drm/omap: displays: Don't cast dssdev to panel data unnecessarily drm/omap: dss: Cleanup error paths in output init functions drm/omap: dss: dsi: Move initialization code from bind to probe drm/omap: dss: hdmi4: Move initialization code from bind to probe drm/omap: dss: hdmi5: Move initialization code from bind to probe drm/omap: dss: venc: Move initialization code from bind to probe drm/omap: dss: Acquire next dssdev at probe time drm/omap: dss: Add for_each_dss_output() macro
drm/omap: dss: Add function to retrieve display for an output drm/omap: dss: Remove duplicated parameter to dss_mgr_(dis)connect() drm/omap: dss: Get regulators at probe time
drm/omap: Remove unneeded variable assignments in omap_modeset_init drm/omap: Create all planes before CRTCs
drm/omap: Group CRTC, encoder, connector and dssdev in a structure drm/omap: Reverse direction of DSS device (dis)connect operations drm/omap: dss: Move connection checks to omapdss_device_(dis)connect drm/omap: dss: Move display type validation to initialization time drm/omap: dss: Merge two disconnection helpers
drm/omap: Pass pipe pointer to omap_crtc_init()
drm/omap: Store CRTC lookup by channel table in omap_drm_private drm/omap: Remove omap_crtc_output global array
drm/omap: Remove supported output check in CRTC connect handler drm/omap: Set dispc_channel_connect from DSS output connect handlers drm/omap: dss: Remove the dss_mgr_(dis)connect() operations
Peter Ujfalusi (4):
drm/omap: Allocate drm_device earlier and unref it as last step drm/omap: Manage the usable omap_dss_device list within
omap_drm_private
drm/omap: Do dss_device (display) ordering in omap_drv.c drm/omap: dss: Remove display ordering from dss/display.c
.../gpu/drm/omapdrm/displays/connector-analog-tv.c | 95 +--- drivers/gpu/drm/omapdrm/displays/connector-dvi.c | 78 +-- drivers/gpu/drm/omapdrm/displays/connector-hdmi.c | 122 ++--- drivers/gpu/drm/omapdrm/displays/encoder-opa362.c | 113 ++--- drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c | 107 ++--- .../gpu/drm/omapdrm/displays/encoder-tpd12s015.c | 146 +++--- drivers/gpu/drm/omapdrm/displays/panel-dpi.c | 73 +-- drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 237 ++++----- .../omapdrm/displays/panel-lgphilips-lb035q02.c | 71 +-- .../drm/omapdrm/displays/panel-nec-nl8048hl11.c | 71 +-- .../drm/omapdrm/displays/panel-sharp-ls037v7dw01.c | 71 +-- .../drm/omapdrm/displays/panel-sony-acx565akm.c | 90 +--- .../drm/omapdrm/displays/panel-tpo-td028ttec1.c | 71 +-- .../drm/omapdrm/displays/panel-tpo-td043mtea1.c | 87 +--- drivers/gpu/drm/omapdrm/dss/base.c | 225 ++++++++- drivers/gpu/drm/omapdrm/dss/core.c | 26 +- drivers/gpu/drm/omapdrm/dss/dispc.c | 8 - drivers/gpu/drm/omapdrm/dss/display.c | 134 +----- drivers/gpu/drm/omapdrm/dss/dpi.c | 172 +++---- drivers/gpu/drm/omapdrm/dss/dsi.c | 527 ++++++++++----------- drivers/gpu/drm/omapdrm/dss/dss-of.c | 47 +- drivers/gpu/drm/omapdrm/dss/dss.c | 40 +- drivers/gpu/drm/omapdrm/dss/dss.h | 8 +- drivers/gpu/drm/omapdrm/dss/hdmi4.c | 328 ++++++------- drivers/gpu/drm/omapdrm/dss/hdmi5.c | 311 ++++++------ drivers/gpu/drm/omapdrm/dss/omapdss.h | 225 +++------ drivers/gpu/drm/omapdrm/dss/output.c | 208 ++------ drivers/gpu/drm/omapdrm/dss/sdi.c | 113 ++--- drivers/gpu/drm/omapdrm/dss/venc.c | 252 ++++------ drivers/gpu/drm/omapdrm/omap_connector.c | 10 +- drivers/gpu/drm/omapdrm/omap_crtc.c | 78 +-- drivers/gpu/drm/omapdrm/omap_crtc.h | 6 +- drivers/gpu/drm/omapdrm/omap_drv.c | 296 +++++++----- drivers/gpu/drm/omapdrm/omap_drv.h | 19 +- drivers/gpu/drm/omapdrm/omap_encoder.c | 6 +- drivers/gpu/drm/omapdrm/omap_fbdev.c | 4 +- drivers/gpu/drm/omapdrm/omap_irq.c | 4 +- 37 files changed, 1800 insertions(+), 2679 deletions(-)
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 1/60 drm/omap: Allocate drm_device earlier and unref it as last step
From: Peter Ujfalusi <[email protected]>
If we allocate the drm_device earlier we can just return the error code without the need to use goto.
Do the unref of the drm_device as a last step when cleaning up. This will make the drm_device available longer for us and makes sure that we only free up the memory when all other cleanups have been already done.
--- drivers/gpu/drm/omapdrm/omap_drv.c | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-)
drivers/gpu/drm/omapdrm/omap_drv.c +13 -16
@@ -525,6 +525,14 @@ static int omapdrm_init(struct omap_drm_private *priv, struct device *dev)DBG ("%s" ,dev_name (dev)); +/* Allocate and initialize the DRM device. */ + ddev =drm_dev_alloc (&omap_drm_driver, dev); +if (IS_ERR (ddev)) +return PTR_ERR (ddev); + + priv->ddev = ddev; + ddev->dev_private = priv; + priv->dev = dev; priv->dss =omapdss_get_dss (); priv->dispc =dispc_get_dispc (priv->dss);
@@ -543,16 +551,6 @@ static int omapdrm_init(struct omap_drm_private *priv, struct device *dev)mutex_init (&priv->list_lock);INIT_LIST_HEAD (&priv->obj_list); -/* Allocate and initialize the DRM device. */ - ddev =drm_dev_alloc (&omap_drm_driver, priv->dev); -if (IS_ERR (ddev)) { - ret =PTR_ERR (ddev); - goto err_destroy_wq; - } - - priv->ddev = ddev; - ddev->dev_private = priv; -/* Get memory bandwidth limits */ if (priv->dispc_ops->get_memory_bandwidth_limit) priv->max_bandwidth =
@@ -563,7 +561,7 @@ static int omapdrm_init(struct omap_drm_private *priv, struct device *dev) ret =omap_modeset_init (ddev);if (ret) {dev_err (priv->dev,"omap_modeset_init failed: ret=%d\n" , ret); - goto err_free_drm_dev; + goto err_gem_deinit; }/* Initialize vblank handling, start with all CRTCs disabled. */
@@ -599,14 +597,13 @@ static int omapdrm_init(struct omap_drm_private *priv, struct device *dev) err_cleanup_modeset:drm_mode_config_cleanup (ddev);omap_drm_irq_uninstall (ddev); -err_free_drm_dev: +err_gem_deinit:omap_gem_deinit (ddev); -drm_dev_unref (ddev); -err_destroy_wq:destroy_workqueue (priv->wq);omap_disconnect_dssdevs (); err_crtc_uninit:omap_crtc_pre_uninit (); +drm_dev_unref (ddev);return ret; }
@@ -630,12 +627,12 @@ static void omapdrm_cleanup(struct omap_drm_private *priv)omap_drm_irq_uninstall (ddev);omap_gem_deinit (ddev); -drm_dev_unref (ddev); -destroy_workqueue (priv->wq);omap_disconnect_dssdevs ();omap_crtc_pre_uninit (); + +drm_dev_unref (ddev); }static int pdev_probe (struct platform_device *pdev)
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 01/60] drm/omap: Allocate drm_device earlier and unref it as last step
Hi,
Quoted 8 lines · Laurent Pinchart
From: Peter Ujfalusi <[email protected]>
If we allocate the
drm_deviceearlier we can just return the error code without the need to use goto.
Do the unref of thedrm_deviceas a last step when cleaning up. This will make thedrm_deviceavailable longer for us and makes sure that we only free up the memory when all other cleanups have been already done.
Quoted 5 lines
Signed-off-by Peter Ujfalusi <[email protected]>Reviewed-by Laurent Pinchart <[email protected]>Signed-off-by Tomi Valkeinen <[email protected]>Signed-off-by Laurent Pinchart <[email protected]>---
-- Sebastian
Quoted 89 lines
drivers/gpu/drm/omapdrm/omap_drv.c | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-)drivers/gpu/drm/omapdrm/omap_drv.c +13
-16@@ -525,6 +525,14 @@ static int omapdrm_init(struct omap_drm_private *priv, struct device *dev)DBG ("%s" ,dev_name (dev)); +/* Allocate and initialize the DRM device. */ + ddev =drm_dev_alloc (&omap_drm_driver, dev); +if (IS_ERR (ddev)) +return PTR_ERR (ddev); + + priv->ddev = ddev; + ddev->dev_private = priv; + priv->dev = dev; priv->dss =omapdss_get_dss (); priv->dispc =dispc_get_dispc (priv->dss);@@ -543,16 +551,6 @@ static int omapdrm_init(struct omap_drm_private *priv, struct device *dev)mutex_init (&priv->list_lock);INIT_LIST_HEAD (&priv->obj_list); -/* Allocate and initialize the DRM device. */ - ddev =drm_dev_alloc (&omap_drm_driver, priv->dev); -if (IS_ERR (ddev)) { - ret =PTR_ERR (ddev); - goto err_destroy_wq; - } - - priv->ddev = ddev; - ddev->dev_private = priv; -/* Get memory bandwidth limits */ if (priv->dispc_ops->get_memory_bandwidth_limit) priv->max_bandwidth =@@ -563,7 +561,7 @@ static int omapdrm_init(struct omap_drm_private *priv, struct device *dev) ret =omap_modeset_init (ddev);if (ret) {dev_err (priv->dev,"omap_modeset_init failed: ret=%d\n" , ret); - goto err_free_drm_dev; + goto err_gem_deinit; }/* Initialize vblank handling, start with all CRTCs disabled. */ @@ -599,14 +597,13 @@ static int omapdrm_init(struct omap_drm_private *priv, struct device *dev) err_cleanup_modeset:drm_mode_config_cleanup (ddev);omap_drm_irq_uninstall (ddev); -err_free_drm_dev: +err_gem_deinit:omap_gem_deinit (ddev); -drm_dev_unref (ddev); -err_destroy_wq:destroy_workqueue (priv->wq);omap_disconnect_dssdevs (); err_crtc_uninit:omap_crtc_pre_uninit (); +drm_dev_unref (ddev);return ret; }@@ -630,12 +627,12 @@ static void omapdrm_cleanup(struct omap_drm_private *priv)omap_drm_irq_uninstall (ddev);omap_gem_deinit (ddev); -drm_dev_unref (ddev); -destroy_workqueue (priv->wq);omap_disconnect_dssdevs ();omap_crtc_pre_uninit (); + +drm_dev_unref (ddev); }static int pdev_probe (struct platform_device *pdev)Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 2/60 drm/omap: Manage the usable omap_dss_device list within omap_drm_private
In reply to Laurent PinchartFrom: Peter Ujfalusi <[email protected]>
Instead of reaching back to DSS to iterate through the dss_devices every time, use an internal array where we store the available and usable dss_devices.
At the same time remove the omapdss_device_is_connected() check from omap_modeset_init() as it became irrelevant: We are not adding dssdevs if their connect failed.
---
Changes since v0:
- Make loop counter unsigned
--- drivers/gpu/drm/omapdrm/omap_drv.c | 94 ++++++++++++++++++++++++-------------- drivers/gpu/drm/omapdrm/omap_drv.h | 3 ++ 2 files changed, 62 insertions(+), 35 deletions(-)
drivers/gpu/drm/omapdrm/omap_drv.c +59 -35
@@ -149,18 +149,27 @@ static int get_connector_type(struct omap_dss_device *dssdev) } } -static void omap_disconnect_dssdevs (void ) +static void omap_disconnect_dssdevs (struct drm_device *ddev) { -struct omap_dss_device *dssdev =NULL ; +struct omap_drm_private *priv = ddev->dev_private; +unsigned int i; + +for (i =0 ; i < priv->num_dssdevs; i++) { +struct omap_dss_device *dssdev = priv->dssdevs[i]; -for_each_dss_dev (dssdev) dssdev->driver->disconnect (dssdev); + priv->dssdevs[i] =NULL ; +omap_dss_put_device (dssdev); + } + + priv->num_dssdevs =0 ; } -static int omap_connect_dssdevs (void ) +static int omap_connect_dssdevs (struct drm_device *ddev) { -int r; +struct omap_drm_private *priv = ddev->dev_private;struct omap_dss_device *dssdev =NULL ; +int r;if (!omapdss_stack_is_ready ())return -EPROBE_DEFER ;
@@ -173,6 +182,14 @@ static int omap_connect_dssdevs(void) }else if (r) {dev_warn (dssdev->dev,"could not connect display: %s\n" , dssdev->name); + }else { +omap_dss_get_device (dssdev); + priv->dssdevs[priv->num_dssdevs++] = dssdev; +if (priv->num_dssdevs ==ARRAY_SIZE (priv->dssdevs)) { +/* To balance the 'for_each_dss_dev' loop */ +omap_dss_put_device (dssdev); +break ; + } } }
@@ -183,7 +200,7 @@ static int omap_connect_dssdevs(void)* if we are deferring probe, we disconnect the devices we previously * connected */ -omap_disconnect_dssdevs (); +omap_disconnect_dssdevs (ddev);return r; }
@@ -208,6 +225,7 @@ static int omap_modeset_init(struct drm_device *dev)int num_ovls = priv->dispc_ops->get_num_ovls (priv->dispc);int num_mgrs = priv->dispc_ops->get_num_mgrs (priv->dispc);int num_crtcs, crtc_idx, plane_idx; +unsigned int i;int ret;u32 plane_crtc_mask;
@@ -225,11 +243,7 @@ static int omap_modeset_init(struct drm_device *dev)* configuration does not match the expectations or exceeds * the available resources, the configuration is rejected. */ - num_crtcs =0 ; -for_each_dss_dev (dssdev) -if (omapdss_device_is_connected (dssdev)) - num_crtcs++; - + num_crtcs = priv->num_dssdevs; if (num_crtcs > num_mgrs || num_crtcs > num_ovls || num_crtcs > ARRAY_SIZE(priv->crtcs) || num_crtcs > ARRAY_SIZE(priv->planes) ||
@@ -247,15 +261,13 @@ static int omap_modeset_init(struct drm_device *dev) crtc_idx =0 ; plane_idx =0 ; -for_each_dss_dev (dssdev) { +for (i =0 ; i < priv->num_dssdevs; i++) { +struct omap_dss_device *dssdev = priv->dssdevs[i];struct drm_connector *connector;struct drm_encoder *encoder;struct drm_plane *plane;struct drm_crtc *crtc; -if (!omapdss_device_is_connected (dssdev)) -continue ; - encoder =omap_encoder_init (dev, dssdev);if (!encoder)return -ENOMEM ;
@@ -335,11 +347,14 @@ static int omap_modeset_init(struct drm_device *dev)/* * Enable the HPD in external components if supported */ -static void omap_modeset_enable_external_hpd (void ) +static void omap_modeset_enable_external_hpd (struct drm_device *ddev) { -struct omap_dss_device *dssdev =NULL ; +struct omap_drm_private *priv = ddev->dev_private; +int i; + +for (i =0 ; i < priv->num_dssdevs; i++) { +struct omap_dss_device *dssdev = priv->dssdevs[i]; -for_each_dss_dev (dssdev) {if (dssdev->driver->enable_hpd) dssdev->driver->enable_hpd (dssdev); }
@@ -348,11 +363,14 @@ static void omap_modeset_enable_external_hpd(void)/* * Disable the HPD in external components if supported */ -static void omap_modeset_disable_external_hpd (void ) +static void omap_modeset_disable_external_hpd (struct drm_device *ddev) { -struct omap_dss_device *dssdev =NULL ; +struct omap_drm_private *priv = ddev->dev_private; +int i; + +for (i =0 ; i < priv->num_dssdevs; i++) { +struct omap_dss_device *dssdev = priv->dssdevs[i]; -for_each_dss_dev (dssdev) {if (dssdev->driver->disable_hpd) dssdev->driver->disable_hpd (dssdev); }
@@ -540,7 +558,7 @@ static int omapdrm_init(struct omap_drm_private *priv, struct device *dev)omap_crtc_pre_init (priv); - ret =omap_connect_dssdevs (); + ret =omap_connect_dssdevs (ddev);if (ret) goto err_crtc_uninit;
@@ -577,7 +595,7 @@ static int omapdrm_init(struct omap_drm_private *priv, struct device *dev)omap_fbdev_init (ddev);drm_kms_helper_poll_init (ddev); -omap_modeset_enable_external_hpd (); +omap_modeset_enable_external_hpd (ddev);/* * Register the DRM device with the core and the connectors with
@@ -590,7 +608,7 @@ static int omapdrm_init(struct omap_drm_private *priv, struct device *dev)return 0 ; err_cleanup_helpers: -omap_modeset_disable_external_hpd (); +omap_modeset_disable_external_hpd (ddev);drm_kms_helper_poll_fini (ddev);omap_fbdev_fini (ddev);
@@ -600,7 +618,7 @@ static int omapdrm_init(struct omap_drm_private *priv, struct device *dev) err_gem_deinit:omap_gem_deinit (ddev);destroy_workqueue (priv->wq); -omap_disconnect_dssdevs (); +omap_disconnect_dssdevs (ddev); err_crtc_uninit:omap_crtc_pre_uninit ();drm_dev_unref (ddev);
@@ -615,7 +633,7 @@ static void omapdrm_cleanup(struct omap_drm_private *priv)drm_dev_unregister (ddev); -omap_modeset_disable_external_hpd (); +omap_modeset_disable_external_hpd (ddev);drm_kms_helper_poll_fini (ddev);omap_fbdev_fini (ddev);
@@ -629,7 +647,7 @@ static void omapdrm_cleanup(struct omap_drm_private *priv)destroy_workqueue (priv->wq); -omap_disconnect_dssdevs (); +omap_disconnect_dssdevs (ddev);omap_crtc_pre_uninit ();drm_dev_unref (ddev);
@@ -674,11 +692,14 @@ static int pdev_remove(struct platform_device *pdev) }#ifdef CONFIG_PM_SLEEP -static int omap_drm_suspend_all_displays (void ) +static int omap_drm_suspend_all_displays (struct drm_device *ddev) { -struct omap_dss_device *dssdev =NULL ; +struct omap_drm_private *priv = ddev->dev_private; +int i; + +for (i =0 ; i < priv->num_dssdevs; i++) { +struct omap_dss_device *dssdev = priv->dssdevs[i]; -for_each_dss_dev (dssdev) {if (!dssdev->driver)continue ;
@@ -693,11 +714,14 @@ static int omap_drm_suspend_all_displays(void)return 0 ; } -static int omap_drm_resume_all_displays (void ) +static int omap_drm_resume_all_displays (struct drm_device *ddev) { -struct omap_dss_device *dssdev =NULL ; +struct omap_drm_private *priv = ddev->dev_private; +int i; + +for (i =0 ; i < priv->num_dssdevs; i++) { +struct omap_dss_device *dssdev = priv->dssdevs[i]; -for_each_dss_dev (dssdev) {if (!dssdev->driver)continue ;
@@ -718,7 +742,7 @@ static int omap_drm_suspend(struct device *dev)drm_kms_helper_poll_disable (drm_dev);drm_modeset_lock_all (drm_dev); -omap_drm_suspend_all_displays (); +omap_drm_suspend_all_displays (drm_dev);drm_modeset_unlock_all (drm_dev);return 0 ;
@@ -730,7 +754,7 @@ static int omap_drm_resume(struct device *dev)struct drm_device *drm_dev = priv->ddev;drm_modeset_lock_all (drm_dev); -omap_drm_resume_all_displays (); +omap_drm_resume_all_displays (drm_dev);drm_modeset_unlock_all (drm_dev);drm_kms_helper_poll_enable (drm_dev);
drivers/gpu/drm/omapdrm/omap_drv.h +3 -0
@@ -54,6 +54,9 @@ struct omap_drm_private {struct dispc_device *dispc;const struct dispc_ops *dispc_ops; +unsigned int num_dssdevs; +struct omap_dss_device *dssdevs[8 ]; +unsigned int num_crtcs;struct drm_crtc *crtcs[8 ];
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 02/60] drm/omap: Manage the usable omap_dss_device list within omap_drm_private
Hi,
Quoted 10 lines · Laurent Pinchart
From: Peter Ujfalusi <[email protected]>
Instead of reaching back to DSS to iterate through the
dss_devicesevery time, use an internal array where we store the available and usabledss_devices.At the same time remove the
omapdss_device_is_connected()check fromomap_modeset_init()as it became irrelevant: We are not adding dssdevs if their connect failed.
Quoted 5 lines
Signed-off-by Peter Ujfalusi <[email protected]>Signed-off-by Tomi Valkeinen <[email protected]>Reviewed-by Laurent Pinchart <[email protected]>Signed-off-by Laurent Pinchart <[email protected]>---
-- Sebastian
Quoted 275 lines
Changes since v0:
- Make loop counter unsigned
--- drivers/gpu/drm/omapdrm/omap_drv.c | 94 ++++++++++++++++++++++++-------------- drivers/gpu/drm/omapdrm/omap_drv.h | 3 ++ 2 files changed, 62 insertions(+), 35 deletions(-)drivers/gpu/drm/omapdrm/omap_drv.c +59
-35@@ -149,18 +149,27 @@ static int get_connector_type(struct omap_dss_device *dssdev) } } -static void omap_disconnect_dssdevs (void ) +static void omap_disconnect_dssdevs (struct drm_device *ddev) { -struct omap_dss_device *dssdev =NULL ; +struct omap_drm_private *priv = ddev->dev_private; +unsigned int i; + +for (i =0 ; i < priv->num_dssdevs; i++) { +struct omap_dss_device *dssdev = priv->dssdevs[i]; -for_each_dss_dev (dssdev) dssdev->driver->disconnect (dssdev); + priv->dssdevs[i] =NULL ; +omap_dss_put_device (dssdev); + } + + priv->num_dssdevs =0 ; } -static int omap_connect_dssdevs (void ) +static int omap_connect_dssdevs (struct drm_device *ddev) { -int r; +struct omap_drm_private *priv = ddev->dev_private;struct omap_dss_device *dssdev =NULL ; +int r;if (!omapdss_stack_is_ready ())return -EPROBE_DEFER ;@@ -173,6 +182,14 @@ static int omap_connect_dssdevs(void) }else if (r) {dev_warn (dssdev->dev,"could not connect display: %s\n" , dssdev->name); + }else { +omap_dss_get_device (dssdev); + priv->dssdevs[priv->num_dssdevs++] = dssdev; +if (priv->num_dssdevs ==ARRAY_SIZE (priv->dssdevs)) { +/* To balance the 'for_each_dss_dev' loop */ +omap_dss_put_device (dssdev); +break ; + } } }@@ -183,7 +200,7 @@ static int omap_connect_dssdevs(void)* if we are deferring probe, we disconnect the devices we previously * connected */ -omap_disconnect_dssdevs (); +omap_disconnect_dssdevs (ddev);return r; }@@ -208,6 +225,7 @@ static int omap_modeset_init(struct drm_device *dev)int num_ovls = priv->dispc_ops->get_num_ovls (priv->dispc);int num_mgrs = priv->dispc_ops->get_num_mgrs (priv->dispc);int num_crtcs, crtc_idx, plane_idx; +unsigned int i;int ret;u32 plane_crtc_mask;@@ -225,11 +243,7 @@ static int omap_modeset_init(struct drm_device *dev)* configuration does not match the expectations or exceeds * the available resources, the configuration is rejected. */ - num_crtcs =0 ; -for_each_dss_dev (dssdev) -if (omapdss_device_is_connected (dssdev)) - num_crtcs++; - + num_crtcs = priv->num_dssdevs; if (num_crtcs > num_mgrs || num_crtcs > num_ovls || num_crtcs > ARRAY_SIZE(priv->crtcs) || num_crtcs > ARRAY_SIZE(priv->planes) ||@@ -247,15 +261,13 @@ static int omap_modeset_init(struct drm_device *dev) crtc_idx =0 ; plane_idx =0 ; -for_each_dss_dev (dssdev) { +for (i =0 ; i < priv->num_dssdevs; i++) { +struct omap_dss_device *dssdev = priv->dssdevs[i];struct drm_connector *connector;struct drm_encoder *encoder;struct drm_plane *plane;struct drm_crtc *crtc; -if (!omapdss_device_is_connected (dssdev)) -continue ; - encoder =omap_encoder_init (dev, dssdev);if (!encoder)return -ENOMEM ;@@ -335,11 +347,14 @@ static int omap_modeset_init(struct drm_device *dev)/* * Enable the HPD in external components if supported */ -static void omap_modeset_enable_external_hpd (void ) +static void omap_modeset_enable_external_hpd (struct drm_device *ddev) { -struct omap_dss_device *dssdev =NULL ; +struct omap_drm_private *priv = ddev->dev_private; +int i; + +for (i =0 ; i < priv->num_dssdevs; i++) { +struct omap_dss_device *dssdev = priv->dssdevs[i]; -for_each_dss_dev (dssdev) {if (dssdev->driver->enable_hpd) dssdev->driver->enable_hpd (dssdev); }@@ -348,11 +363,14 @@ static void omap_modeset_enable_external_hpd(void)/* * Disable the HPD in external components if supported */ -static void omap_modeset_disable_external_hpd (void ) +static void omap_modeset_disable_external_hpd (struct drm_device *ddev) { -struct omap_dss_device *dssdev =NULL ; +struct omap_drm_private *priv = ddev->dev_private; +int i; + +for (i =0 ; i < priv->num_dssdevs; i++) { +struct omap_dss_device *dssdev = priv->dssdevs[i]; -for_each_dss_dev (dssdev) {if (dssdev->driver->disable_hpd) dssdev->driver->disable_hpd (dssdev); }@@ -540,7 +558,7 @@ static int omapdrm_init(struct omap_drm_private *priv, struct device *dev)omap_crtc_pre_init (priv); - ret =omap_connect_dssdevs (); + ret =omap_connect_dssdevs (ddev);if (ret) goto err_crtc_uninit;@@ -577,7 +595,7 @@ static int omapdrm_init(struct omap_drm_private *priv, struct device *dev)omap_fbdev_init (ddev);drm_kms_helper_poll_init (ddev); -omap_modeset_enable_external_hpd (); +omap_modeset_enable_external_hpd (ddev);/* * Register the DRM device with the core and the connectors with @@ -590,7 +608,7 @@ static int omapdrm_init(struct omap_drm_private *priv, struct device *dev)return 0 ; err_cleanup_helpers: -omap_modeset_disable_external_hpd (); +omap_modeset_disable_external_hpd (ddev);drm_kms_helper_poll_fini (ddev);omap_fbdev_fini (ddev);@@ -600,7 +618,7 @@ static int omapdrm_init(struct omap_drm_private *priv, struct device *dev) err_gem_deinit:omap_gem_deinit (ddev);destroy_workqueue (priv->wq); -omap_disconnect_dssdevs (); +omap_disconnect_dssdevs (ddev); err_crtc_uninit:omap_crtc_pre_uninit ();drm_dev_unref (ddev);@@ -615,7 +633,7 @@ static void omapdrm_cleanup(struct omap_drm_private *priv)drm_dev_unregister (ddev); -omap_modeset_disable_external_hpd (); +omap_modeset_disable_external_hpd (ddev);drm_kms_helper_poll_fini (ddev);omap_fbdev_fini (ddev);@@ -629,7 +647,7 @@ static void omapdrm_cleanup(struct omap_drm_private *priv)destroy_workqueue (priv->wq); -omap_disconnect_dssdevs (); +omap_disconnect_dssdevs (ddev);omap_crtc_pre_uninit ();drm_dev_unref (ddev);@@ -674,11 +692,14 @@ static int pdev_remove(struct platform_device *pdev) }#ifdef CONFIG_PM_SLEEP -static int omap_drm_suspend_all_displays (void ) +static int omap_drm_suspend_all_displays (struct drm_device *ddev) { -struct omap_dss_device *dssdev =NULL ; +struct omap_drm_private *priv = ddev->dev_private; +int i; + +for (i =0 ; i < priv->num_dssdevs; i++) { +struct omap_dss_device *dssdev = priv->dssdevs[i]; -for_each_dss_dev (dssdev) {if (!dssdev->driver)continue ;@@ -693,11 +714,14 @@ static int omap_drm_suspend_all_displays(void)return 0 ; } -static int omap_drm_resume_all_displays (void ) +static int omap_drm_resume_all_displays (struct drm_device *ddev) { -struct omap_dss_device *dssdev =NULL ; +struct omap_drm_private *priv = ddev->dev_private; +int i; + +for (i =0 ; i < priv->num_dssdevs; i++) { +struct omap_dss_device *dssdev = priv->dssdevs[i]; -for_each_dss_dev (dssdev) {if (!dssdev->driver)continue ;@@ -718,7 +742,7 @@ static int omap_drm_suspend(struct device *dev)drm_kms_helper_poll_disable (drm_dev);drm_modeset_lock_all (drm_dev); -omap_drm_suspend_all_displays (); +omap_drm_suspend_all_displays (drm_dev);drm_modeset_unlock_all (drm_dev);return 0 ;@@ -730,7 +754,7 @@ static int omap_drm_resume(struct device *dev)struct drm_device *drm_dev = priv->ddev;drm_modeset_lock_all (drm_dev); -omap_drm_resume_all_displays (); +omap_drm_resume_all_displays (drm_dev);drm_modeset_unlock_all (drm_dev);drm_kms_helper_poll_enable (drm_dev);drivers/gpu/drm/omapdrm/omap_drv.h +3
-0@@ -54,6 +54,9 @@ struct omap_drm_private {struct dispc_device *dispc;const struct dispc_ops *dispc_ops; +unsigned int num_dssdevs; +struct omap_dss_device *dssdevs[8 ]; +unsigned int num_crtcs;struct drm_crtc *crtcs[8 ];Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 3/60 drm/omap: Do dss_device (display) ordering in omap_drv.c
In reply to Laurent PinchartFrom: Peter Ujfalusi <[email protected]>
Sort the dssdev array based on DT aliases.
With this change we can remove the panel ordering from dss/display.c and have all sorting related to dssdevs in one place.
---
Changes since v0:
- Make alias_id unsigned
--- drivers/gpu/drm/omapdrm/dss/display.c | 2 ++ drivers/gpu/drm/omapdrm/dss/omapdss.h | 1 + drivers/gpu/drm/omapdrm/omap_drv.c | 18 ++++++++++++++++++ 3 files changed, 21 insertions(+)
drivers/gpu/drm/omapdrm/dss/display.c +2 -0
@@ -52,6 +52,8 @@ int omapdss_register_display(struct omap_dss_device *dssdev)if (id <0 ) id = disp_num_counter++; + dssdev->alias_id = id; +snprintf (dssdev->alias,sizeof (dssdev->alias),"display%d" , id);/* Use 'label' property for name, if it exists */
drivers/gpu/drm/omapdrm/dss/omapdss.h +1 -0
@@ -467,6 +467,7 @@ struct omap_dss_device {/* alias in the form of "display%d" */ char alias[16 ]; +unsigned int alias_id;enum omap_display_type type;enum omap_display_type output_type;
drivers/gpu/drm/omapdrm/omap_drv.c +18 -0
@@ -15,6 +15,8 @@* this program. If not, see <http://www.gnu.org/licenses/>. */ +#include <linux/of.h> +#include <linux/sort.h> #include <linux/sys_soc.h> #include <drm/drm_atomic.h>
@@ -165,6 +167,18 @@ static void omap_disconnect_dssdevs(struct drm_device *ddev) priv->num_dssdevs =0 ; } +static int omap_compare_dssdevs (const void *a,const void *b) +{ +const struct omap_dss_device *dssdev1 = *(struct omap_dss_device **)a; +const struct omap_dss_device *dssdev2 = *(struct omap_dss_device **)b; + +if (dssdev1->alias_id > dssdev2->alias_id) +return 1 ; +else if (dssdev1->alias_id < dssdev2->alias_id) +return -1 ; +return 0 ; +} +static int omap_connect_dssdevs (struct drm_device *ddev) {struct omap_drm_private *priv = ddev->dev_private;
@@ -193,6 +207,10 @@ static int omap_connect_dssdevs(struct drm_device *ddev) } } +/* Sort the list by DT aliases */ +sort (priv->dssdevs, priv->num_dssdevs,sizeof (priv->dssdevs[0 ]), + omap_compare_dssdevs,NULL ); +return 0 ; cleanup:
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 03/60] drm/omap: Do dss_device (display) ordering in omap_drv.c
Hi,
Quoted 4 lines · Laurent Pinchart
From: Peter Ujfalusi <[email protected]>
Sort the dssdev array based on DT aliases.
Quoted 8 lines
With this change we can remove the panel ordering from
dss/display.cand have all sorting related to dssdevs in one place.Signed-off-by Peter Ujfalusi <[email protected]>Signed-off-by Tomi Valkeinen <[email protected]>Reviewed-by Laurent Pinchart <[email protected]>Signed-off-by Laurent Pinchart <[email protected]>---
-- Sebastian
Quoted 86 lines
Changes since v0:
- Make
alias_idunsigned--- drivers/gpu/drm/omapdrm/dss/display.c | 2 ++ drivers/gpu/drm/omapdrm/dss/omapdss.h | 1 + drivers/gpu/drm/omapdrm/omap_drv.c | 18 ++++++++++++++++++ 3 files changed, 21 insertions(+)drivers/gpu/drm/omapdrm/dss/display.c +2
-0@@ -52,6 +52,8 @@ int omapdss_register_display(struct omap_dss_device *dssdev)if (id <0 ) id = disp_num_counter++; + dssdev->alias_id = id; +snprintf (dssdev->alias,sizeof (dssdev->alias),"display%d" , id);/* Use 'label' property for name, if it exists */ drivers/gpu/drm/omapdrm/dss/omapdss.h +1
-0@@ -467,6 +467,7 @@ struct omap_dss_device {/* alias in the form of "display%d" */ char alias[16 ]; +unsigned int alias_id;enum omap_display_type type;enum omap_display_type output_type;drivers/gpu/drm/omapdrm/omap_drv.c +18
-0@@ -15,6 +15,8 @@* this program. If not, see <http://www.gnu.org/licenses/>. */ +#include <linux/of.h> +#include <linux/sort.h> #include <linux/sys_soc.h> #include <drm/drm_atomic.h> @@ -165,6 +167,18 @@ static void omap_disconnect_dssdevs(struct drm_device *ddev) priv->num_dssdevs =0 ; } +static int omap_compare_dssdevs (const void *a,const void *b) +{ +const struct omap_dss_device *dssdev1 = *(struct omap_dss_device **)a; +const struct omap_dss_device *dssdev2 = *(struct omap_dss_device **)b; + +if (dssdev1->alias_id > dssdev2->alias_id) +return 1 ; +else if (dssdev1->alias_id < dssdev2->alias_id) +return -1 ; +return 0 ; +} +static int omap_connect_dssdevs (struct drm_device *ddev) {struct omap_drm_private *priv = ddev->dev_private;@@ -193,6 +207,10 @@ static int omap_connect_dssdevs(struct drm_device *ddev) } } +/* Sort the list by DT aliases */ +sort (priv->dssdevs, priv->num_dssdevs,sizeof (priv->dssdevs[0 ]), + omap_compare_dssdevs,NULL ); +return 0 ; cleanup:Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 4/60 drm/omap: dss: Remove display ordering from dss/display.c
In reply to Laurent PinchartFrom: Peter Ujfalusi <[email protected]>
As ordering of the dss_devices based on DT aliases is now implemented in omap_drm.c, there is no need to do the ordering in dss/display.c anymore.
At the same time remove the alias member of the omap_dss_device struct since it is no longer needed. The only place it was used is in the omapdss_register_display() function.
---
Changes since v0:
- Use %u to format display ID
--- drivers/gpu/drm/omapdrm/dss/display.c | 15 +++------------ drivers/gpu/drm/omapdrm/dss/omapdss.h | 2 -- 2 files changed, 3 insertions(+), 14 deletions(-)
drivers/gpu/drm/omapdrm/dss/display.c +3 -12
@@ -41,7 +41,6 @@ static int disp_num_counter;int omapdss_register_display (struct omap_dss_device *dssdev) {struct omap_dss_driver *drv = dssdev->driver; -struct list_head *cur;int id;/*
@@ -54,26 +53,18 @@ int omapdss_register_display(struct omap_dss_device *dssdev) dssdev->alias_id = id; -snprintf (dssdev->alias,sizeof (dssdev->alias),"display%d" , id); -/* Use 'label' property for name, if it exists */ of_property_read_string (dssdev->dev->of_node,"label" , &dssdev->name);if (dssdev->name ==NULL ) - dssdev->name = dssdev->alias; + dssdev->name =devm_kasprintf (dssdev->dev,GFP_KERNEL , +"display%u" , id);if (drv && drv->get_timings ==NULL ) drv->get_timings = omapdss_default_get_timings;mutex_lock (&panel_list_mutex); -list_for_each (cur, &panel_list) { -struct omap_dss_device *ldev =list_entry (cur, - struct omap_dss_device, - panel_list); -if (strcmp (ldev->alias, dssdev->alias) >0 ) -break ; - } -list_add_tail (&dssdev->panel_list, cur); +list_add_tail (&dssdev->panel_list, &panel_list);mutex_unlock (&panel_list_mutex);return 0 ; }
drivers/gpu/drm/omapdrm/dss/omapdss.h +0 -2
@@ -465,8 +465,6 @@ struct omap_dss_device {struct list_head panel_list; -/* alias in the form of "display%d" */ -char alias[16 ];unsigned int alias_id;enum omap_display_type type;
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 04/60] drm/omap: dss: Remove display ordering from dss/display.c
Hi,
Quoted 10 lines · Laurent Pinchart
From: Peter Ujfalusi <[email protected]>
As ordering of the
dss_devicesbased on DT aliases is now implemented inomap_drm.c, there is no need to do the ordering indss/display.canymore.At the same time remove the alias member of the
omap_dss_devicestruct since it is no longer needed. The only place it was used is in theomapdss_register_display()function.
Quoted 5 lines
Signed-off-by Peter Ujfalusi <[email protected]>Signed-off-by Tomi Valkeinen <[email protected]>Reviewed-by Laurent Pinchart <[email protected]>Signed-off-by Laurent Pinchart <[email protected]>---
-- Sebastian
Quoted 72 lines
Changes since v0:
- Use %u to format display ID
--- drivers/gpu/drm/omapdrm/dss/display.c | 15 +++------------ drivers/gpu/drm/omapdrm/dss/omapdss.h | 2 -- 2 files changed, 3 insertions(+), 14 deletions(-)drivers/gpu/drm/omapdrm/dss/display.c +3
-12@@ -41,7 +41,6 @@ static int disp_num_counter;int omapdss_register_display (struct omap_dss_device *dssdev) {struct omap_dss_driver *drv = dssdev->driver; -struct list_head *cur;int id;/* @@ -54,26 +53,18 @@ int omapdss_register_display(struct omap_dss_device *dssdev) dssdev->alias_id = id; -snprintf (dssdev->alias,sizeof (dssdev->alias),"display%d" , id); -/* Use 'label' property for name, if it exists */ of_property_read_string (dssdev->dev->of_node,"label" , &dssdev->name);if (dssdev->name ==NULL ) - dssdev->name = dssdev->alias; + dssdev->name =devm_kasprintf (dssdev->dev,GFP_KERNEL , +"display%u" , id);if (drv && drv->get_timings ==NULL ) drv->get_timings = omapdss_default_get_timings;mutex_lock (&panel_list_mutex); -list_for_each (cur, &panel_list) { -struct omap_dss_device *ldev =list_entry (cur, - struct omap_dss_device, - panel_list); -if (strcmp (ldev->alias, dssdev->alias) >0 ) -break ; - } -list_add_tail (&dssdev->panel_list, cur); +list_add_tail (&dssdev->panel_list, &panel_list);mutex_unlock (&panel_list_mutex);return 0 ; }drivers/gpu/drm/omapdrm/dss/omapdss.h +0
-2@@ -465,8 +465,6 @@ struct omap_dss_device {struct list_head panel_list; -/* alias in the form of "display%d" */ -char alias[16 ];unsigned int alias_id;enum omap_display_type type;Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 5/60 drm/omap: dss: Gather OMAP DSS components at probe time
In reply to Laurent PinchartThe omapdss_gather_components() function walks the OF graph to create a list of all components part of the display device. There's no need to delay this operation until DSS bind time as we have all the information we need at probe time.
--- drivers/gpu/drm/omapdrm/dss/dss.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/omapdrm/dss/dss.c +2 -1
@@ -1323,7 +1323,6 @@ static int dss_bind(struct device *dev)pm_set_vt_switch (0 ); -omapdss_gather_components (dev);omapdss_set_dss (dss);return 0 ;
@@ -1474,6 +1473,8 @@ static int dss_probe(struct platform_device *pdev) dss);/* Add all the child devices as components. */ +omapdss_gather_components (&pdev->dev); +device_for_each_child (&pdev->dev, &match, dss_add_child_component); r =component_master_add_with_match (&pdev->dev, &dss_component_ops, match);
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 05/60] drm/omap: dss: Gather OMAP DSS components at probe time
Hi,
Quoted 7 lines · Laurent Pinchart
The
omapdss_gather_components()function walks the OF graph to create a list of all components part of the display device. There's no need to delay this operation until DSS bind time as we have all the information we need at probe time.Signed-off-by Laurent Pinchart <[email protected]>---
-- Sebastian
Quoted 33 lines
drivers/gpu/drm/omapdrm/dss/dss.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/gpu/drm/omapdrm/dss/dss.c +2
-1@@ -1323,7 +1323,6 @@ static int dss_bind(struct device *dev)pm_set_vt_switch (0 ); -omapdss_gather_components (dev);omapdss_set_dss (dss);return 0 ;@@ -1474,6 +1473,8 @@ static int dss_probe(struct platform_device *pdev) dss);/* Add all the child devices as components. */ +omapdss_gather_components (&pdev->dev); +device_for_each_child (&pdev->dev, &match, dss_add_child_component); r =component_master_add_with_match (&pdev->dev, &dss_component_ops, match);Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 6/60 drm/omap: dss: Move platform_device_register from core.c to dss.c probe
In reply to Laurent PinchartFrom: Jyri Sarha <[email protected]>
Register the omapdrm device when we know that dss device probe going to succeed. This avoids DSS6 and DSS2 omapdrm device registration from colliding with each other.
---
Changes since v0:
- Store the OMAP DRM platform device pointer in struct dss_device
- Register the OMAP DRM platform device at the very end of dss_bind()
--- drivers/gpu/drm/omapdrm/dss/core.c | 26 ++------------------------ drivers/gpu/drm/omapdrm/dss/dss.c | 13 +++++++++++++ drivers/gpu/drm/omapdrm/dss/dss.h | 2 ++ 3 files changed, 17 insertions(+), 24 deletions(-)
drivers/gpu/drm/omapdrm/dss/core.c +2 -24
@@ -45,36 +45,14 @@ static struct platform_driver * const omap_dss_drivers[] = {#endif }; -static struct platform_device *omap_drm_device; -static int __init omap_dss_init (void ) { -int r; - - r =platform_register_drivers (omap_dss_drivers, -ARRAY_SIZE (omap_dss_drivers)); -if (r) - goto err_reg; - - omap_drm_device =platform_device_register_simple ("omapdrm" ,0 ,NULL ,0 ); -if (IS_ERR (omap_drm_device)) { - r =PTR_ERR (omap_drm_device); - goto err_reg; - } - -return 0 ; - -err_reg: -platform_unregister_drivers (omap_dss_drivers, -ARRAY_SIZE (omap_dss_drivers)); - -return r; +return platform_register_drivers (omap_dss_drivers, +ARRAY_SIZE (omap_dss_drivers)); } static void __exit omap_dss_exit(void) { -platform_device_unregister (omap_drm_device); -platform_unregister_drivers (omap_dss_drivers,ARRAY_SIZE (omap_dss_drivers)); }
drivers/gpu/drm/omapdrm/dss/dss.c +13 -0
@@ -1315,6 +1315,7 @@ static const struct soc_device_attribute dss_soc_devices[] = {static int dss_bind (struct device *dev) {struct dss_device *dss =dev_get_drvdata (dev); +struct platform_device *drm_pdev;int r; r =component_bind_all (dev,NULL );
@@ -1325,11 +1326,23 @@ static int dss_bind(struct device *dev)omapdss_set_dss (dss); + drm_pdev =platform_device_register_simple ("omapdrm" ,0 ,NULL ,0 ); +if (IS_ERR (drm_pdev)) { +component_unbind_all (dev,NULL ); +return PTR_ERR (drm_pdev); + } + + dss->drm_pdev = drm_pdev; +return 0 ; }static void dss_unbind (struct device *dev) { +struct dss_device *dss =dev_get_drvdata (dev); + +platform_device_unregister (dss->drm_pdev); +omapdss_set_dss (NULL );component_unbind_all (dev,NULL );
drivers/gpu/drm/omapdrm/dss/dss.h +2 -0
@@ -235,6 +235,8 @@ struct dss_device {struct regmap *syscon_pll_ctrl;u32 syscon_pll_ctrl_offset; +struct platform_device *drm_pdev; +struct clk *parent_clk;struct clk *dss_clk;unsigned long dss_clk_rate;
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 06/60] drm/omap: dss: Move platform_device_register from core.c to dss.c probe
Hi,
Quoted 9 lines · Laurent Pinchart
From: Jyri Sarha <[email protected]>
Register the omapdrm device when we know that dss device probe going to succeed. This avoids DSS6 and DSS2 omapdrm device registration from colliding with each other.
Signed-off-by Jyri Sarha <[email protected]>Signed-off-by Laurent Pinchart <[email protected]>---
-- Sebastian
Quoted 111 lines
Changes since v0:
- Store the OMAP DRM platform device pointer in struct
dss_device
- Register the OMAP DRM platform device at the very end ofdss_bind()--- drivers/gpu/drm/omapdrm/dss/core.c | 26 ++------------------------ drivers/gpu/drm/omapdrm/dss/dss.c | 13 +++++++++++++ drivers/gpu/drm/omapdrm/dss/dss.h | 2 ++ 3 files changed, 17 insertions(+), 24 deletions(-)drivers/gpu/drm/omapdrm/dss/core.c +2
-24@@ -45,36 +45,14 @@ static struct platform_driver * const omap_dss_drivers[] = {#endif }; -static struct platform_device *omap_drm_device; -static int __init omap_dss_init (void ) { -int r; - - r =platform_register_drivers (omap_dss_drivers, -ARRAY_SIZE (omap_dss_drivers)); -if (r) - goto err_reg; - - omap_drm_device =platform_device_register_simple ("omapdrm" ,0 ,NULL ,0 ); -if (IS_ERR (omap_drm_device)) { - r =PTR_ERR (omap_drm_device); - goto err_reg; - } - -return 0 ; - -err_reg: -platform_unregister_drivers (omap_dss_drivers, -ARRAY_SIZE (omap_dss_drivers)); - -return r; +return platform_register_drivers (omap_dss_drivers, +ARRAY_SIZE (omap_dss_drivers)); } static void __exit omap_dss_exit(void) { -platform_device_unregister (omap_drm_device); -platform_unregister_drivers (omap_dss_drivers,ARRAY_SIZE (omap_dss_drivers)); }drivers/gpu/drm/omapdrm/dss/dss.c +13
-0@@ -1315,6 +1315,7 @@ static const struct soc_device_attribute dss_soc_devices[] = {static int dss_bind (struct device *dev) {struct dss_device *dss =dev_get_drvdata (dev); +struct platform_device *drm_pdev;int r; r =component_bind_all (dev,NULL );@@ -1325,11 +1326,23 @@ static int dss_bind(struct device *dev)omapdss_set_dss (dss); + drm_pdev =platform_device_register_simple ("omapdrm" ,0 ,NULL ,0 ); +if (IS_ERR (drm_pdev)) { +component_unbind_all (dev,NULL ); +return PTR_ERR (drm_pdev); + } + + dss->drm_pdev = drm_pdev; +return 0 ; }static void dss_unbind (struct device *dev) { +struct dss_device *dss =dev_get_drvdata (dev); + +platform_device_unregister (dss->drm_pdev); +omapdss_set_dss (NULL );component_unbind_all (dev,NULL );drivers/gpu/drm/omapdrm/dss/dss.h +2
-0@@ -235,6 +235,8 @@ struct dss_device {struct regmap *syscon_pll_ctrl;u32 syscon_pll_ctrl_offset; +struct platform_device *drm_pdev; +struct clk *parent_clk;struct clk *dss_clk;unsigned long dss_clk_rate;Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 7/60 drm/omap: dss: Handle DPI and SDI port initialization failures
In reply to Laurent PinchartThe dpi_init_port() and sdi_init_port() functions can return errors but their return value is ignored. This prevents both probe failures and probe deferral from working correctly. Propagate the errors up the call stack.
--- drivers/gpu/drm/omapdrm/dss/dss.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
drivers/gpu/drm/omapdrm/dss/dss.c +10 -3
@@ -1183,7 +1183,8 @@ static int dss_init_ports(struct dss_device *dss)struct platform_device *pdev = dss->pdev;struct device_node *parent = pdev->dev.of_node;struct device_node *port; -int i; +unsigned int i; +int r;for (i =0 ; i < dss->feat->num_ports; i++) { port =of_graph_get_port_by_id (parent, i);
@@ -1192,11 +1193,17 @@ static int dss_init_ports(struct dss_device *dss)switch (dss->feat->ports[i]) {case OMAP_DISPLAY_TYPE_DPI : -dpi_init_port (dss, pdev, port, dss->feat->model); + r =dpi_init_port (dss, pdev, port, dss->feat->model); +if (r) +return r;break ; +case OMAP_DISPLAY_TYPE_SDI : -sdi_init_port (dss, pdev, port); + r =sdi_init_port (dss, pdev, port); +if (r) +return r;break ; +default :break ; }
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 07/60] drm/omap: dss: Handle DPI and SDI port initialization failures
Quoted 7 lines · Laurent Pinchart
The
dpi_init_port()andsdi_init_port()functions can return errors but their return value is ignored. This prevents both probe failures and probe deferral from working correctly. Propagate the errors up the call stack.Signed-off-by Laurent Pinchart <[email protected]>---
-- Sebastian
Quoted 46 lines
drivers/gpu/drm/omapdrm/dss/dss.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)drivers/gpu/drm/omapdrm/dss/dss.c +10
-3@@ -1183,7 +1183,8 @@ static int dss_init_ports(struct dss_device *dss)struct platform_device *pdev = dss->pdev;struct device_node *parent = pdev->dev.of_node;struct device_node *port; -int i; +unsigned int i; +int r;for (i =0 ; i < dss->feat->num_ports; i++) { port =of_graph_get_port_by_id (parent, i);@@ -1192,11 +1193,17 @@ static int dss_init_ports(struct dss_device *dss)switch (dss->feat->ports[i]) {case OMAP_DISPLAY_TYPE_DPI : -dpi_init_port (dss, pdev, port, dss->feat->model); + r =dpi_init_port (dss, pdev, port, dss->feat->model); +if (r) +return r;break ; +case OMAP_DISPLAY_TYPE_SDI : -sdi_init_port (dss, pdev, port); + r =sdi_init_port (dss, pdev, port); +if (r) +return r;break ; +default :break ; }Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 8/60 drm/omap: dss: Remove omapdss_atv_ops get_wss and set_wss operations
In reply to Laurent PinchartThe operations are never used, remove them. If the need to set wide screen signaling data arises later, it should be implemented by extending the DRM bridge API.
--- .../gpu/drm/omapdrm/displays/connector-analog-tv.c | 19 ---------- drivers/gpu/drm/omapdrm/dss/omapdss.h | 6 ---- drivers/gpu/drm/omapdrm/dss/venc.c | 41 ---------------------- 3 files changed, 66 deletions(-)
drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c +0 -19
@@ -154,22 +154,6 @@ static int tvc_check_timings(struct omap_dss_device *dssdev,return in->ops.atv->check_timings (in, vm); } -static u32 tvc_get_wss (struct omap_dss_device *dssdev) -{ -struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; - -return in->ops.atv->get_wss (in); -} - -static int tvc_set_wss (struct omap_dss_device *dssdev,u32 wss) -{ -struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; - -return in->ops.atv->set_wss (in, wss); -} -static struct omap_dss_driver tvc_driver = { .connect = tvc_connect, .disconnect = tvc_disconnect,
@@ -180,9 +164,6 @@ static struct omap_dss_driver tvc_driver = { .set_timings = tvc_set_timings, .get_timings = tvc_get_timings, .check_timings = tvc_check_timings, - - .get_wss = tvc_get_wss, - .set_wss = tvc_set_wss, };static int tvc_probe (struct platform_device *pdev)
drivers/gpu/drm/omapdrm/dss/omapdss.h +0 -6
@@ -362,9 +362,6 @@ struct omapdss_atv_ops { struct videomode *vm);void (*get_timings)(struct omap_dss_device *dssdev,struct videomode *vm); - -int (*set_wss)(struct omap_dss_device *dssdev,u32 wss); -u32 (*get_wss)(struct omap_dss_device *dssdev); };struct omapdss_hdmi_ops {
@@ -554,9 +551,6 @@ struct omap_dss_driver {void (*get_size)(struct omap_dss_device *dssdev,unsigned int *width,unsigned int *height); -int (*set_wss)(struct omap_dss_device *dssdev,u32 wss); -u32 (*get_wss)(struct omap_dss_device *dssdev); -int (*read_edid)(struct omap_dss_device *dssdev,u8 *buf,int len);bool (*detect)(struct omap_dss_device *dssdev);
drivers/gpu/drm/omapdrm/dss/venc.c +0 -41
53 lines not on this page · raw message
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 08/60] drm/omap: dss: Remove omapdss_atv_ops get_wss and set_wss operations
Hi,
Quoted 6 lines · Laurent Pinchart
The operations are never used, remove them. If the need to set wide screen signaling data arises later, it should be implemented by extending the DRM bridge API.
Signed-off-by Laurent Pinchart <[email protected]>---
-- Sebastian
Quoted 134 lines
.../gpu/drm/omapdrm/displays/connector-analog-tv.c | 19 ---------- drivers/gpu/drm/omapdrm/dss/omapdss.h | 6 ---- drivers/gpu/drm/omapdrm/dss/venc.c | 41 ---------------------- 3 files changed, 66 deletions(-)drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c +0
-19@@ -154,22 +154,6 @@ static int tvc_check_timings(struct omap_dss_device *dssdev,return in->ops.atv->check_timings (in, vm); } -static u32 tvc_get_wss (struct omap_dss_device *dssdev) -{ -struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; - -return in->ops.atv->get_wss (in); -} - -static int tvc_set_wss (struct omap_dss_device *dssdev,u32 wss) -{ -struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; - -return in->ops.atv->set_wss (in, wss); -} -static struct omap_dss_driver tvc_driver = { .connect = tvc_connect, .disconnect = tvc_disconnect,@@ -180,9 +164,6 @@ static struct omap_dss_driver tvc_driver = { .set_timings = tvc_set_timings, .get_timings = tvc_get_timings, .check_timings = tvc_check_timings, - - .get_wss = tvc_get_wss, - .set_wss = tvc_set_wss, };static int tvc_probe (struct platform_device *pdev)drivers/gpu/drm/omapdrm/dss/omapdss.h +0
-6@@ -362,9 +362,6 @@ struct omapdss_atv_ops { struct videomode *vm);void (*get_timings)(struct omap_dss_device *dssdev,struct videomode *vm); - -int (*set_wss)(struct omap_dss_device *dssdev,u32 wss); -u32 (*get_wss)(struct omap_dss_device *dssdev); };struct omapdss_hdmi_ops {@@ -554,9 +551,6 @@ struct omap_dss_driver {void (*get_size)(struct omap_dss_device *dssdev,unsigned int *width,unsigned int *height); -int (*set_wss)(struct omap_dss_device *dssdev,u32 wss); -u32 (*get_wss)(struct omap_dss_device *dssdev); -int (*read_edid)(struct omap_dss_device *dssdev,u8 *buf,int len);bool (*detect)(struct omap_dss_device *dssdev);drivers/gpu/drm/omapdrm/dss/venc.c +0
-41@@ -626,44 +626,6 @@ static void venc_get_timings(struct omap_dss_device *dssdev,mutex_unlock (&venc->venc_lock); } -static u32 venc_get_wss (struct omap_dss_device *dssdev) -{ -struct venc_device *venc =dssdev_to_venc (dssdev); - -/* Invert due to VENC_L21_WC_CTL:INV=1 */ -return (venc->wss_data >>8 ) ^0xfffff ; -} - -static int venc_set_wss (struct omap_dss_device *dssdev,u32 wss) -{ -struct venc_device *venc =dssdev_to_venc (dssdev); -const struct venc_config *config; -int r; - -DSSDBG ("venc_set_wss\n" ); - -mutex_lock (&venc->venc_lock); - - config =venc_timings_to_config (&venc->vm); - -/* Invert due to VENC_L21_WC_CTL:INV=1 */ - venc->wss_data = (wss ^0xfffff ) <<8 ; - - r =venc_runtime_get (venc); -if (r) - goto err; - -venc_write_reg (venc,VENC_BSTAMP_WSS_DATA , config->bstamp_wss_data | - venc->wss_data); - -venc_runtime_put (venc); - -err: -mutex_unlock (&venc->venc_lock); - -return r; -} -static int venc_init_regulator (struct venc_device *venc) {struct regulator *vdda_dac;@@ -810,9 +772,6 @@ static const struct omapdss_atv_ops venc_ops = { .check_timings = venc_check_timings, .set_timings = venc_set_timings, .get_timings = venc_get_timings, - - .set_wss = venc_set_wss, - .get_wss = venc_get_wss, };static void venc_init_output (struct venc_device *venc)Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 9/60 drm/omap: dss: Remove DSS encoders get_timings operation
In reply to Laurent PinchartThe get_timings operation from DSS encoders (not to be confused with the identically named operation in omap_dss_driver) is never called. Remove it.
--- drivers/gpu/drm/omapdrm/displays/encoder-opa362.c | 11 ----------- drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c | 9 --------- drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c | 9 --------- drivers/gpu/drm/omapdrm/dss/dpi.c | 13 ------------- drivers/gpu/drm/omapdrm/dss/hdmi4.c | 9 --------- drivers/gpu/drm/omapdrm/dss/hdmi5.c | 9 --------- drivers/gpu/drm/omapdrm/dss/omapdss.h | 10 ---------- drivers/gpu/drm/omapdrm/dss/sdi.c | 9 --------- drivers/gpu/drm/omapdrm/dss/venc.c | 13 ------------- 9 files changed, 92 deletions(-)
drivers/gpu/drm/omapdrm/displays/encoder-opa362.c +0 -11
@@ -148,16 +148,6 @@ static void opa362_set_timings(struct omap_dss_device *dssdev, in->ops.atv->set_timings (in, vm); } -static void opa362_get_timings (struct omap_dss_device *dssdev, -struct videomode *vm) -{ -struct panel_drv_data *ddata =to_panel_data (dssdev); - -dev_dbg (dssdev->dev,"get_timings\n" ); - - *vm = ddata->vm; -} -static int opa362_check_timings (struct omap_dss_device *dssdev,struct videomode *vm) {
@@ -178,7 +168,6 @@ static const struct omapdss_atv_ops opa362_atv_ops = { .check_timings = opa362_check_timings, .set_timings = opa362_set_timings, - .get_timings = opa362_get_timings, };static int opa362_probe (struct platform_device *pdev)
drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c +0 -9
@@ -142,14 +142,6 @@ static void tfp410_set_timings(struct omap_dss_device *dssdev, in->ops.dpi->set_timings (in, vm); } -static void tfp410_get_timings (struct omap_dss_device *dssdev, -struct videomode *vm) -{ -struct panel_drv_data *ddata =to_panel_data (dssdev); - - *vm = ddata->vm; -} -static int tfp410_check_timings (struct omap_dss_device *dssdev,struct videomode *vm) {
@@ -170,7 +162,6 @@ static const struct omapdss_dvi_ops tfp410_dvi_ops = { .check_timings = tfp410_check_timings, .set_timings = tfp410_set_timings, - .get_timings = tfp410_get_timings, };static int tfp410_probe_of (struct platform_device *pdev)
drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c +0 -9
@@ -136,14 +136,6 @@ static void tpd_set_timings(struct omap_dss_device *dssdev, in->ops.hdmi->set_timings (in, vm); } -static void tpd_get_timings (struct omap_dss_device *dssdev, -struct videomode *vm) -{ -struct panel_drv_data *ddata =to_panel_data (dssdev); - - *vm = ddata->vm; -} -static int tpd_check_timings (struct omap_dss_device *dssdev,struct videomode *vm) {
@@ -249,7 +241,6 @@ static const struct omapdss_hdmi_ops tpd_hdmi_ops = { .check_timings = tpd_check_timings, .set_timings = tpd_set_timings, - .get_timings = tpd_get_timings, .read_edid = tpd_read_edid, .detect = tpd_detect,
drivers/gpu/drm/omapdrm/dss/dpi.c +0 -13
@@ -491,18 +491,6 @@ static void dpi_set_timings(struct omap_dss_device *dssdev,mutex_unlock (&dpi->lock); } -static void dpi_get_timings (struct omap_dss_device *dssdev, -struct videomode *vm) -{ -struct dpi_data *dpi =dpi_get_data_from_dssdev (dssdev); - -mutex_lock (&dpi->lock); - - *vm = dpi->vm; - -mutex_unlock (&dpi->lock); -} -static int dpi_check_timings (struct omap_dss_device *dssdev,struct videomode *vm) {
@@ -702,7 +690,6 @@ static const struct omapdss_dpi_ops dpi_ops = { .check_timings = dpi_check_timings, .set_timings = dpi_set_timings, - .get_timings = dpi_get_timings, };static void dpi_init_output_port (struct dpi_data *dpi,struct device_node *port)
drivers/gpu/drm/omapdrm/dss/hdmi4.c +0 -9
@@ -296,14 +296,6 @@ static void hdmi_display_set_timing(struct omap_dss_device *dssdev,mutex_unlock (&hdmi->lock); } -static void hdmi_display_get_timings (struct omap_dss_device *dssdev, -struct videomode *vm) -{ -struct omap_hdmi *hdmi =dssdev_to_hdmi (dssdev); - - *vm = hdmi->cfg.vm; -} -static int hdmi_dump_regs (struct seq_file *s,void *p) {struct omap_hdmi *hdmi = s->private;
@@ -557,7 +549,6 @@ static const struct omapdss_hdmi_ops hdmi_ops = { .check_timings = hdmi_display_check_timing, .set_timings = hdmi_display_set_timing, - .get_timings = hdmi_display_get_timings, .read_edid = hdmi_read_edid, .lost_hotplug = hdmi_lost_hotplug,
drivers/gpu/drm/omapdrm/dss/hdmi5.c +0 -9
@@ -293,14 +293,6 @@ static void hdmi_display_set_timing(struct omap_dss_device *dssdev,mutex_unlock (&hdmi->lock); } -static void hdmi_display_get_timings (struct omap_dss_device *dssdev, -struct videomode *vm) -{ -struct omap_hdmi *hdmi =dssdev_to_hdmi (dssdev); - - *vm = hdmi->cfg.vm; -} -static int hdmi_dump_regs (struct seq_file *s,void *p) {struct omap_hdmi *hdmi = s->private;
@@ -549,7 +541,6 @@ static const struct omapdss_hdmi_ops hdmi_ops = { .check_timings = hdmi_display_check_timing, .set_timings = hdmi_display_set_timing, - .get_timings = hdmi_display_get_timings, .read_edid = hdmi_read_edid, .set_infoframe = hdmi_set_infoframe,
drivers/gpu/drm/omapdrm/dss/omapdss.h +0 -10
@@ -309,8 +309,6 @@ struct omapdss_dpi_ops { struct videomode *vm);void (*set_timings)(struct omap_dss_device *dssdev,struct videomode *vm); -void (*get_timings)(struct omap_dss_device *dssdev, -struct videomode *vm); };struct omapdss_sdi_ops {
@@ -326,8 +324,6 @@ struct omapdss_sdi_ops { struct videomode *vm);void (*set_timings)(struct omap_dss_device *dssdev,struct videomode *vm); -void (*get_timings)(struct omap_dss_device *dssdev, -struct videomode *vm); };struct omapdss_dvi_ops {
@@ -343,8 +339,6 @@ struct omapdss_dvi_ops { struct videomode *vm);void (*set_timings)(struct omap_dss_device *dssdev,struct videomode *vm); -void (*get_timings)(struct omap_dss_device *dssdev, -struct videomode *vm); };struct omapdss_atv_ops {
@@ -360,8 +354,6 @@ struct omapdss_atv_ops { struct videomode *vm);void (*set_timings)(struct omap_dss_device *dssdev,struct videomode *vm); -void (*get_timings)(struct omap_dss_device *dssdev, -struct videomode *vm); };struct omapdss_hdmi_ops {
@@ -377,8 +369,6 @@ struct omapdss_hdmi_ops { struct videomode *vm);void (*set_timings)(struct omap_dss_device *dssdev,struct videomode *vm); -void (*get_timings)(struct omap_dss_device *dssdev, -struct videomode *vm);int (*read_edid)(struct omap_dss_device *dssdev,u8 *buf,int len);void (*lost_hotplug)(struct omap_dss_device *dssdev);
drivers/gpu/drm/omapdrm/dss/sdi.c +0 -9
@@ -234,14 +234,6 @@ static void sdi_set_timings(struct omap_dss_device *dssdev, sdi->vm = *vm; } -static void sdi_get_timings (struct omap_dss_device *dssdev, -struct videomode *vm) -{ -struct sdi_device *sdi =dssdev_to_sdi (dssdev); - - *vm = sdi->vm; -} -static int sdi_check_timings (struct omap_dss_device *dssdev,struct videomode *vm) {
@@ -325,7 +317,6 @@ static const struct omapdss_sdi_ops sdi_ops = { .check_timings = sdi_check_timings, .set_timings = sdi_set_timings, - .get_timings = sdi_get_timings, };static void sdi_init_output (struct sdi_device *sdi)
drivers/gpu/drm/omapdrm/dss/venc.c +0 -13
@@ -614,18 +614,6 @@ static int venc_check_timings(struct omap_dss_device *dssdev, } } -static void venc_get_timings (struct omap_dss_device *dssdev, -struct videomode *vm) -{ -struct venc_device *venc =dssdev_to_venc (dssdev); - -mutex_lock (&venc->venc_lock); - - *vm = venc->vm; - -mutex_unlock (&venc->venc_lock); -} -static int venc_init_regulator (struct venc_device *venc) {struct regulator *vdda_dac;
@@ -771,7 +759,6 @@ static const struct omapdss_atv_ops venc_ops = { .check_timings = venc_check_timings, .set_timings = venc_set_timings, - .get_timings = venc_get_timings, };static void venc_init_output (struct venc_device *venc)
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 09/60] drm/omap: dss: Remove DSS encoders get_timings operation
Hi,
Quoted 6 lines · Laurent Pinchart
The
get_timingsoperation from DSS encoders (not to be confused with the identically named operation inomap_dss_driver) is never called. Remove it.Signed-off-by Laurent Pinchart <[email protected]>---
good catch!
-- Sebastian
Quoted 295 lines
drivers/gpu/drm/omapdrm/displays/encoder-opa362.c | 11 ----------- drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c | 9 --------- drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c | 9 --------- drivers/gpu/drm/omapdrm/dss/dpi.c | 13 ------------- drivers/gpu/drm/omapdrm/dss/hdmi4.c | 9 --------- drivers/gpu/drm/omapdrm/dss/hdmi5.c | 9 --------- drivers/gpu/drm/omapdrm/dss/omapdss.h | 10 ---------- drivers/gpu/drm/omapdrm/dss/sdi.c | 9 --------- drivers/gpu/drm/omapdrm/dss/venc.c | 13 ------------- 9 files changed, 92 deletions(-)drivers/gpu/drm/omapdrm/displays/encoder-opa362.c +0
-11@@ -148,16 +148,6 @@ static void opa362_set_timings(struct omap_dss_device *dssdev, in->ops.atv->set_timings (in, vm); } -static void opa362_get_timings (struct omap_dss_device *dssdev, -struct videomode *vm) -{ -struct panel_drv_data *ddata =to_panel_data (dssdev); - -dev_dbg (dssdev->dev,"get_timings\n" ); - - *vm = ddata->vm; -} -static int opa362_check_timings (struct omap_dss_device *dssdev,struct videomode *vm) {@@ -178,7 +168,6 @@ static const struct omapdss_atv_ops opa362_atv_ops = { .check_timings = opa362_check_timings, .set_timings = opa362_set_timings, - .get_timings = opa362_get_timings, };static int opa362_probe (struct platform_device *pdev)drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c +0
-9@@ -142,14 +142,6 @@ static void tfp410_set_timings(struct omap_dss_device *dssdev, in->ops.dpi->set_timings (in, vm); } -static void tfp410_get_timings (struct omap_dss_device *dssdev, -struct videomode *vm) -{ -struct panel_drv_data *ddata =to_panel_data (dssdev); - - *vm = ddata->vm; -} -static int tfp410_check_timings (struct omap_dss_device *dssdev,struct videomode *vm) {@@ -170,7 +162,6 @@ static const struct omapdss_dvi_ops tfp410_dvi_ops = { .check_timings = tfp410_check_timings, .set_timings = tfp410_set_timings, - .get_timings = tfp410_get_timings, };static int tfp410_probe_of (struct platform_device *pdev)drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c +0
-9@@ -136,14 +136,6 @@ static void tpd_set_timings(struct omap_dss_device *dssdev, in->ops.hdmi->set_timings (in, vm); } -static void tpd_get_timings (struct omap_dss_device *dssdev, -struct videomode *vm) -{ -struct panel_drv_data *ddata =to_panel_data (dssdev); - - *vm = ddata->vm; -} -static int tpd_check_timings (struct omap_dss_device *dssdev,struct videomode *vm) {@@ -249,7 +241,6 @@ static const struct omapdss_hdmi_ops tpd_hdmi_ops = { .check_timings = tpd_check_timings, .set_timings = tpd_set_timings, - .get_timings = tpd_get_timings, .read_edid = tpd_read_edid, .detect = tpd_detect,drivers/gpu/drm/omapdrm/dss/dpi.c +0
-13@@ -491,18 +491,6 @@ static void dpi_set_timings(struct omap_dss_device *dssdev,mutex_unlock (&dpi->lock); } -static void dpi_get_timings (struct omap_dss_device *dssdev, -struct videomode *vm) -{ -struct dpi_data *dpi =dpi_get_data_from_dssdev (dssdev); - -mutex_lock (&dpi->lock); - - *vm = dpi->vm; - -mutex_unlock (&dpi->lock); -} -static int dpi_check_timings (struct omap_dss_device *dssdev,struct videomode *vm) {@@ -702,7 +690,6 @@ static const struct omapdss_dpi_ops dpi_ops = { .check_timings = dpi_check_timings, .set_timings = dpi_set_timings, - .get_timings = dpi_get_timings, };static void dpi_init_output_port (struct dpi_data *dpi,struct device_node *port)drivers/gpu/drm/omapdrm/dss/hdmi4.c +0
-9@@ -296,14 +296,6 @@ static void hdmi_display_set_timing(struct omap_dss_device *dssdev,mutex_unlock (&hdmi->lock); } -static void hdmi_display_get_timings (struct omap_dss_device *dssdev, -struct videomode *vm) -{ -struct omap_hdmi *hdmi =dssdev_to_hdmi (dssdev); - - *vm = hdmi->cfg.vm; -} -static int hdmi_dump_regs (struct seq_file *s,void *p) {struct omap_hdmi *hdmi = s->private;@@ -557,7 +549,6 @@ static const struct omapdss_hdmi_ops hdmi_ops = { .check_timings = hdmi_display_check_timing, .set_timings = hdmi_display_set_timing, - .get_timings = hdmi_display_get_timings, .read_edid = hdmi_read_edid, .lost_hotplug = hdmi_lost_hotplug,drivers/gpu/drm/omapdrm/dss/hdmi5.c +0
-9@@ -293,14 +293,6 @@ static void hdmi_display_set_timing(struct omap_dss_device *dssdev,mutex_unlock (&hdmi->lock); } -static void hdmi_display_get_timings (struct omap_dss_device *dssdev, -struct videomode *vm) -{ -struct omap_hdmi *hdmi =dssdev_to_hdmi (dssdev); - - *vm = hdmi->cfg.vm; -} -static int hdmi_dump_regs (struct seq_file *s,void *p) {struct omap_hdmi *hdmi = s->private;@@ -549,7 +541,6 @@ static const struct omapdss_hdmi_ops hdmi_ops = { .check_timings = hdmi_display_check_timing, .set_timings = hdmi_display_set_timing, - .get_timings = hdmi_display_get_timings, .read_edid = hdmi_read_edid, .set_infoframe = hdmi_set_infoframe,drivers/gpu/drm/omapdrm/dss/omapdss.h +0
-10@@ -309,8 +309,6 @@ struct omapdss_dpi_ops { struct videomode *vm);void (*set_timings)(struct omap_dss_device *dssdev,struct videomode *vm); -void (*get_timings)(struct omap_dss_device *dssdev, -struct videomode *vm); };struct omapdss_sdi_ops {@@ -326,8 +324,6 @@ struct omapdss_sdi_ops { struct videomode *vm);void (*set_timings)(struct omap_dss_device *dssdev,struct videomode *vm); -void (*get_timings)(struct omap_dss_device *dssdev, -struct videomode *vm); };struct omapdss_dvi_ops {@@ -343,8 +339,6 @@ struct omapdss_dvi_ops { struct videomode *vm);void (*set_timings)(struct omap_dss_device *dssdev,struct videomode *vm); -void (*get_timings)(struct omap_dss_device *dssdev, -struct videomode *vm); };struct omapdss_atv_ops {@@ -360,8 +354,6 @@ struct omapdss_atv_ops { struct videomode *vm);void (*set_timings)(struct omap_dss_device *dssdev,struct videomode *vm); -void (*get_timings)(struct omap_dss_device *dssdev, -struct videomode *vm); };struct omapdss_hdmi_ops {@@ -377,8 +369,6 @@ struct omapdss_hdmi_ops { struct videomode *vm);void (*set_timings)(struct omap_dss_device *dssdev,struct videomode *vm); -void (*get_timings)(struct omap_dss_device *dssdev, -struct videomode *vm);int (*read_edid)(struct omap_dss_device *dssdev,u8 *buf,int len);void (*lost_hotplug)(struct omap_dss_device *dssdev);drivers/gpu/drm/omapdrm/dss/sdi.c +0
-9@@ -234,14 +234,6 @@ static void sdi_set_timings(struct omap_dss_device *dssdev, sdi->vm = *vm; } -static void sdi_get_timings (struct omap_dss_device *dssdev, -struct videomode *vm) -{ -struct sdi_device *sdi =dssdev_to_sdi (dssdev); - - *vm = sdi->vm; -} -static int sdi_check_timings (struct omap_dss_device *dssdev,struct videomode *vm) {@@ -325,7 +317,6 @@ static const struct omapdss_sdi_ops sdi_ops = { .check_timings = sdi_check_timings, .set_timings = sdi_set_timings, - .get_timings = sdi_get_timings, };static void sdi_init_output (struct sdi_device *sdi)drivers/gpu/drm/omapdrm/dss/venc.c +0
-13@@ -614,18 +614,6 @@ static int venc_check_timings(struct omap_dss_device *dssdev, } } -static void venc_get_timings (struct omap_dss_device *dssdev, -struct videomode *vm) -{ -struct venc_device *venc =dssdev_to_venc (dssdev); - -mutex_lock (&venc->venc_lock); - - *vm = venc->vm; - -mutex_unlock (&venc->venc_lock); -} -static int venc_init_regulator (struct venc_device *venc) {struct regulator *vdda_dac;@@ -771,7 +759,6 @@ static const struct omapdss_atv_ops venc_ops = { .check_timings = venc_check_timings, .set_timings = venc_set_timings, - .get_timings = venc_get_timings, };static void venc_init_output (struct venc_device *venc)Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 10/60 drm/omap: dss: Remove unused omapdss_default_get_timings()
In reply to Laurent PinchartAll omap_dss_driver instances provide the get_timings operation. Remove the default function.
--- drivers/gpu/drm/omapdrm/dss/display.c | 10 ---------- 1 file changed, 10 deletions(-)
drivers/gpu/drm/omapdrm/dss/display.c +0 -10
@@ -28,19 +28,12 @@#include "omapdss.h" -static void omapdss_default_get_timings (struct omap_dss_device *dssdev, -struct videomode *vm) -{ - *vm = dssdev->panel.vm; -} -static LIST_HEAD (panel_list);static DEFINE_MUTEX (panel_list_mutex);static int disp_num_counter;int omapdss_register_display (struct omap_dss_device *dssdev) { -struct omap_dss_driver *drv = dssdev->driver;int id;/*
@@ -60,9 +53,6 @@ int omapdss_register_display(struct omap_dss_device *dssdev) dssdev->name =devm_kasprintf (dssdev->dev,GFP_KERNEL ,"display%u" , id); -if (drv && drv->get_timings ==NULL ) - drv->get_timings = omapdss_default_get_timings; -mutex_lock (&panel_list_mutex);list_add_tail (&dssdev->panel_list, &panel_list);mutex_unlock (&panel_list_mutex);
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 10/60] drm/omap: dss: Remove unused omapdss_default_get_timings()
Hi,
Quoted 5 lines · Laurent Pinchart
All
omap_dss_driverinstances provide theget_timingsoperation. Remove the default function.Signed-off-by Laurent Pinchart <[email protected]>---
-- Sebastian
Quoted 46 lines
drivers/gpu/drm/omapdrm/dss/display.c | 10 ---------- 1 file changed, 10 deletions(-)drivers/gpu/drm/omapdrm/dss/display.c +0
-10@@ -28,19 +28,12 @@#include "omapdss.h" -static void omapdss_default_get_timings (struct omap_dss_device *dssdev, -struct videomode *vm) -{ - *vm = dssdev->panel.vm; -} -static LIST_HEAD (panel_list);static DEFINE_MUTEX (panel_list_mutex);static int disp_num_counter;int omapdss_register_display (struct omap_dss_device *dssdev) { -struct omap_dss_driver *drv = dssdev->driver;int id;/* @@ -60,9 +53,6 @@ int omapdss_register_display(struct omap_dss_device *dssdev) dssdev->name =devm_kasprintf (dssdev->dev,GFP_KERNEL ,"display%u" , id); -if (drv && drv->get_timings ==NULL ) - drv->get_timings = omapdss_default_get_timings; -mutex_lock (&panel_list_mutex);list_add_tail (&dssdev->panel_list, &panel_list);mutex_unlock (&panel_list_mutex);Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 11/60 drm/omap: dss: Constify omap_dss_driver operations structure
In reply to Laurent PinchartThe structure contains function pointers that don't need to be modified. Make all its instances const to improve security.
--- drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c | 2 +- drivers/gpu/drm/omapdrm/displays/connector-dvi.c | 2 +- drivers/gpu/drm/omapdrm/displays/connector-hdmi.c | 2 +- drivers/gpu/drm/omapdrm/displays/panel-dpi.c | 2 +- drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 2 +- drivers/gpu/drm/omapdrm/displays/panel-lgphilips-lb035q02.c | 2 +- drivers/gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c | 2 +- drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c | 2 +- drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c | 2 +- drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c | 2 +- drivers/gpu/drm/omapdrm/displays/panel-tpo-td043mtea1.c | 2 +- drivers/gpu/drm/omapdrm/dss/omapdss.h | 2 +- drivers/gpu/drm/omapdrm/omap_connector.c | 6 +++--- drivers/gpu/drm/omapdrm/omap_encoder.c | 6 +++--- 14 files changed, 18 insertions(+), 18 deletions(-)
drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c +1 -1
@@ -154,7 +154,7 @@ static int tvc_check_timings(struct omap_dss_device *dssdev,return in->ops.atv->check_timings (in, vm); } -static struct omap_dss_driver tvc_driver = { +static const struct omap_dss_driver tvc_driver = { .connect = tvc_connect, .disconnect = tvc_disconnect,
drivers/gpu/drm/omapdrm/displays/connector-dvi.c +1 -1
@@ -297,7 +297,7 @@ static void dvic_disable_hpd(struct omap_dss_device *dssdev)mutex_unlock (&ddata->hpd_lock); } -static struct omap_dss_driver dvic_driver = { +static const struct omap_dss_driver dvic_driver = { .connect = dvic_connect, .disconnect = dvic_disconnect,
drivers/gpu/drm/omapdrm/displays/connector-hdmi.c +1 -1
@@ -269,7 +269,7 @@ static int hdmic_set_infoframe(struct omap_dss_device *dssdev,return in->ops.hdmi->set_infoframe (in, avi); } -static struct omap_dss_driver hdmic_driver = { +static const struct omap_dss_driver hdmic_driver = { .connect = hdmic_connect, .disconnect = hdmic_disconnect,
drivers/gpu/drm/omapdrm/displays/panel-dpi.c +1 -1
@@ -153,7 +153,7 @@ static int panel_dpi_check_timings(struct omap_dss_device *dssdev,return in->ops.dpi->check_timings (in, vm); } -static struct omap_dss_driver panel_dpi_ops = { +static const struct omap_dss_driver panel_dpi_ops = { .connect = panel_dpi_connect, .disconnect = panel_dpi_disconnect,
drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +1 -1
@@ -1210,7 +1210,7 @@ static void dsicm_get_size(struct omap_dss_device *dssdev, *height = ddata->height_mm; } -static struct omap_dss_driver dsicm_ops = { +static const struct omap_dss_driver dsicm_ops = { .connect = dsicm_connect, .disconnect = dsicm_disconnect,
drivers/gpu/drm/omapdrm/displays/panel-lgphilips-lb035q02.c +1 -1
@@ -228,7 +228,7 @@ static int lb035q02_check_timings(struct omap_dss_device *dssdev,return in->ops.dpi->check_timings (in, vm); } -static struct omap_dss_driver lb035q02_ops = { +static const struct omap_dss_driver lb035q02_ops = { .connect = lb035q02_connect, .disconnect = lb035q02_disconnect,
drivers/gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c +1 -1
@@ -222,7 +222,7 @@ static int nec_8048_check_timings(struct omap_dss_device *dssdev,return in->ops.dpi->check_timings (in, vm); } -static struct omap_dss_driver nec_8048_ops = { +static const struct omap_dss_driver nec_8048_ops = { .connect = nec_8048_connect, .disconnect = nec_8048_disconnect,
drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c +1 -1
@@ -192,7 +192,7 @@ static int sharp_ls_check_timings(struct omap_dss_device *dssdev,return in->ops.dpi->check_timings (in, vm); } -static struct omap_dss_driver sharp_ls_ops = { +static const struct omap_dss_driver sharp_ls_ops = { .connect = sharp_ls_connect, .disconnect = sharp_ls_disconnect,
drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c +1 -1
@@ -693,7 +693,7 @@ static int acx565akm_check_timings(struct omap_dss_device *dssdev,return in->ops.sdi->check_timings (in, vm); } -static struct omap_dss_driver acx565akm_ops = { +static const struct omap_dss_driver acx565akm_ops = { .connect = acx565akm_connect, .disconnect = acx565akm_disconnect,
drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c +1 -1
@@ -362,7 +362,7 @@ static int td028ttec1_panel_check_timings(struct omap_dss_device *dssdev,return in->ops.dpi->check_timings (in, vm); } -static struct omap_dss_driver td028ttec1_ops = { +static const struct omap_dss_driver td028ttec1_ops = { .connect = td028ttec1_panel_connect, .disconnect = td028ttec1_panel_disconnect,
drivers/gpu/drm/omapdrm/displays/panel-tpo-td043mtea1.c +1 -1
@@ -456,7 +456,7 @@ static int tpo_td043_check_timings(struct omap_dss_device *dssdev,return in->ops.dpi->check_timings (in, vm); } -static struct omap_dss_driver tpo_td043_ops = { +static const struct omap_dss_driver tpo_td043_ops = { .connect = tpo_td043_connect, .disconnect = tpo_td043_disconnect,
drivers/gpu/drm/omapdrm/dss/omapdss.h +1 -1
@@ -466,7 +466,7 @@ struct omap_dss_device {const char *name; -struct omap_dss_driver *driver; +const struct omap_dss_driver *driver;union {const struct omapdss_dpi_ops *dpi;
drivers/gpu/drm/omapdrm/omap_connector.c +3 -3
@@ -62,7 +62,7 @@ static enum drm_connector_status omap_connector_detect( {struct omap_connector *omap_connector =to_omap_connector (connector);struct omap_dss_device *dssdev = omap_connector->dssdev; -struct omap_dss_driver *dssdrv = dssdev->driver; +const struct omap_dss_driver *dssdrv = dssdev->driver;enum drm_connector_status ret;if (dssdrv->detect) {
@@ -107,7 +107,7 @@ static int omap_connector_get_modes(struct drm_connector *connector) {struct omap_connector *omap_connector =to_omap_connector (connector);struct omap_dss_device *dssdev = omap_connector->dssdev; -struct omap_dss_driver *dssdrv = dssdev->driver; +const struct omap_dss_driver *dssdrv = dssdev->driver;struct drm_device *dev = connector->dev;int n =0 ;
@@ -170,7 +170,7 @@ static int omap_connector_mode_valid(struct drm_connector *connector, {struct omap_connector *omap_connector =to_omap_connector (connector);struct omap_dss_device *dssdev = omap_connector->dssdev; -struct omap_dss_driver *dssdrv = dssdev->driver; +const struct omap_dss_driver *dssdrv = dssdev->driver;struct videomode vm = {0 };struct drm_device *dev = connector->dev;struct drm_display_mode *new_mode;
drivers/gpu/drm/omapdrm/omap_encoder.c +3 -3
@@ -94,7 +94,7 @@ static void omap_encoder_disable(struct drm_encoder *encoder) {struct omap_encoder *omap_encoder =to_omap_encoder (encoder);struct omap_dss_device *dssdev = omap_encoder->dssdev; -struct omap_dss_driver *dssdrv = dssdev->driver; +const struct omap_dss_driver *dssdrv = dssdev->driver; dssdrv->disable (dssdev); }
@@ -106,7 +106,7 @@ static int omap_encoder_update(struct drm_encoder *encoder,struct drm_device *dev = encoder->dev;struct omap_encoder *omap_encoder =to_omap_encoder (encoder);struct omap_dss_device *dssdev = omap_encoder->dssdev; -struct omap_dss_driver *dssdrv = dssdev->driver; +const struct omap_dss_driver *dssdrv = dssdev->driver;int ret;if (dssdrv->check_timings) {
@@ -137,7 +137,7 @@ static void omap_encoder_enable(struct drm_encoder *encoder) {struct omap_encoder *omap_encoder =to_omap_encoder (encoder);struct omap_dss_device *dssdev = omap_encoder->dssdev; -struct omap_dss_driver *dssdrv = dssdev->driver; +const struct omap_dss_driver *dssdrv = dssdev->driver;int r; omap_encoder_update(encoder, omap_crtc_channel(encoder->crtc),
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 11/60] drm/omap: dss: Constify omap_dss_driver operations structure
Hi,
Quoted 5 lines · Laurent Pinchart
The structure contains function pointers that don't need to be modified. Make all its instances const to improve security.
Signed-off-by Laurent Pinchart <[email protected]>---
-- Sebastian
Quoted 243 lines
drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c | 2 +- drivers/gpu/drm/omapdrm/displays/connector-dvi.c | 2 +- drivers/gpu/drm/omapdrm/displays/connector-hdmi.c | 2 +- drivers/gpu/drm/omapdrm/displays/panel-dpi.c | 2 +- drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 2 +- drivers/gpu/drm/omapdrm/displays/panel-lgphilips-lb035q02.c | 2 +- drivers/gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c | 2 +- drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c | 2 +- drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c | 2 +- drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c | 2 +- drivers/gpu/drm/omapdrm/displays/panel-tpo-td043mtea1.c | 2 +- drivers/gpu/drm/omapdrm/dss/omapdss.h | 2 +- drivers/gpu/drm/omapdrm/omap_connector.c | 6 +++--- drivers/gpu/drm/omapdrm/omap_encoder.c | 6 +++--- 14 files changed, 18 insertions(+), 18 deletions(-)drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c +1
-1@@ -154,7 +154,7 @@ static int tvc_check_timings(struct omap_dss_device *dssdev,return in->ops.atv->check_timings (in, vm); } -static struct omap_dss_driver tvc_driver = { +static const struct omap_dss_driver tvc_driver = { .connect = tvc_connect, .disconnect = tvc_disconnect,drivers/gpu/drm/omapdrm/displays/connector-dvi.c +1
-1@@ -297,7 +297,7 @@ static void dvic_disable_hpd(struct omap_dss_device *dssdev)mutex_unlock (&ddata->hpd_lock); } -static struct omap_dss_driver dvic_driver = { +static const struct omap_dss_driver dvic_driver = { .connect = dvic_connect, .disconnect = dvic_disconnect,drivers/gpu/drm/omapdrm/displays/connector-hdmi.c +1
-1@@ -269,7 +269,7 @@ static int hdmic_set_infoframe(struct omap_dss_device *dssdev,return in->ops.hdmi->set_infoframe (in, avi); } -static struct omap_dss_driver hdmic_driver = { +static const struct omap_dss_driver hdmic_driver = { .connect = hdmic_connect, .disconnect = hdmic_disconnect,drivers/gpu/drm/omapdrm/displays/panel-dpi.c +1
-1@@ -153,7 +153,7 @@ static int panel_dpi_check_timings(struct omap_dss_device *dssdev,return in->ops.dpi->check_timings (in, vm); } -static struct omap_dss_driver panel_dpi_ops = { +static const struct omap_dss_driver panel_dpi_ops = { .connect = panel_dpi_connect, .disconnect = panel_dpi_disconnect,drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +1
-1@@ -1210,7 +1210,7 @@ static void dsicm_get_size(struct omap_dss_device *dssdev, *height = ddata->height_mm; } -static struct omap_dss_driver dsicm_ops = { +static const struct omap_dss_driver dsicm_ops = { .connect = dsicm_connect, .disconnect = dsicm_disconnect,drivers/gpu/drm/omapdrm/displays/panel-lgphilips-lb035q02.c +1
-1@@ -228,7 +228,7 @@ static int lb035q02_check_timings(struct omap_dss_device *dssdev,return in->ops.dpi->check_timings (in, vm); } -static struct omap_dss_driver lb035q02_ops = { +static const struct omap_dss_driver lb035q02_ops = { .connect = lb035q02_connect, .disconnect = lb035q02_disconnect,drivers/gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c +1
-1@@ -222,7 +222,7 @@ static int nec_8048_check_timings(struct omap_dss_device *dssdev,return in->ops.dpi->check_timings (in, vm); } -static struct omap_dss_driver nec_8048_ops = { +static const struct omap_dss_driver nec_8048_ops = { .connect = nec_8048_connect, .disconnect = nec_8048_disconnect,drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c +1
-1@@ -192,7 +192,7 @@ static int sharp_ls_check_timings(struct omap_dss_device *dssdev,return in->ops.dpi->check_timings (in, vm); } -static struct omap_dss_driver sharp_ls_ops = { +static const struct omap_dss_driver sharp_ls_ops = { .connect = sharp_ls_connect, .disconnect = sharp_ls_disconnect,drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c +1
-1@@ -693,7 +693,7 @@ static int acx565akm_check_timings(struct omap_dss_device *dssdev,return in->ops.sdi->check_timings (in, vm); } -static struct omap_dss_driver acx565akm_ops = { +static const struct omap_dss_driver acx565akm_ops = { .connect = acx565akm_connect, .disconnect = acx565akm_disconnect,drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c +1
-1@@ -362,7 +362,7 @@ static int td028ttec1_panel_check_timings(struct omap_dss_device *dssdev,return in->ops.dpi->check_timings (in, vm); } -static struct omap_dss_driver td028ttec1_ops = { +static const struct omap_dss_driver td028ttec1_ops = { .connect = td028ttec1_panel_connect, .disconnect = td028ttec1_panel_disconnect,drivers/gpu/drm/omapdrm/displays/panel-tpo-td043mtea1.c +1
-1@@ -456,7 +456,7 @@ static int tpo_td043_check_timings(struct omap_dss_device *dssdev,return in->ops.dpi->check_timings (in, vm); } -static struct omap_dss_driver tpo_td043_ops = { +static const struct omap_dss_driver tpo_td043_ops = { .connect = tpo_td043_connect, .disconnect = tpo_td043_disconnect,drivers/gpu/drm/omapdrm/dss/omapdss.h +1
-1@@ -466,7 +466,7 @@ struct omap_dss_device {const char *name; -struct omap_dss_driver *driver; +const struct omap_dss_driver *driver;union {const struct omapdss_dpi_ops *dpi;drivers/gpu/drm/omapdrm/omap_connector.c +3
-3@@ -62,7 +62,7 @@ static enum drm_connector_status omap_connector_detect( {struct omap_connector *omap_connector =to_omap_connector (connector);struct omap_dss_device *dssdev = omap_connector->dssdev; -struct omap_dss_driver *dssdrv = dssdev->driver; +const struct omap_dss_driver *dssdrv = dssdev->driver;enum drm_connector_status ret;if (dssdrv->detect) {@@ -107,7 +107,7 @@ static int omap_connector_get_modes(struct drm_connector *connector) {struct omap_connector *omap_connector =to_omap_connector (connector);struct omap_dss_device *dssdev = omap_connector->dssdev; -struct omap_dss_driver *dssdrv = dssdev->driver; +const struct omap_dss_driver *dssdrv = dssdev->driver;struct drm_device *dev = connector->dev;int n =0 ;@@ -170,7 +170,7 @@ static int omap_connector_mode_valid(struct drm_connector *connector, {struct omap_connector *omap_connector =to_omap_connector (connector);struct omap_dss_device *dssdev = omap_connector->dssdev; -struct omap_dss_driver *dssdrv = dssdev->driver; +const struct omap_dss_driver *dssdrv = dssdev->driver;struct videomode vm = {0 };struct drm_device *dev = connector->dev;struct drm_display_mode *new_mode;drivers/gpu/drm/omapdrm/omap_encoder.c +3
-3@@ -94,7 +94,7 @@ static void omap_encoder_disable(struct drm_encoder *encoder) {struct omap_encoder *omap_encoder =to_omap_encoder (encoder);struct omap_dss_device *dssdev = omap_encoder->dssdev; -struct omap_dss_driver *dssdrv = dssdev->driver; +const struct omap_dss_driver *dssdrv = dssdev->driver; dssdrv->disable (dssdev); }@@ -106,7 +106,7 @@ static int omap_encoder_update(struct drm_encoder *encoder,struct drm_device *dev = encoder->dev;struct omap_encoder *omap_encoder =to_omap_encoder (encoder);struct omap_dss_device *dssdev = omap_encoder->dssdev; -struct omap_dss_driver *dssdrv = dssdev->driver; +const struct omap_dss_driver *dssdrv = dssdev->driver;int ret;if (dssdrv->check_timings) {@@ -137,7 +137,7 @@ static void omap_encoder_enable(struct drm_encoder *encoder) {struct omap_encoder *omap_encoder =to_omap_encoder (encoder);struct omap_dss_device *dssdev = omap_encoder->dssdev; -struct omap_dss_driver *dssdrv = dssdev->driver; +const struct omap_dss_driver *dssdrv = dssdev->driver;int r; omap_encoder_update(encoder, omap_crtc_channel(encoder->crtc),Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 12/60 drm/omap: displays: Remove videomode from omap_dss_device structure
In reply to Laurent PinchartThe omap_dss_device structure stores a videomode. All the connector and panel drivers that use omap_dss_device also store the videomode in their own panel_drv_data structures. There's no need to duplicate, remove the videomode field from omap_dss_device.
--- drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c | 2 -- drivers/gpu/drm/omapdrm/displays/connector-dvi.c | 2 -- drivers/gpu/drm/omapdrm/displays/connector-hdmi.c | 2 -- drivers/gpu/drm/omapdrm/displays/encoder-opa362.c | 1 - drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c | 1 - drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c | 1 - drivers/gpu/drm/omapdrm/displays/panel-dpi.c | 2 -- drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 8 +++----- drivers/gpu/drm/omapdrm/displays/panel-lgphilips-lb035q02.c | 2 -- drivers/gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c | 2 -- drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c | 2 -- drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c | 2 -- drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c | 2 -- drivers/gpu/drm/omapdrm/displays/panel-tpo-td043mtea1.c | 2 -- drivers/gpu/drm/omapdrm/dss/omapdss.h | 2 -- 15 files changed, 3 insertions(+), 30 deletions(-)
drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c +0 -2
@@ -132,7 +132,6 @@ static void tvc_set_timings(struct omap_dss_device *dssdev,struct omap_dss_device *in = ddata->in; ddata->vm = *vm; - dssdev->panel.vm = *vm; in->ops.atv->set_timings (in, vm); }
@@ -186,7 +185,6 @@ static int tvc_probe(struct platform_device *pdev) dssdev->dev = &pdev->dev; dssdev->type =OMAP_DISPLAY_TYPE_VENC ; dssdev->owner =THIS_MODULE ; - dssdev->panel.vm = tvc_pal_vm; r =omapdss_register_display (dssdev);if (r) {
drivers/gpu/drm/omapdrm/displays/connector-dvi.c +0 -2
@@ -139,7 +139,6 @@ static void dvic_set_timings(struct omap_dss_device *dssdev,struct omap_dss_device *in = ddata->in; ddata->vm = *vm; - dssdev->panel.vm = *vm; in->ops.dvi->set_timings (in, vm); }
@@ -403,7 +402,6 @@ static int dvic_probe(struct platform_device *pdev) dssdev->dev = &pdev->dev; dssdev->type =OMAP_DISPLAY_TYPE_DVI ; dssdev->owner =THIS_MODULE ; - dssdev->panel.vm = dvic_default_vm; r =omapdss_register_display (dssdev);if (r) {
drivers/gpu/drm/omapdrm/displays/connector-hdmi.c +0 -2
@@ -142,7 +142,6 @@ static void hdmic_set_timings(struct omap_dss_device *dssdev,struct omap_dss_device *in = ddata->in; ddata->vm = *vm; - dssdev->panel.vm = *vm; in->ops.hdmi->set_timings (in, vm); }
@@ -368,7 +367,6 @@ static int hdmic_probe(struct platform_device *pdev) dssdev->dev = &pdev->dev; dssdev->type =OMAP_DISPLAY_TYPE_HDMI ; dssdev->owner =THIS_MODULE ; - dssdev->panel.vm = hdmic_default_vm; r =omapdss_register_display (dssdev);if (r) {
drivers/gpu/drm/omapdrm/displays/encoder-opa362.c +0 -1
@@ -143,7 +143,6 @@ static void opa362_set_timings(struct omap_dss_device *dssdev,dev_dbg (dssdev->dev,"set_timings\n" ); ddata->vm = *vm; - dssdev->panel.vm = *vm; in->ops.atv->set_timings (in, vm); }
drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c +0 -1
@@ -137,7 +137,6 @@ static void tfp410_set_timings(struct omap_dss_device *dssdev,tfp410_fix_timings (vm); ddata->vm = *vm; - dssdev->panel.vm = *vm; in->ops.dpi->set_timings (in, vm); }
drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c +0 -1
@@ -131,7 +131,6 @@ static void tpd_set_timings(struct omap_dss_device *dssdev,struct omap_dss_device *in = ddata->in; ddata->vm = *vm; - dssdev->panel.vm = *vm; in->ops.hdmi->set_timings (in, vm); }
drivers/gpu/drm/omapdrm/displays/panel-dpi.c +0 -2
@@ -131,7 +131,6 @@ static void panel_dpi_set_timings(struct omap_dss_device *dssdev,struct omap_dss_device *in = ddata->in; ddata->vm = *vm; - dssdev->panel.vm = *vm; in->ops.dpi->set_timings (in, vm); }
@@ -230,7 +229,6 @@ static int panel_dpi_probe(struct platform_device *pdev) dssdev->driver = &panel_dpi_ops; dssdev->type =OMAP_DISPLAY_TYPE_DPI ; dssdev->owner =THIS_MODULE ; - dssdev->panel.vm = ddata->vm; r =omapdss_register_display (dssdev);if (r) {
drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +3 -5
@@ -956,9 +956,8 @@ static int dsicm_update(struct omap_dss_device *dssdev, }/* XXX no need to send this every frame, but dsi break if not done */ - r =dsicm_set_update_window (ddata,0 ,0 , - dssdev->panel.vm.hactive, - dssdev->panel.vm.vactive); + r =dsicm_set_update_window (ddata,0 ,0 , ddata->vm.hactive, + ddata->vm.vactive);if (r) goto err;
@@ -1089,7 +1088,7 @@ static int dsicm_memory_read(struct omap_dss_device *dssdev, } size =min ((u32 )w * h *3 , - dssdev->panel.vm.hactive * dssdev->panel.vm.vactive *3 ); + ddata->vm.hactive * ddata->vm.vactive *3 ); in->ops.dsi->bus_lock (in);
@@ -1331,7 +1330,6 @@ static int dsicm_probe(struct platform_device *pdev) dssdev = &ddata->dssdev; dssdev->dev = dev; dssdev->driver = &dsicm_ops; - dssdev->panel.vm = ddata->vm; dssdev->type =OMAP_DISPLAY_TYPE_DSI ; dssdev->owner =THIS_MODULE ;
drivers/gpu/drm/omapdrm/displays/panel-lgphilips-lb035q02.c +0 -2
@@ -206,7 +206,6 @@ static void lb035q02_set_timings(struct omap_dss_device *dssdev,struct omap_dss_device *in = ddata->in; ddata->vm = *vm; - dssdev->panel.vm = *vm; in->ops.dpi->set_timings (in, vm); }
@@ -281,7 +280,6 @@ static int lb035q02_panel_spi_probe(struct spi_device *spi) dssdev->driver = &lb035q02_ops; dssdev->type =OMAP_DISPLAY_TYPE_DPI ; dssdev->owner =THIS_MODULE ; - dssdev->panel.vm = ddata->vm; r =omapdss_register_display (dssdev);if (r) {
drivers/gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c +0 -2
@@ -200,7 +200,6 @@ static void nec_8048_set_timings(struct omap_dss_device *dssdev,struct omap_dss_device *in = ddata->in; ddata->vm = *vm; - dssdev->panel.vm = *vm; in->ops.dpi->set_timings (in, vm); }
@@ -305,7 +304,6 @@ static int nec_8048_probe(struct spi_device *spi) dssdev->driver = &nec_8048_ops; dssdev->type =OMAP_DISPLAY_TYPE_DPI ; dssdev->owner =THIS_MODULE ; - dssdev->panel.vm = ddata->vm; r =omapdss_register_display (dssdev);if (r) {
drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c +0 -2
@@ -170,7 +170,6 @@ static void sharp_ls_set_timings(struct omap_dss_device *dssdev,struct omap_dss_device *in = ddata->in; ddata->vm = *vm; - dssdev->panel.vm = *vm; in->ops.dpi->set_timings (in, vm); }
@@ -281,7 +280,6 @@ static int sharp_ls_probe(struct platform_device *pdev) dssdev->driver = &sharp_ls_ops; dssdev->type =OMAP_DISPLAY_TYPE_DPI ; dssdev->owner =THIS_MODULE ; - dssdev->panel.vm = ddata->vm; r =omapdss_register_display (dssdev);if (r) {
drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c +0 -2
@@ -671,7 +671,6 @@ static void acx565akm_set_timings(struct omap_dss_device *dssdev,struct omap_dss_device *in = ddata->in; ddata->vm = *vm; - dssdev->panel.vm = *vm; in->ops.sdi->set_timings (in, vm); }
@@ -812,7 +811,6 @@ static int acx565akm_probe(struct spi_device *spi) dssdev->driver = &acx565akm_ops; dssdev->type =OMAP_DISPLAY_TYPE_SDI ; dssdev->owner =THIS_MODULE ; - dssdev->panel.vm = ddata->vm; r =omapdss_register_display (dssdev);if (r) {
drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c +0 -2
@@ -340,7 +340,6 @@ static void td028ttec1_panel_set_timings(struct omap_dss_device *dssdev,struct omap_dss_device *in = ddata->in; ddata->vm = *vm; - dssdev->panel.vm = *vm; in->ops.dpi->set_timings (in, vm); }
@@ -406,7 +405,6 @@ static int td028ttec1_panel_probe(struct spi_device *spi) dssdev->driver = &td028ttec1_ops; dssdev->type =OMAP_DISPLAY_TYPE_DPI ; dssdev->owner =THIS_MODULE ; - dssdev->panel.vm = ddata->vm; r =omapdss_register_display (dssdev);if (r) {
drivers/gpu/drm/omapdrm/displays/panel-tpo-td043mtea1.c +0 -2
@@ -434,7 +434,6 @@ static void tpo_td043_set_timings(struct omap_dss_device *dssdev,struct omap_dss_device *in = ddata->in; ddata->vm = *vm; - dssdev->panel.vm = *vm; in->ops.dpi->set_timings (in, vm); }
@@ -549,7 +548,6 @@ static int tpo_td043_probe(struct spi_device *spi) dssdev->driver = &tpo_td043_ops; dssdev->type =OMAP_DISPLAY_TYPE_DPI ; dssdev->owner =THIS_MODULE ; - dssdev->panel.vm = ddata->vm; r =omapdss_register_display (dssdev);if (r) {
drivers/gpu/drm/omapdrm/dss/omapdss.h +0 -2
@@ -458,8 +458,6 @@ struct omap_dss_device {enum omap_display_type output_type;struct { -struct videomode vm; -enum omap_dss_dsi_pixel_format dsi_pix_fmt;enum omap_dss_dsi_mode dsi_mode; } panel;
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 12/60] drm/omap: displays: Remove videomode from omap_dss_device structure
Hi,
Quoted 7 lines · Laurent Pinchart
The
omap_dss_devicestructure stores a videomode. All the connector and panel drivers that useomap_dss_devicealso store the videomode in their ownpanel_drv_datastructures. There's no need to duplicate, remove the videomode field fromomap_dss_device.Signed-off-by Laurent Pinchart <[email protected]>---
-- Sebastian
Quoted 308 lines
drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c | 2 -- drivers/gpu/drm/omapdrm/displays/connector-dvi.c | 2 -- drivers/gpu/drm/omapdrm/displays/connector-hdmi.c | 2 -- drivers/gpu/drm/omapdrm/displays/encoder-opa362.c | 1 - drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c | 1 - drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c | 1 - drivers/gpu/drm/omapdrm/displays/panel-dpi.c | 2 -- drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 8 +++----- drivers/gpu/drm/omapdrm/displays/panel-lgphilips-lb035q02.c | 2 -- drivers/gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c | 2 -- drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c | 2 -- drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c | 2 -- drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c | 2 -- drivers/gpu/drm/omapdrm/displays/panel-tpo-td043mtea1.c | 2 -- drivers/gpu/drm/omapdrm/dss/omapdss.h | 2 -- 15 files changed, 3 insertions(+), 30 deletions(-)drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c +0
-2@@ -132,7 +132,6 @@ static void tvc_set_timings(struct omap_dss_device *dssdev,struct omap_dss_device *in = ddata->in; ddata->vm = *vm; - dssdev->panel.vm = *vm; in->ops.atv->set_timings (in, vm); }@@ -186,7 +185,6 @@ static int tvc_probe(struct platform_device *pdev) dssdev->dev = &pdev->dev; dssdev->type =OMAP_DISPLAY_TYPE_VENC ; dssdev->owner =THIS_MODULE ; - dssdev->panel.vm = tvc_pal_vm; r =omapdss_register_display (dssdev);if (r) {drivers/gpu/drm/omapdrm/displays/connector-dvi.c +0
-2@@ -139,7 +139,6 @@ static void dvic_set_timings(struct omap_dss_device *dssdev,struct omap_dss_device *in = ddata->in; ddata->vm = *vm; - dssdev->panel.vm = *vm; in->ops.dvi->set_timings (in, vm); }@@ -403,7 +402,6 @@ static int dvic_probe(struct platform_device *pdev) dssdev->dev = &pdev->dev; dssdev->type =OMAP_DISPLAY_TYPE_DVI ; dssdev->owner =THIS_MODULE ; - dssdev->panel.vm = dvic_default_vm; r =omapdss_register_display (dssdev);if (r) {drivers/gpu/drm/omapdrm/displays/connector-hdmi.c +0
-2@@ -142,7 +142,6 @@ static void hdmic_set_timings(struct omap_dss_device *dssdev,struct omap_dss_device *in = ddata->in; ddata->vm = *vm; - dssdev->panel.vm = *vm; in->ops.hdmi->set_timings (in, vm); }@@ -368,7 +367,6 @@ static int hdmic_probe(struct platform_device *pdev) dssdev->dev = &pdev->dev; dssdev->type =OMAP_DISPLAY_TYPE_HDMI ; dssdev->owner =THIS_MODULE ; - dssdev->panel.vm = hdmic_default_vm; r =omapdss_register_display (dssdev);if (r) {drivers/gpu/drm/omapdrm/displays/encoder-opa362.c +0
-1@@ -143,7 +143,6 @@ static void opa362_set_timings(struct omap_dss_device *dssdev,dev_dbg (dssdev->dev,"set_timings\n" ); ddata->vm = *vm; - dssdev->panel.vm = *vm; in->ops.atv->set_timings (in, vm); }drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c +0
-1@@ -137,7 +137,6 @@ static void tfp410_set_timings(struct omap_dss_device *dssdev,tfp410_fix_timings (vm); ddata->vm = *vm; - dssdev->panel.vm = *vm; in->ops.dpi->set_timings (in, vm); }drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c +0
-1@@ -131,7 +131,6 @@ static void tpd_set_timings(struct omap_dss_device *dssdev,struct omap_dss_device *in = ddata->in; ddata->vm = *vm; - dssdev->panel.vm = *vm; in->ops.hdmi->set_timings (in, vm); }drivers/gpu/drm/omapdrm/displays/panel-dpi.c +0
-2@@ -131,7 +131,6 @@ static void panel_dpi_set_timings(struct omap_dss_device *dssdev,struct omap_dss_device *in = ddata->in; ddata->vm = *vm; - dssdev->panel.vm = *vm; in->ops.dpi->set_timings (in, vm); }@@ -230,7 +229,6 @@ static int panel_dpi_probe(struct platform_device *pdev) dssdev->driver = &panel_dpi_ops; dssdev->type =OMAP_DISPLAY_TYPE_DPI ; dssdev->owner =THIS_MODULE ; - dssdev->panel.vm = ddata->vm; r =omapdss_register_display (dssdev);if (r) {drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +3
-5@@ -956,9 +956,8 @@ static int dsicm_update(struct omap_dss_device *dssdev, }/* XXX no need to send this every frame, but dsi break if not done */ - r =dsicm_set_update_window (ddata,0 ,0 , - dssdev->panel.vm.hactive, - dssdev->panel.vm.vactive); + r =dsicm_set_update_window (ddata,0 ,0 , ddata->vm.hactive, + ddata->vm.vactive);if (r) goto err;@@ -1089,7 +1088,7 @@ static int dsicm_memory_read(struct omap_dss_device *dssdev, } size =min ((u32 )w * h *3 , - dssdev->panel.vm.hactive * dssdev->panel.vm.vactive *3 ); + ddata->vm.hactive * ddata->vm.vactive *3 ); in->ops.dsi->bus_lock (in);@@ -1331,7 +1330,6 @@ static int dsicm_probe(struct platform_device *pdev) dssdev = &ddata->dssdev; dssdev->dev = dev; dssdev->driver = &dsicm_ops; - dssdev->panel.vm = ddata->vm; dssdev->type =OMAP_DISPLAY_TYPE_DSI ; dssdev->owner =THIS_MODULE ;drivers/gpu/drm/omapdrm/displays/panel-lgphilips-lb035q02.c +0
-2@@ -206,7 +206,6 @@ static void lb035q02_set_timings(struct omap_dss_device *dssdev,struct omap_dss_device *in = ddata->in; ddata->vm = *vm; - dssdev->panel.vm = *vm; in->ops.dpi->set_timings (in, vm); }@@ -281,7 +280,6 @@ static int lb035q02_panel_spi_probe(struct spi_device *spi) dssdev->driver = &lb035q02_ops; dssdev->type =OMAP_DISPLAY_TYPE_DPI ; dssdev->owner =THIS_MODULE ; - dssdev->panel.vm = ddata->vm; r =omapdss_register_display (dssdev);if (r) {drivers/gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c +0
-2@@ -200,7 +200,6 @@ static void nec_8048_set_timings(struct omap_dss_device *dssdev,struct omap_dss_device *in = ddata->in; ddata->vm = *vm; - dssdev->panel.vm = *vm; in->ops.dpi->set_timings (in, vm); }@@ -305,7 +304,6 @@ static int nec_8048_probe(struct spi_device *spi) dssdev->driver = &nec_8048_ops; dssdev->type =OMAP_DISPLAY_TYPE_DPI ; dssdev->owner =THIS_MODULE ; - dssdev->panel.vm = ddata->vm; r =omapdss_register_display (dssdev);if (r) {drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c +0
-2@@ -170,7 +170,6 @@ static void sharp_ls_set_timings(struct omap_dss_device *dssdev,struct omap_dss_device *in = ddata->in; ddata->vm = *vm; - dssdev->panel.vm = *vm; in->ops.dpi->set_timings (in, vm); }@@ -281,7 +280,6 @@ static int sharp_ls_probe(struct platform_device *pdev) dssdev->driver = &sharp_ls_ops; dssdev->type =OMAP_DISPLAY_TYPE_DPI ; dssdev->owner =THIS_MODULE ; - dssdev->panel.vm = ddata->vm; r =omapdss_register_display (dssdev);if (r) {drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c +0
-2@@ -671,7 +671,6 @@ static void acx565akm_set_timings(struct omap_dss_device *dssdev,struct omap_dss_device *in = ddata->in; ddata->vm = *vm; - dssdev->panel.vm = *vm; in->ops.sdi->set_timings (in, vm); }@@ -812,7 +811,6 @@ static int acx565akm_probe(struct spi_device *spi) dssdev->driver = &acx565akm_ops; dssdev->type =OMAP_DISPLAY_TYPE_SDI ; dssdev->owner =THIS_MODULE ; - dssdev->panel.vm = ddata->vm; r =omapdss_register_display (dssdev);if (r) {drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c +0
-2@@ -340,7 +340,6 @@ static void td028ttec1_panel_set_timings(struct omap_dss_device *dssdev,struct omap_dss_device *in = ddata->in; ddata->vm = *vm; - dssdev->panel.vm = *vm; in->ops.dpi->set_timings (in, vm); }@@ -406,7 +405,6 @@ static int td028ttec1_panel_probe(struct spi_device *spi) dssdev->driver = &td028ttec1_ops; dssdev->type =OMAP_DISPLAY_TYPE_DPI ; dssdev->owner =THIS_MODULE ; - dssdev->panel.vm = ddata->vm; r =omapdss_register_display (dssdev);if (r) {drivers/gpu/drm/omapdrm/displays/panel-tpo-td043mtea1.c +0
-2@@ -434,7 +434,6 @@ static void tpo_td043_set_timings(struct omap_dss_device *dssdev,struct omap_dss_device *in = ddata->in; ddata->vm = *vm; - dssdev->panel.vm = *vm; in->ops.dpi->set_timings (in, vm); }@@ -549,7 +548,6 @@ static int tpo_td043_probe(struct spi_device *spi) dssdev->driver = &tpo_td043_ops; dssdev->type =OMAP_DISPLAY_TYPE_DPI ; dssdev->owner =THIS_MODULE ; - dssdev->panel.vm = ddata->vm; r =omapdss_register_display (dssdev);if (r) {drivers/gpu/drm/omapdrm/dss/omapdss.h +0
-2@@ -458,8 +458,6 @@ struct omap_dss_device {enum omap_display_type output_type;struct { -struct videomode vm; -enum omap_dss_dsi_pixel_format dsi_pix_fmt;enum omap_dss_dsi_mode dsi_mode; } panel;Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 13/60 drm/omap: dss: Remove omap_dss_device panel fields
In reply to Laurent PinchartThe omap_dss_device panel.dsi_pix_fmt and panel.dsi_mode fields are unused. Remove them.
--- drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 1 - drivers/gpu/drm/omapdrm/dss/omapdss.h | 5 ----- 2 files changed, 6 deletions(-)
drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +0 -1
@@ -1333,7 +1333,6 @@ static int dsicm_probe(struct platform_device *pdev) dssdev->type =OMAP_DISPLAY_TYPE_DSI ; dssdev->owner =THIS_MODULE ; - dssdev->panel.dsi_pix_fmt =OMAP_DSS_DSI_FMT_RGB888 ; dssdev->caps =OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE |OMAP_DSS_DISPLAY_CAP_TEAR_ELIM ;
drivers/gpu/drm/omapdrm/dss/omapdss.h +0 -5
@@ -457,11 +457,6 @@ struct omap_dss_device {enum omap_display_type type;enum omap_display_type output_type; -struct { -enum omap_dss_dsi_pixel_format dsi_pix_fmt; -enum omap_dss_dsi_mode dsi_mode; - } panel; -const char *name;const struct omap_dss_driver *driver;
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 13/60] drm/omap: dss: Remove omap_dss_device panel fields
Hi,
Quoted 5 lines · Laurent Pinchart
The
omap_dss_devicepanel.dsi_pix_fmt and panel.dsi_mode fields are unused. Remove them.Signed-off-by Laurent Pinchart <[email protected]>---
-- Sebastian
Quoted 41 lines
drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 1 - drivers/gpu/drm/omapdrm/dss/omapdss.h | 5 ----- 2 files changed, 6 deletions(-)drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +0
-1@@ -1333,7 +1333,6 @@ static int dsicm_probe(struct platform_device *pdev) dssdev->type =OMAP_DISPLAY_TYPE_DSI ; dssdev->owner =THIS_MODULE ; - dssdev->panel.dsi_pix_fmt =OMAP_DSS_DSI_FMT_RGB888 ; dssdev->caps =OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE |OMAP_DSS_DISPLAY_CAP_TEAR_ELIM ;drivers/gpu/drm/omapdrm/dss/omapdss.h +0
-5@@ -457,11 +457,6 @@ struct omap_dss_device {enum omap_display_type type;enum omap_display_type output_type; -struct { -enum omap_dss_dsi_pixel_format dsi_pix_fmt; -enum omap_dss_dsi_mode dsi_mode; - } panel; -const char *name;const struct omap_dss_driver *driver;Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 14/60 drm/omap: dss: Rename omap_dss_device list field to output_list
In reply to Laurent PinchartFor coherency with the panel_list field, rename list to output_list.
--- drivers/gpu/drm/omapdrm/dss/omapdss.h | 2 +- drivers/gpu/drm/omapdrm/dss/output.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/omapdrm/dss/omapdss.h +1 -1
@@ -481,7 +481,7 @@ struct omap_dss_device {/* OMAP DSS output specific fields */ -struct list_head list; +struct list_head output_list;/* DISPC channel for this output */ enum omap_channel dispc_channel;
drivers/gpu/drm/omapdrm/dss/output.c +5 -5
@@ -96,14 +96,14 @@ EXPORT_SYMBOL(omapdss_output_unset_device);int omapdss_register_output (struct omap_dss_device *out) { -list_add_tail (&out->list, &output_list); +list_add_tail (&out->output_list, &output_list);return 0 ; }EXPORT_SYMBOL (omapdss_register_output);void omapdss_unregister_output (struct omap_dss_device *out) { -list_del (&out->list); +list_del (&out->output_list); }EXPORT_SYMBOL (omapdss_unregister_output);
@@ -111,7 +111,7 @@ bool omapdss_component_is_output(struct device_node *node) {struct omap_dss_device *out; -list_for_each_entry (out, &output_list, list) { +list_for_each_entry (out, &output_list, output_list) {if (out->dev->of_node == node)return true; }
@@ -124,7 +124,7 @@ struct omap_dss_device *omap_dss_get_output(enum omap_dss_output_id id) {struct omap_dss_device *out; -list_for_each_entry (out, &output_list, list) { +list_for_each_entry (out, &output_list, output_list) {if (out->id == id)return out; }
@@ -145,7 +145,7 @@ struct omap_dss_device *omap_dss_find_output_by_port_node(struct device_node *po reg =dss_of_port_get_port_number (port); -list_for_each_entry (out, &output_list, list) { +list_for_each_entry (out, &output_list, output_list) {if (out->dev->of_node == src_node && out->port_num == reg) {of_node_put (src_node);return omap_dss_get_device (out);
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 14/60] drm/omap: dss: Rename omap_dss_device list field to output_list
Hi,
Quoted 4 lines · Laurent Pinchart
For coherency with the
panel_listfield, rename list tooutput_list.Signed-off-by Laurent Pinchart <[email protected]>---
-- Sebastian
Quoted 74 lines
drivers/gpu/drm/omapdrm/dss/omapdss.h | 2 +- drivers/gpu/drm/omapdrm/dss/output.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-)drivers/gpu/drm/omapdrm/dss/omapdss.h +1
-1@@ -481,7 +481,7 @@ struct omap_dss_device {/* OMAP DSS output specific fields */ -struct list_head list; +struct list_head output_list;/* DISPC channel for this output */ enum omap_channel dispc_channel;drivers/gpu/drm/omapdrm/dss/output.c +5
-5@@ -96,14 +96,14 @@ EXPORT_SYMBOL(omapdss_output_unset_device);int omapdss_register_output (struct omap_dss_device *out) { -list_add_tail (&out->list, &output_list); +list_add_tail (&out->output_list, &output_list);return 0 ; }EXPORT_SYMBOL (omapdss_register_output);void omapdss_unregister_output (struct omap_dss_device *out) { -list_del (&out->list); +list_del (&out->output_list); }EXPORT_SYMBOL (omapdss_unregister_output);@@ -111,7 +111,7 @@ bool omapdss_component_is_output(struct device_node *node) {struct omap_dss_device *out; -list_for_each_entry (out, &output_list, list) { +list_for_each_entry (out, &output_list, output_list) {if (out->dev->of_node == node)return true; }@@ -124,7 +124,7 @@ struct omap_dss_device *omap_dss_get_output(enum omap_dss_output_id id) {struct omap_dss_device *out; -list_for_each_entry (out, &output_list, list) { +list_for_each_entry (out, &output_list, output_list) {if (out->id == id)return out; }@@ -145,7 +145,7 @@ struct omap_dss_device *omap_dss_find_output_by_port_node(struct device_node *po reg =dss_of_port_get_port_number (port); -list_for_each_entry (out, &output_list, list) { +list_for_each_entry (out, &output_list, output_list) {if (out->dev->of_node == src_node && out->port_num == reg) {of_node_put (src_node);return omap_dss_get_device (out);Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 15/60 drm/omap: dss: Create global list of all omap_dss_device instances
In reply to Laurent PinchartThe omap_dss_device instances are stored in two separate lists, depending on whether they are panels or outputs. Create a third list that stores all omap_dss_device instances to allow generic code to operate on all instances.
--- drivers/gpu/drm/omapdrm/dss/base.c | 45 ++++++++++++++++++++++++++++------- drivers/gpu/drm/omapdrm/dss/display.c | 4 ++++ drivers/gpu/drm/omapdrm/dss/omapdss.h | 4 ++++ drivers/gpu/drm/omapdrm/dss/output.c | 2 ++ 4 files changed, 46 insertions(+), 9 deletions(-)
drivers/gpu/drm/omapdrm/dss/base.c +36 -9
@@ -14,24 +14,17 @@*/ #include <linux/kernel.h> +#include <linux/list.h> #include <linux/module.h> +#include <linux/mutex.h> #include <linux/of.h> #include <linux/of_graph.h> -#include <linux/list.h> #include "dss.h" #include "omapdss.h" static struct dss_device *dss_device; -static struct list_head omapdss_comp_list; - -struct omapdss_comp_node { -struct list_head list; -struct device_node *node; -bool dss_core_component; -}; -struct dss_device *omapdss_get_dss (void ) {return dss_device;
@@ -56,6 +49,40 @@ const struct dispc_ops *dispc_get_ops(struct dss_device *dss) }EXPORT_SYMBOL (dispc_get_ops); + +/* ----------------------------------------------------------------------------- +* OMAP DSS Devices Handling +*/ + +static LIST_HEAD (omapdss_devices_list); +static DEFINE_MUTEX (omapdss_devices_lock); + +void omapdss_device_register (struct omap_dss_device *dssdev) +{ +mutex_lock (&omapdss_devices_lock); +list_add_tail (&dssdev->list, &omapdss_devices_list); +mutex_unlock (&omapdss_devices_lock); +} + +void omapdss_device_unregister (struct omap_dss_device *dssdev) +{ +mutex_lock (&omapdss_devices_lock); +list_del (&dssdev->list); +mutex_unlock (&omapdss_devices_lock); +} + +/* ----------------------------------------------------------------------------- +* Components Handling +*/ + +static struct list_head omapdss_comp_list; + +struct omapdss_comp_node { +struct list_head list; +struct device_node *node; +bool dss_core_component; +}; +static bool omapdss_list_contains (const struct device_node *node) {struct omapdss_comp_node *comp;
drivers/gpu/drm/omapdrm/dss/display.c +4 -0
@@ -56,6 +56,8 @@ int omapdss_register_display(struct omap_dss_device *dssdev)mutex_lock (&panel_list_mutex);list_add_tail (&dssdev->panel_list, &panel_list);mutex_unlock (&panel_list_mutex); + +omapdss_device_register (dssdev);return 0 ; }EXPORT_SYMBOL (omapdss_register_display);
@@ -65,6 +67,8 @@ void omapdss_unregister_display(struct omap_dss_device *dssdev)mutex_lock (&panel_list_mutex);list_del (&dssdev->panel_list);mutex_unlock (&panel_list_mutex); + +omapdss_device_register (dssdev); }EXPORT_SYMBOL (omapdss_unregister_display);
drivers/gpu/drm/omapdrm/dss/omapdss.h +4 -0
@@ -450,6 +450,7 @@ struct omap_dss_device {struct module *owner; +struct list_head list;struct list_head panel_list;unsigned int alias_id;
@@ -560,6 +561,9 @@ static inline bool omapdss_is_initialized(void)int omapdss_register_display (struct omap_dss_device *dssdev);void omapdss_unregister_display (struct omap_dss_device *dssdev); +void omapdss_device_register (struct omap_dss_device *dssdev); +void omapdss_device_unregister (struct omap_dss_device *dssdev); +struct omap_dss_device *omap_dss_get_device (struct omap_dss_device *dssdev);void omap_dss_put_device (struct omap_dss_device *dssdev);#define for_each_dss_dev (d) while ((d = omap_dss_get_next_device(d)) != NULL)
drivers/gpu/drm/omapdrm/dss/output.c +2 -0
@@ -97,6 +97,7 @@ EXPORT_SYMBOL(omapdss_output_unset_device);int omapdss_register_output (struct omap_dss_device *out) {list_add_tail (&out->output_list, &output_list); +omapdss_device_register (out);return 0 ; }EXPORT_SYMBOL (omapdss_register_output);
@@ -104,6 +105,7 @@ EXPORT_SYMBOL(omapdss_register_output);void omapdss_unregister_output (struct omap_dss_device *out) {list_del (&out->output_list); +omapdss_device_unregister (out); }EXPORT_SYMBOL (omapdss_unregister_output);
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 15/60] drm/omap: dss: Create global list of all omap_dss_device instances
Hi,
Quoted 7 lines · Laurent Pinchart
The
omap_dss_deviceinstances are stored in two separate lists, depending on whether they are panels or outputs. Create a third list that stores allomap_dss_deviceinstances to allow generic code to operate on all instances.Signed-off-by Laurent Pinchart <[email protected]>---
-- Sebastian
Quoted 151 lines
drivers/gpu/drm/omapdrm/dss/base.c | 45 ++++++++++++++++++++++++++++------- drivers/gpu/drm/omapdrm/dss/display.c | 4 ++++ drivers/gpu/drm/omapdrm/dss/omapdss.h | 4 ++++ drivers/gpu/drm/omapdrm/dss/output.c | 2 ++ 4 files changed, 46 insertions(+), 9 deletions(-)drivers/gpu/drm/omapdrm/dss/base.c +36
-9@@ -14,24 +14,17 @@*/ #include <linux/kernel.h> +#include <linux/list.h> #include <linux/module.h> +#include <linux/mutex.h> #include <linux/of.h> #include <linux/of_graph.h> -#include <linux/list.h> #include "dss.h" #include "omapdss.h" static struct dss_device *dss_device; -static struct list_head omapdss_comp_list; - -struct omapdss_comp_node { -struct list_head list; -struct device_node *node; -bool dss_core_component; -}; -struct dss_device *omapdss_get_dss (void ) {return dss_device;@@ -56,6 +49,40 @@ const struct dispc_ops *dispc_get_ops(struct dss_device *dss) }EXPORT_SYMBOL (dispc_get_ops); + +/* ----------------------------------------------------------------------------- +* OMAP DSS Devices Handling +*/ + +static LIST_HEAD (omapdss_devices_list); +static DEFINE_MUTEX (omapdss_devices_lock); + +void omapdss_device_register (struct omap_dss_device *dssdev) +{ +mutex_lock (&omapdss_devices_lock); +list_add_tail (&dssdev->list, &omapdss_devices_list); +mutex_unlock (&omapdss_devices_lock); +} + +void omapdss_device_unregister (struct omap_dss_device *dssdev) +{ +mutex_lock (&omapdss_devices_lock); +list_del (&dssdev->list); +mutex_unlock (&omapdss_devices_lock); +} + +/* ----------------------------------------------------------------------------- +* Components Handling +*/ + +static struct list_head omapdss_comp_list; + +struct omapdss_comp_node { +struct list_head list; +struct device_node *node; +bool dss_core_component; +}; +static bool omapdss_list_contains (const struct device_node *node) {struct omapdss_comp_node *comp;drivers/gpu/drm/omapdrm/dss/display.c +4
-0@@ -56,6 +56,8 @@ int omapdss_register_display(struct omap_dss_device *dssdev)mutex_lock (&panel_list_mutex);list_add_tail (&dssdev->panel_list, &panel_list);mutex_unlock (&panel_list_mutex); + +omapdss_device_register (dssdev);return 0 ; }EXPORT_SYMBOL (omapdss_register_display);@@ -65,6 +67,8 @@ void omapdss_unregister_display(struct omap_dss_device *dssdev)mutex_lock (&panel_list_mutex);list_del (&dssdev->panel_list);mutex_unlock (&panel_list_mutex); + +omapdss_device_register (dssdev); }EXPORT_SYMBOL (omapdss_unregister_display);drivers/gpu/drm/omapdrm/dss/omapdss.h +4
-0@@ -450,6 +450,7 @@ struct omap_dss_device {struct module *owner; +struct list_head list;struct list_head panel_list;unsigned int alias_id;@@ -560,6 +561,9 @@ static inline bool omapdss_is_initialized(void)int omapdss_register_display (struct omap_dss_device *dssdev);void omapdss_unregister_display (struct omap_dss_device *dssdev); +void omapdss_device_register (struct omap_dss_device *dssdev); +void omapdss_device_unregister (struct omap_dss_device *dssdev); +struct omap_dss_device *omap_dss_get_device (struct omap_dss_device *dssdev);void omap_dss_put_device (struct omap_dss_device *dssdev);#define for_each_dss_dev (d) while ((d = omap_dss_get_next_device(d)) != NULL)drivers/gpu/drm/omapdrm/dss/output.c +2
-0@@ -97,6 +97,7 @@ EXPORT_SYMBOL(omapdss_output_unset_device);int omapdss_register_output (struct omap_dss_device *out) {list_add_tail (&out->output_list, &output_list); +omapdss_device_register (out);return 0 ; }EXPORT_SYMBOL (omapdss_register_output);@@ -104,6 +105,7 @@ EXPORT_SYMBOL(omapdss_register_output);void omapdss_unregister_output (struct omap_dss_device *out) {list_del (&out->output_list); +omapdss_device_unregister (out); }EXPORT_SYMBOL (omapdss_unregister_output);Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 16/60 drm/omap: dss: Create and use omapdss_device_is_registered()
In reply to Laurent PinchartThe omapdss_component_is_loaded() function test whether a component is loaded by checking whether it is present in the displays list or the outputs list. Simplify the implementation by checking for the component in the global omap_dss_device list.
--- drivers/gpu/drm/omapdrm/dss/base.c | 22 +++++++++++++++++++--- drivers/gpu/drm/omapdrm/dss/display.c | 18 ------------------ drivers/gpu/drm/omapdrm/dss/omapdss.h | 3 --- drivers/gpu/drm/omapdrm/dss/output.c | 13 ------------- 4 files changed, 19 insertions(+), 37 deletions(-)
drivers/gpu/drm/omapdrm/dss/base.c +19 -3
@@ -71,6 +71,24 @@ void omapdss_device_unregister(struct omap_dss_device *dssdev)mutex_unlock (&omapdss_devices_lock); } +static bool omapdss_device_is_registered (struct device_node *node) +{ +struct omap_dss_device *dssdev; +bool found = false; + +mutex_lock (&omapdss_devices_lock); + +list_for_each_entry (dssdev, &omapdss_devices_list, list) { +if (dssdev->dev->of_node == node) { + found = true; +break ; + } + } + +mutex_unlock (&omapdss_devices_lock); +return found; +} +/* ----------------------------------------------------------------------------- * Components Handling */
@@ -157,9 +175,7 @@ static bool omapdss_component_is_loaded(struct omapdss_comp_node *comp) {if (comp->dss_core_component)return true; -if (omapdss_component_is_display (comp->node)) -return true; -if (omapdss_component_is_output (comp->node)) +if (omapdss_device_is_registered (comp->node))return true;return false;
drivers/gpu/drm/omapdrm/dss/display.c +0 -18
@@ -72,24 +72,6 @@ void omapdss_unregister_display(struct omap_dss_device *dssdev) }EXPORT_SYMBOL (omapdss_unregister_display); -bool omapdss_component_is_display (struct device_node *node) -{ -struct omap_dss_device *dssdev; -bool found = false; - -mutex_lock (&panel_list_mutex); -list_for_each_entry (dssdev, &panel_list, panel_list) { -if (dssdev->dev->of_node == node) { - found = true; - goto out; - } - } -out: -mutex_unlock (&panel_list_mutex); -return found; -} -EXPORT_SYMBOL (omapdss_component_is_display); -struct omap_dss_device *omap_dss_get_device (struct omap_dss_device *dssdev) {if (!try_module_get (dssdev->owner))
drivers/gpu/drm/omapdrm/dss/omapdss.h +0 -3
@@ -737,9 +737,6 @@ struct dispc_ops {struct dispc_device *dispc_get_dispc (struct dss_device *dss);const struct dispc_ops *dispc_get_ops (struct dss_device *dss); -bool omapdss_component_is_display (struct device_node *node); -bool omapdss_component_is_output (struct device_node *node); -bool omapdss_stack_is_ready (void );void omapdss_gather_components (struct device *dev);
drivers/gpu/drm/omapdrm/dss/output.c +0 -13
@@ -109,19 +109,6 @@ void omapdss_unregister_output(struct omap_dss_device *out) }EXPORT_SYMBOL (omapdss_unregister_output); -bool omapdss_component_is_output (struct device_node *node) -{ -struct omap_dss_device *out; - -list_for_each_entry (out, &output_list, output_list) { -if (out->dev->of_node == node) -return true; - } - -return false; -} -EXPORT_SYMBOL (omapdss_component_is_output); -struct omap_dss_device *omap_dss_get_output (enum omap_dss_output_id id) {struct omap_dss_device *out;
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 16/60] drm/omap: dss: Create and use omapdss_device_is_registered()
Hi,
Quoted 7 lines · Laurent Pinchart
The
omapdss_component_is_loaded()function test whether a component is loaded by checking whether it is present in the displays list or the outputs list. Simplify the implementation by checking for the component in the globalomap_dss_devicelist.Signed-off-by Laurent Pinchart <[email protected]>---
-- Sebastian
Quoted 122 lines
drivers/gpu/drm/omapdrm/dss/base.c | 22 +++++++++++++++++++--- drivers/gpu/drm/omapdrm/dss/display.c | 18 ------------------ drivers/gpu/drm/omapdrm/dss/omapdss.h | 3 --- drivers/gpu/drm/omapdrm/dss/output.c | 13 ------------- 4 files changed, 19 insertions(+), 37 deletions(-)drivers/gpu/drm/omapdrm/dss/base.c +19
-3@@ -71,6 +71,24 @@ void omapdss_device_unregister(struct omap_dss_device *dssdev)mutex_unlock (&omapdss_devices_lock); } +static bool omapdss_device_is_registered (struct device_node *node) +{ +struct omap_dss_device *dssdev; +bool found = false; + +mutex_lock (&omapdss_devices_lock); + +list_for_each_entry (dssdev, &omapdss_devices_list, list) { +if (dssdev->dev->of_node == node) { + found = true; +break ; + } + } + +mutex_unlock (&omapdss_devices_lock); +return found; +} +/* ----------------------------------------------------------------------------- * Components Handling */ @@ -157,9 +175,7 @@ static bool omapdss_component_is_loaded(struct omapdss_comp_node *comp) {if (comp->dss_core_component)return true; -if (omapdss_component_is_display (comp->node)) -return true; -if (omapdss_component_is_output (comp->node)) +if (omapdss_device_is_registered (comp->node))return true;return false;drivers/gpu/drm/omapdrm/dss/display.c +0
-18@@ -72,24 +72,6 @@ void omapdss_unregister_display(struct omap_dss_device *dssdev) }EXPORT_SYMBOL (omapdss_unregister_display); -bool omapdss_component_is_display (struct device_node *node) -{ -struct omap_dss_device *dssdev; -bool found = false; - -mutex_lock (&panel_list_mutex); -list_for_each_entry (dssdev, &panel_list, panel_list) { -if (dssdev->dev->of_node == node) { - found = true; - goto out; - } - } -out: -mutex_unlock (&panel_list_mutex); -return found; -} -EXPORT_SYMBOL (omapdss_component_is_display); -struct omap_dss_device *omap_dss_get_device (struct omap_dss_device *dssdev) {if (!try_module_get (dssdev->owner))drivers/gpu/drm/omapdrm/dss/omapdss.h +0
-3@@ -737,9 +737,6 @@ struct dispc_ops {struct dispc_device *dispc_get_dispc (struct dss_device *dss);const struct dispc_ops *dispc_get_ops (struct dss_device *dss); -bool omapdss_component_is_display (struct device_node *node); -bool omapdss_component_is_output (struct device_node *node); -bool omapdss_stack_is_ready (void );void omapdss_gather_components (struct device *dev);drivers/gpu/drm/omapdrm/dss/output.c +0
-13@@ -109,19 +109,6 @@ void omapdss_unregister_output(struct omap_dss_device *out) }EXPORT_SYMBOL (omapdss_unregister_output); -bool omapdss_component_is_output (struct device_node *node) -{ -struct omap_dss_device *out; - -list_for_each_entry (out, &output_list, output_list) { -if (out->dev->of_node == node) -return true; - } - -return false; -} -EXPORT_SYMBOL (omapdss_component_is_output); -struct omap_dss_device *omap_dss_get_output (enum omap_dss_output_id id) {struct omap_dss_device *out;Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 17/60 drm/omap: dss: Rework output lookup by port node
In reply to Laurent PinchartThe omap_dss_find_output_by_port_node() function defined in output.c looks up an output from its port node. To do so it needs to call helper functions from dss-of.c to lookup the port parent and the port number. As omap_dss_find_output_by_port_node() is only called by omapdss_of_find_source_for_first_ep() from dss-of.c this goes back and forth between the to source files and isn't very clear.
Simplify the code by passing both the parent and the port number to omap_dss_find_output_by_port_node() instead of the port node, and rename the function to omap_dss_find_output_by_port().
--- drivers/gpu/drm/omapdrm/dss/dss-of.c | 39 ++++++++++++++++------------------- drivers/gpu/drm/omapdrm/dss/omapdss.h | 6 ++---- drivers/gpu/drm/omapdrm/dss/output.c | 17 +++------------ 3 files changed, 23 insertions(+), 39 deletions(-)
drivers/gpu/drm/omapdrm/dss/dss-of.c +18 -21
@@ -21,7 +21,8 @@#include "omapdss.h" -struct device_node *dss_of_port_get_parent_device (struct device_node *port) +static struct device_node * +dss_of_port_get_parent_device (struct device_node *port) {struct device_node *np;int i;
@@ -45,40 +46,36 @@ struct device_node *dss_of_port_get_parent_device(struct device_node *port)return NULL ; } -u32 dss_of_port_get_port_number (struct device_node *port) -{ -int r; -u32 reg; - - r =of_property_read_u32 (port,"reg" , ®); -if (r) - reg =0 ; - -return reg; -} -struct omap_dss_device *omapdss_of_find_source_for_first_ep (struct device_node *node) { -struct device_node *ep; +struct device_node *src_node;struct device_node *src_port; +struct device_node *ep;struct omap_dss_device *src; +u32 port_number =0 ; +/* Get the endpoint... */ ep =of_graph_get_endpoint_by_regs (node,0 ,0 );if (!ep)return ERR_PTR (-EINVAL ); +/* ... and its remote port... */ src_port =of_graph_get_remote_port (ep); -if (!src_port) { -of_node_put (ep); -return ERR_PTR (-EINVAL ); - } -of_node_put (ep); +if (!src_port) +return ERR_PTR (-EINVAL ); - src =omap_dss_find_output_by_port_node (src_port); - +/* ... and the remote port's number and parent... */ +of_property_read_u32 (src_port,"reg" , &port_number); + src_node =dss_of_port_get_parent_device (src_port);of_node_put (src_port); +if (!src_node) +return NULL ; + +/* ... and finally the source. */ + src =omap_dss_find_output_by_port (src_node, port_number); +of_node_put (src_node);return src ? src :ERR_PTR (-EPROBE_DEFER ); }
drivers/gpu/drm/omapdrm/dss/omapdss.h +2 -4
@@ -576,7 +576,8 @@ int omap_dss_get_num_overlays(void);int omapdss_register_output (struct omap_dss_device *output);void omapdss_unregister_output (struct omap_dss_device *output);struct omap_dss_device *omap_dss_get_output (enum omap_dss_output_id id); -struct omap_dss_device *omap_dss_find_output_by_port_node (struct device_node *port); +struct omap_dss_device *omap_dss_find_output_by_port (struct device_node *src, +unsigned int port);int omapdss_output_set_device (struct omap_dss_device *out,struct omap_dss_device *dssdev);int omapdss_output_unset_device (struct omap_dss_device *out);
@@ -603,9 +604,6 @@ static inline bool omapdss_device_is_enabled(struct omap_dss_device *dssdev)struct omap_dss_device *omapdss_of_find_source_for_first_ep (struct device_node *node); -struct device_node *dss_of_port_get_parent_device (struct device_node *port); -u32 dss_of_port_get_port_number (struct device_node *port); -enum dss_writeback_channel {DSS_WB_LCD1_MGR =0 ,DSS_WB_LCD2_MGR =1 ,
drivers/gpu/drm/omapdrm/dss/output.c +3 -14
@@ -122,27 +122,16 @@ struct omap_dss_device *omap_dss_get_output(enum omap_dss_output_id id) }EXPORT_SYMBOL (omap_dss_get_output); -struct omap_dss_device *omap_dss_find_output_by_port_node (struct device_node *port) +struct omap_dss_device *omap_dss_find_output_by_port (struct device_node *src, +unsigned int port) { -struct device_node *src_node;struct omap_dss_device *out; -u32 reg; - - src_node =dss_of_port_get_parent_device (port); -if (!src_node) -return NULL ; - - reg =dss_of_port_get_port_number (port);list_for_each_entry (out, &output_list, output_list) { -if (out->dev->of_node == src_node && out->port_num == reg) { -of_node_put (src_node); +if (out->dev->of_node == src && out->port_num == port)return omap_dss_get_device (out); - } } -of_node_put (src_node); -return NULL ; }
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 17/60] drm/omap: dss: Rework output lookup by port node
Hi,
Quoted 7 lines · Laurent Pinchart
The
omap_dss_find_output_by_port_node()function defined inoutput.clooks up an output from its port node. To do so it needs to call helper functions fromdss-of.cto lookup the port parent and the port number. Asomap_dss_find_output_by_port_node()is only called byomapdss_of_find_source_for_first_ep()fromdss-of.cthis goes back and forth between the to source files and isn't very clear.
Quoted 6 lines
Simplify the code by passing both the parent and the port number to
omap_dss_find_output_by_port_node()instead of the port node, and rename the function toomap_dss_find_output_by_port().Signed-off-by Laurent Pinchart <[email protected]>---
-- Sebastian
Quoted 144 lines
drivers/gpu/drm/omapdrm/dss/dss-of.c | 39 ++++++++++++++++------------------- drivers/gpu/drm/omapdrm/dss/omapdss.h | 6 ++---- drivers/gpu/drm/omapdrm/dss/output.c | 17 +++------------ 3 files changed, 23 insertions(+), 39 deletions(-)drivers/gpu/drm/omapdrm/dss/dss-of.c +18
-21@@ -21,7 +21,8 @@#include "omapdss.h" -struct device_node *dss_of_port_get_parent_device (struct device_node *port) +static struct device_node * +dss_of_port_get_parent_device (struct device_node *port) {struct device_node *np;int i;@@ -45,40 +46,36 @@ struct device_node *dss_of_port_get_parent_device(struct device_node *port)return NULL ; } -u32 dss_of_port_get_port_number (struct device_node *port) -{ -int r; -u32 reg; - - r =of_property_read_u32 (port,"reg" , ®); -if (r) - reg =0 ; - -return reg; -} -struct omap_dss_device *omapdss_of_find_source_for_first_ep (struct device_node *node) { -struct device_node *ep; +struct device_node *src_node;struct device_node *src_port; +struct device_node *ep;struct omap_dss_device *src; +u32 port_number =0 ; +/* Get the endpoint... */ ep =of_graph_get_endpoint_by_regs (node,0 ,0 );if (!ep)return ERR_PTR (-EINVAL ); +/* ... and its remote port... */ src_port =of_graph_get_remote_port (ep); -if (!src_port) { -of_node_put (ep); -return ERR_PTR (-EINVAL ); - } -of_node_put (ep); +if (!src_port) +return ERR_PTR (-EINVAL ); - src =omap_dss_find_output_by_port_node (src_port); - +/* ... and the remote port's number and parent... */ +of_property_read_u32 (src_port,"reg" , &port_number); + src_node =dss_of_port_get_parent_device (src_port);of_node_put (src_port); +if (!src_node) +return NULL ; + +/* ... and finally the source. */ + src =omap_dss_find_output_by_port (src_node, port_number); +of_node_put (src_node);return src ? src :ERR_PTR (-EPROBE_DEFER ); }drivers/gpu/drm/omapdrm/dss/omapdss.h +2
-4@@ -576,7 +576,8 @@ int omap_dss_get_num_overlays(void);int omapdss_register_output (struct omap_dss_device *output);void omapdss_unregister_output (struct omap_dss_device *output);struct omap_dss_device *omap_dss_get_output (enum omap_dss_output_id id); -struct omap_dss_device *omap_dss_find_output_by_port_node (struct device_node *port); +struct omap_dss_device *omap_dss_find_output_by_port (struct device_node *src, +unsigned int port);int omapdss_output_set_device (struct omap_dss_device *out,struct omap_dss_device *dssdev);int omapdss_output_unset_device (struct omap_dss_device *out);@@ -603,9 +604,6 @@ static inline bool omapdss_device_is_enabled(struct omap_dss_device *dssdev)struct omap_dss_device *omapdss_of_find_source_for_first_ep (struct device_node *node); -struct device_node *dss_of_port_get_parent_device (struct device_node *port); -u32 dss_of_port_get_port_number (struct device_node *port); -enum dss_writeback_channel {DSS_WB_LCD1_MGR =0 ,DSS_WB_LCD2_MGR =1 ,drivers/gpu/drm/omapdrm/dss/output.c +3
-14@@ -122,27 +122,16 @@ struct omap_dss_device *omap_dss_get_output(enum omap_dss_output_id id) }EXPORT_SYMBOL (omap_dss_get_output); -struct omap_dss_device *omap_dss_find_output_by_port_node (struct device_node *port) +struct omap_dss_device *omap_dss_find_output_by_port (struct device_node *src, +unsigned int port) { -struct device_node *src_node;struct omap_dss_device *out; -u32 reg; - - src_node =dss_of_port_get_parent_device (port); -if (!src_node) -return NULL ; - - reg =dss_of_port_get_port_number (port);list_for_each_entry (out, &output_list, output_list) { -if (out->dev->of_node == src_node && out->port_num == reg) { -of_node_put (src_node); +if (out->dev->of_node == src && out->port_num == port)return omap_dss_get_device (out); - } } -of_node_put (src_node); -return NULL ; }Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 18/60 drm/omap: dss: Allow looking up any device by port
In reply to Laurent PinchartThe omap_dss_find_output_by_port() function looks up an omap_dss_device by port from the list of devices registered as outputs. In preparation for looking up sinks in addition to sources, allow the function to look up any registered device. Rename it to omap_dss_find_device_by_port() to match its new purpose.
--- drivers/gpu/drm/omapdrm/dss/base.c | 13 +++++++++++++ drivers/gpu/drm/omapdrm/dss/dss-of.c | 2 +- drivers/gpu/drm/omapdrm/dss/omapdss.h | 4 ++-- drivers/gpu/drm/omapdrm/dss/output.c | 13 ------------- 4 files changed, 16 insertions(+), 16 deletions(-)
drivers/gpu/drm/omapdrm/dss/base.c +13 -0
@@ -89,6 +89,19 @@ static bool omapdss_device_is_registered(struct device_node *node)return found; } +struct omap_dss_device *omapdss_find_device_by_port (struct device_node *src, +unsigned int port) +{ +struct omap_dss_device *dssdev; + +list_for_each_entry (dssdev, &omapdss_devices_list, list) { +if (dssdev->dev->of_node == src && dssdev->port_num == port) +return omap_dss_get_device (dssdev); + } + +return NULL ; +} +/* ----------------------------------------------------------------------------- * Components Handling */
drivers/gpu/drm/omapdrm/dss/dss-of.c +1 -1
@@ -74,7 +74,7 @@ omapdss_of_find_source_for_first_ep(struct device_node *node)return NULL ;/* ... and finally the source. */ - src =omap_dss_find_output_by_port (src_node, port_number); + src =omapdss_find_device_by_port (src_node, port_number);of_node_put (src_node);return src ? src :ERR_PTR (-EPROBE_DEFER );
drivers/gpu/drm/omapdrm/dss/omapdss.h +2 -2
@@ -563,6 +563,8 @@ void omapdss_unregister_display(struct omap_dss_device *dssdev);void omapdss_device_register (struct omap_dss_device *dssdev);void omapdss_device_unregister (struct omap_dss_device *dssdev); +struct omap_dss_device *omapdss_find_device_by_port (struct device_node *src, +unsigned int port);struct omap_dss_device *omap_dss_get_device (struct omap_dss_device *dssdev);void omap_dss_put_device (struct omap_dss_device *dssdev);
@@ -576,8 +578,6 @@ int omap_dss_get_num_overlays(void);int omapdss_register_output (struct omap_dss_device *output);void omapdss_unregister_output (struct omap_dss_device *output);struct omap_dss_device *omap_dss_get_output (enum omap_dss_output_id id); -struct omap_dss_device *omap_dss_find_output_by_port (struct device_node *src, -unsigned int port);int omapdss_output_set_device (struct omap_dss_device *out,struct omap_dss_device *dssdev);int omapdss_output_unset_device (struct omap_dss_device *out);
drivers/gpu/drm/omapdrm/dss/output.c +0 -13
@@ -122,19 +122,6 @@ struct omap_dss_device *omap_dss_get_output(enum omap_dss_output_id id) }EXPORT_SYMBOL (omap_dss_get_output); -struct omap_dss_device *omap_dss_find_output_by_port (struct device_node *src, -unsigned int port) -{ -struct omap_dss_device *out; - -list_for_each_entry (out, &output_list, output_list) { -if (out->dev->of_node == src && out->port_num == port) -return omap_dss_get_device (out); - } - -return NULL ; -} -struct omap_dss_device *omapdss_find_output_from_display (struct omap_dss_device *dssdev) {while (dssdev->src)
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 18/60] drm/omap: dss: Allow looking up any device by port
Hi,
Quoted 8 lines · Laurent Pinchart
The
omap_dss_find_output_by_port()function looks up anomap_dss_deviceby port from the list of devices registered as outputs. In preparation for looking up sinks in addition to sources, allow the function to look up any registered device. Rename it toomap_dss_find_device_by_port()to match its new purpose.Signed-off-by Laurent Pinchart <[email protected]>---
-- Sebastian
Quoted 98 lines
drivers/gpu/drm/omapdrm/dss/base.c | 13 +++++++++++++ drivers/gpu/drm/omapdrm/dss/dss-of.c | 2 +- drivers/gpu/drm/omapdrm/dss/omapdss.h | 4 ++-- drivers/gpu/drm/omapdrm/dss/output.c | 13 ------------- 4 files changed, 16 insertions(+), 16 deletions(-)drivers/gpu/drm/omapdrm/dss/base.c +13
-0@@ -89,6 +89,19 @@ static bool omapdss_device_is_registered(struct device_node *node)return found; } +struct omap_dss_device *omapdss_find_device_by_port (struct device_node *src, +unsigned int port) +{ +struct omap_dss_device *dssdev; + +list_for_each_entry (dssdev, &omapdss_devices_list, list) { +if (dssdev->dev->of_node == src && dssdev->port_num == port) +return omap_dss_get_device (dssdev); + } + +return NULL ; +} +/* ----------------------------------------------------------------------------- * Components Handling */ drivers/gpu/drm/omapdrm/dss/dss-of.c +1
-1@@ -74,7 +74,7 @@ omapdss_of_find_source_for_first_ep(struct device_node *node)return NULL ;/* ... and finally the source. */ - src =omap_dss_find_output_by_port (src_node, port_number); + src =omapdss_find_device_by_port (src_node, port_number);of_node_put (src_node);return src ? src :ERR_PTR (-EPROBE_DEFER );drivers/gpu/drm/omapdrm/dss/omapdss.h +2
-2@@ -563,6 +563,8 @@ void omapdss_unregister_display(struct omap_dss_device *dssdev);void omapdss_device_register (struct omap_dss_device *dssdev);void omapdss_device_unregister (struct omap_dss_device *dssdev); +struct omap_dss_device *omapdss_find_device_by_port (struct device_node *src, +unsigned int port);struct omap_dss_device *omap_dss_get_device (struct omap_dss_device *dssdev);void omap_dss_put_device (struct omap_dss_device *dssdev);@@ -576,8 +578,6 @@ int omap_dss_get_num_overlays(void);int omapdss_register_output (struct omap_dss_device *output);void omapdss_unregister_output (struct omap_dss_device *output);struct omap_dss_device *omap_dss_get_output (enum omap_dss_output_id id); -struct omap_dss_device *omap_dss_find_output_by_port (struct device_node *src, -unsigned int port);int omapdss_output_set_device (struct omap_dss_device *out,struct omap_dss_device *dssdev);int omapdss_output_unset_device (struct omap_dss_device *out);drivers/gpu/drm/omapdrm/dss/output.c +0
-13@@ -122,19 +122,6 @@ struct omap_dss_device *omap_dss_get_output(enum omap_dss_output_id id) }EXPORT_SYMBOL (omap_dss_get_output); -struct omap_dss_device *omap_dss_find_output_by_port (struct device_node *src, -unsigned int port) -{ -struct omap_dss_device *out; - -list_for_each_entry (out, &output_list, output_list) { -if (out->dev->of_node == src && out->port_num == port) -return omap_dss_get_device (out); - } - -return NULL ; -} -struct omap_dss_device *omapdss_find_output_from_display (struct omap_dss_device *dssdev) {while (dssdev->src)Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 19/60 drm/omap: dss: Move common device operations to common structure
In reply to Laurent PinchartThe various types of omapdss_*_ops structures define multiple operations that are not specific to a bus type. To simplify the code and remove dependencies on specific bus types move those operations to a common structure. Operations that are specific to a bus type are kept in the specialized ops structures.
--- .../gpu/drm/omapdrm/displays/connector-analog-tv.c | 14 +-- drivers/gpu/drm/omapdrm/displays/connector-dvi.c | 14 +-- drivers/gpu/drm/omapdrm/displays/connector-hdmi.c | 42 ++++---- drivers/gpu/drm/omapdrm/displays/encoder-opa362.c | 20 ++-- drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c | 20 ++-- .../gpu/drm/omapdrm/displays/encoder-tpd12s015.c | 48 ++++----- drivers/gpu/drm/omapdrm/displays/panel-dpi.c | 16 +-- drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 120 ++++++++++----------- .../omapdrm/displays/panel-lgphilips-lb035q02.c | 14 +-- .../drm/omapdrm/displays/panel-nec-nl8048hl11.c | 14 +-- .../drm/omapdrm/displays/panel-sharp-ls037v7dw01.c | 14 +-- .../drm/omapdrm/displays/panel-sony-acx565akm.c | 14 +-- .../drm/omapdrm/displays/panel-tpo-td028ttec1.c | 14 +-- .../drm/omapdrm/displays/panel-tpo-td043mtea1.c | 16 +-- drivers/gpu/drm/omapdrm/dss/dpi.c | 4 +- drivers/gpu/drm/omapdrm/dss/dsi.c | 50 ++++----- drivers/gpu/drm/omapdrm/dss/hdmi4.c | 14 +-- drivers/gpu/drm/omapdrm/dss/hdmi5.c | 12 ++- drivers/gpu/drm/omapdrm/dss/omapdss.h | 109 ++++--------------- drivers/gpu/drm/omapdrm/dss/sdi.c | 4 +- drivers/gpu/drm/omapdrm/dss/venc.c | 4 +- 21 files changed, 256 insertions(+), 321 deletions(-)
drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c +7 -7
@@ -59,7 +59,7 @@ static int tvc_connect(struct omap_dss_device *dssdev)return PTR_ERR (in); } - r = in->ops.atv->connect (in, dssdev); + r = in->ops->connect (in, dssdev);if (r) {omap_dss_put_device (in);return r;
@@ -79,7 +79,7 @@ static void tvc_disconnect(struct omap_dss_device *dssdev)if (!omapdss_device_is_connected (dssdev))return ; - in->ops.atv->disconnect (in, dssdev); + in->ops->disconnect (in, dssdev);omap_dss_put_device (in); ddata->in =NULL ;
@@ -99,9 +99,9 @@ static int tvc_enable(struct omap_dss_device *dssdev)if (omapdss_device_is_enabled (dssdev))return 0 ; - in->ops.atv->set_timings (in, &ddata->vm); + in->ops->set_timings (in, &ddata->vm); - r = in->ops.atv->enable (in); + r = in->ops->enable (in);if (r)return r;
@@ -120,7 +120,7 @@ static void tvc_disable(struct omap_dss_device *dssdev)if (!omapdss_device_is_enabled (dssdev))return ; - in->ops.atv->disable (in); + in->ops->disable (in); dssdev->state =OMAP_DSS_DISPLAY_DISABLED ; }
@@ -133,7 +133,7 @@ static void tvc_set_timings(struct omap_dss_device *dssdev, ddata->vm = *vm; - in->ops.atv->set_timings (in, vm); + in->ops->set_timings (in, vm); } static void tvc_get_timings(struct omap_dss_device *dssdev,
@@ -150,7 +150,7 @@ static int tvc_check_timings(struct omap_dss_device *dssdev,struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -return in->ops.atv->check_timings (in, vm); +return in->ops->check_timings (in, vm); }static const struct omap_dss_driver tvc_driver = {
drivers/gpu/drm/omapdrm/displays/connector-dvi.c +7 -7
@@ -72,7 +72,7 @@ static int dvic_connect(struct omap_dss_device *dssdev)return PTR_ERR (in); } - r = in->ops.dvi->connect (in, dssdev); + r = in->ops->connect (in, dssdev);if (r) {omap_dss_put_device (in);return r;
@@ -90,7 +90,7 @@ static void dvic_disconnect(struct omap_dss_device *dssdev)if (!omapdss_device_is_connected (dssdev))return ; - in->ops.dvi->disconnect (in, dssdev); + in->ops->disconnect (in, dssdev);omap_dss_put_device (in); ddata->in =NULL ;
@@ -108,9 +108,9 @@ static int dvic_enable(struct omap_dss_device *dssdev)if (omapdss_device_is_enabled (dssdev))return 0 ; - in->ops.dvi->set_timings (in, &ddata->vm); + in->ops->set_timings (in, &ddata->vm); - r = in->ops.dvi->enable (in); + r = in->ops->enable (in);if (r)return r;
@@ -127,7 +127,7 @@ static void dvic_disable(struct omap_dss_device *dssdev)if (!omapdss_device_is_enabled (dssdev))return ; - in->ops.dvi->disable (in); + in->ops->disable (in); dssdev->state =OMAP_DSS_DISPLAY_DISABLED ; }
@@ -140,7 +140,7 @@ static void dvic_set_timings(struct omap_dss_device *dssdev, ddata->vm = *vm; - in->ops.dvi->set_timings (in, vm); + in->ops->set_timings (in, vm); } static void dvic_get_timings(struct omap_dss_device *dssdev,
@@ -157,7 +157,7 @@ static int dvic_check_timings(struct omap_dss_device *dssdev,struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -return in->ops.dvi->check_timings (in, vm); +return in->ops->check_timings (in, vm); } static int dvic_ddc_read(struct i2c_adapter *adapter,
drivers/gpu/drm/omapdrm/displays/connector-hdmi.c +21 -21
127 lines not on this page · raw message
drivers/gpu/drm/omapdrm/displays/encoder-opa362.c +9 -11
@@ -50,7 +50,7 @@ static int opa362_connect(struct omap_dss_device *dssdev,return PTR_ERR (in); } - r = in->ops.atv->connect (in, dssdev); + r = in->ops->connect (in, dssdev);if (r) {omap_dss_put_device (in);return r;
@@ -82,7 +82,7 @@ static void opa362_disconnect(struct omap_dss_device *dssdev, dst->src =NULL ; dssdev->dst =NULL ; - in->ops.atv->disconnect (in, &ddata->dssdev); + in->ops->disconnect (in, &ddata->dssdev);omap_dss_put_device (in); ddata->in =NULL ;
@@ -102,9 +102,9 @@ static int opa362_enable(struct omap_dss_device *dssdev)if (omapdss_device_is_enabled (dssdev))return 0 ; - in->ops.atv->set_timings (in, &ddata->vm); + in->ops->set_timings (in, &ddata->vm); - r = in->ops.atv->enable (in); + r = in->ops->enable (in);if (r)return r;
@@ -129,7 +129,7 @@ static void opa362_disable(struct omap_dss_device *dssdev)if (ddata->enable_gpio)gpiod_set_value_cansleep (ddata->enable_gpio,0 ); - in->ops.atv->disable (in); + in->ops->disable (in); dssdev->state =OMAP_DSS_DISPLAY_DISABLED ; }
@@ -144,7 +144,7 @@ static void opa362_set_timings(struct omap_dss_device *dssdev, ddata->vm = *vm; - in->ops.atv->set_timings (in, vm); + in->ops->set_timings (in, vm); } static int opa362_check_timings(struct omap_dss_device *dssdev,
@@ -155,16 +155,14 @@ static int opa362_check_timings(struct omap_dss_device *dssdev,dev_dbg (dssdev->dev,"check_timings\n" ); -return in->ops.atv->check_timings (in, vm); +return in->ops->check_timings (in, vm); } -static const struct omapdss_atv_ops opa362_atv_ops = { +static const struct omap_dss_device_ops opa362_ops = { .connect = opa362_connect, .disconnect = opa362_disconnect, - .enable = opa362_enable, .disable = opa362_disable, - .check_timings = opa362_check_timings, .set_timings = opa362_set_timings, };
@@ -191,7 +189,7 @@ static int opa362_probe(struct platform_device *pdev) ddata->enable_gpio = gpio; dssdev = &ddata->dssdev; - dssdev->ops.atv = &opa362_atv_ops; + dssdev->ops = &opa362_ops; dssdev->dev = &pdev->dev; dssdev->type =OMAP_DISPLAY_TYPE_VENC ; dssdev->output_type =OMAP_DISPLAY_TYPE_VENC ;
drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c +9 -11
@@ -44,7 +44,7 @@ static int tfp410_connect(struct omap_dss_device *dssdev,return PTR_ERR (in); } - r = in->ops.dpi->connect (in, dssdev); + r = in->ops->connect (in, dssdev);if (r) {omap_dss_put_device (in);return r;
@@ -74,7 +74,7 @@ static void tfp410_disconnect(struct omap_dss_device *dssdev, dst->src =NULL ; dssdev->dst =NULL ; - in->ops.dpi->disconnect (in, &ddata->dssdev); + in->ops->disconnect (in, &ddata->dssdev);omap_dss_put_device (in); ddata->in =NULL ;
@@ -92,9 +92,9 @@ static int tfp410_enable(struct omap_dss_device *dssdev)if (omapdss_device_is_enabled (dssdev))return 0 ; - in->ops.dpi->set_timings (in, &ddata->vm); + in->ops->set_timings (in, &ddata->vm); - r = in->ops.dpi->enable (in); + r = in->ops->enable (in);if (r)return r;
@@ -117,7 +117,7 @@ static void tfp410_disable(struct omap_dss_device *dssdev)if (gpio_is_valid (ddata->pd_gpio))gpio_set_value_cansleep (ddata->pd_gpio,0 ); - in->ops.dpi->disable (in); + in->ops->disable (in); dssdev->state =OMAP_DSS_DISPLAY_DISABLED ; }
@@ -138,7 +138,7 @@ static void tfp410_set_timings(struct omap_dss_device *dssdev, ddata->vm = *vm; - in->ops.dpi->set_timings (in, vm); + in->ops->set_timings (in, vm); } static int tfp410_check_timings(struct omap_dss_device *dssdev,
@@ -149,16 +149,14 @@ static int tfp410_check_timings(struct omap_dss_device *dssdev,tfp410_fix_timings (vm); -return in->ops.dpi->check_timings (in, vm); +return in->ops->check_timings (in, vm); } -static const struct omapdss_dvi_ops tfp410_dvi_ops = { +static const struct omap_dss_device_ops tfp410_ops = { .connect = tfp410_connect, .disconnect = tfp410_disconnect, - .enable = tfp410_enable, .disable = tfp410_disable, - .check_timings = tfp410_check_timings, .set_timings = tfp410_set_timings, };
@@ -209,7 +207,7 @@ static int tfp410_probe(struct platform_device *pdev) } dssdev = &ddata->dssdev; - dssdev->ops.dvi = &tfp410_dvi_ops; + dssdev->ops = &tfp410_ops; dssdev->dev = &pdev->dev; dssdev->type =OMAP_DISPLAY_TYPE_DPI ; dssdev->output_type =OMAP_DISPLAY_TYPE_DVI ;
drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c +24 -24
124 lines not on this page · raw message
drivers/gpu/drm/omapdrm/displays/panel-dpi.c +8 -8
@@ -50,7 +50,7 @@ static int panel_dpi_connect(struct omap_dss_device *dssdev)return PTR_ERR (in); } - r = in->ops.dpi->connect (in, dssdev); + r = in->ops->connect (in, dssdev);if (r) {omap_dss_put_device (in);return r;
@@ -68,7 +68,7 @@ static void panel_dpi_disconnect(struct omap_dss_device *dssdev)if (!omapdss_device_is_connected (dssdev))return ; - in->ops.dpi->disconnect (in, dssdev); + in->ops->disconnect (in, dssdev);omap_dss_put_device (in); ddata->in =NULL ;
@@ -86,15 +86,15 @@ static int panel_dpi_enable(struct omap_dss_device *dssdev)if (omapdss_device_is_enabled (dssdev))return 0 ; - in->ops.dpi->set_timings (in, &ddata->vm); + in->ops->set_timings (in, &ddata->vm); - r = in->ops.dpi->enable (in); + r = in->ops->enable (in);if (r)return r; r =regulator_enable (ddata->vcc_supply);if (r) { - in->ops.dpi->disable (in); + in->ops->disable (in);return r; }
@@ -119,7 +119,7 @@ static void panel_dpi_disable(struct omap_dss_device *dssdev)gpiod_set_value_cansleep (ddata->enable_gpio,0 );regulator_disable (ddata->vcc_supply); - in->ops.dpi->disable (in); + in->ops->disable (in); dssdev->state =OMAP_DSS_DISPLAY_DISABLED ; }
@@ -132,7 +132,7 @@ static void panel_dpi_set_timings(struct omap_dss_device *dssdev, ddata->vm = *vm; - in->ops.dpi->set_timings (in, vm); + in->ops->set_timings (in, vm); } static void panel_dpi_get_timings(struct omap_dss_device *dssdev,
@@ -149,7 +149,7 @@ static int panel_dpi_check_timings(struct omap_dss_device *dssdev,struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -return in->ops.dpi->check_timings (in, vm); +return in->ops->check_timings (in, vm); }static const struct omap_dss_driver panel_dpi_ops = {
drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +60 -60
437 lines not on this page · raw message
drivers/gpu/drm/omapdrm/displays/panel-lgphilips-lb035q02.c +7 -7
@@ -131,7 +131,7 @@ static int lb035q02_connect(struct omap_dss_device *dssdev)return PTR_ERR (in); } - r = in->ops.dpi->connect (in, dssdev); + r = in->ops->connect (in, dssdev);if (r) {omap_dss_put_device (in);return r;
@@ -151,7 +151,7 @@ static void lb035q02_disconnect(struct omap_dss_device *dssdev)if (!omapdss_device_is_connected (dssdev))return ; - in->ops.dpi->disconnect (in, dssdev); + in->ops->disconnect (in, dssdev);omap_dss_put_device (in); ddata->in =NULL ;
@@ -169,9 +169,9 @@ static int lb035q02_enable(struct omap_dss_device *dssdev)if (omapdss_device_is_enabled (dssdev))return 0 ; - in->ops.dpi->set_timings (in, &ddata->vm); + in->ops->set_timings (in, &ddata->vm); - r = in->ops.dpi->enable (in); + r = in->ops->enable (in);if (r)return r;
@@ -194,7 +194,7 @@ static void lb035q02_disable(struct omap_dss_device *dssdev)if (ddata->enable_gpio)gpiod_set_value_cansleep (ddata->enable_gpio,0 ); - in->ops.dpi->disable (in); + in->ops->disable (in); dssdev->state =OMAP_DSS_DISPLAY_DISABLED ; }
@@ -207,7 +207,7 @@ static void lb035q02_set_timings(struct omap_dss_device *dssdev, ddata->vm = *vm; - in->ops.dpi->set_timings (in, vm); + in->ops->set_timings (in, vm); } static void lb035q02_get_timings(struct omap_dss_device *dssdev,
@@ -224,7 +224,7 @@ static int lb035q02_check_timings(struct omap_dss_device *dssdev,struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -return in->ops.dpi->check_timings (in, vm); +return in->ops->check_timings (in, vm); }static const struct omap_dss_driver lb035q02_ops = {
drivers/gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c +7 -7
@@ -127,7 +127,7 @@ static int nec_8048_connect(struct omap_dss_device *dssdev)return PTR_ERR (in); } - r = in->ops.dpi->connect (in, dssdev); + r = in->ops->connect (in, dssdev);if (r) {omap_dss_put_device (in);return r;
@@ -145,7 +145,7 @@ static void nec_8048_disconnect(struct omap_dss_device *dssdev)if (!omapdss_device_is_connected (dssdev))return ; - in->ops.dpi->disconnect (in, dssdev); + in->ops->disconnect (in, dssdev);omap_dss_put_device (in); ddata->in =NULL ;
@@ -163,9 +163,9 @@ static int nec_8048_enable(struct omap_dss_device *dssdev)if (omapdss_device_is_enabled (dssdev))return 0 ; - in->ops.dpi->set_timings (in, &ddata->vm); + in->ops->set_timings (in, &ddata->vm); - r = in->ops.dpi->enable (in); + r = in->ops->enable (in);if (r)return r;
@@ -188,7 +188,7 @@ static void nec_8048_disable(struct omap_dss_device *dssdev)if (gpio_is_valid (ddata->res_gpio))gpio_set_value_cansleep (ddata->res_gpio,0 ); - in->ops.dpi->disable (in); + in->ops->disable (in); dssdev->state =OMAP_DSS_DISPLAY_DISABLED ; }
@@ -201,7 +201,7 @@ static void nec_8048_set_timings(struct omap_dss_device *dssdev, ddata->vm = *vm; - in->ops.dpi->set_timings (in, vm); + in->ops->set_timings (in, vm); } static void nec_8048_get_timings(struct omap_dss_device *dssdev,
@@ -218,7 +218,7 @@ static int nec_8048_check_timings(struct omap_dss_device *dssdev,struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -return in->ops.dpi->check_timings (in, vm); +return in->ops->check_timings (in, vm); }static const struct omap_dss_driver nec_8048_ops = {
drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c +7 -7
@@ -73,7 +73,7 @@ static int sharp_ls_connect(struct omap_dss_device *dssdev)return PTR_ERR (in); } - r = in->ops.dpi->connect (in, dssdev); + r = in->ops->connect (in, dssdev);if (r) {omap_dss_put_device (in);return r;
@@ -91,7 +91,7 @@ static void sharp_ls_disconnect(struct omap_dss_device *dssdev)if (!omapdss_device_is_connected (dssdev))return ; - in->ops.dpi->disconnect (in, dssdev); + in->ops->disconnect (in, dssdev);omap_dss_put_device (in); ddata->in =NULL ;
@@ -109,7 +109,7 @@ static int sharp_ls_enable(struct omap_dss_device *dssdev)if (omapdss_device_is_enabled (dssdev))return 0 ; - in->ops.dpi->set_timings (in, &ddata->vm); + in->ops->set_timings (in, &ddata->vm);if (ddata->vcc) { r =regulator_enable (ddata->vcc);
@@ -117,7 +117,7 @@ static int sharp_ls_enable(struct omap_dss_device *dssdev)return r; } - r = in->ops.dpi->enable (in); + r = in->ops->enable (in);if (r) {regulator_disable (ddata->vcc);return r;
@@ -155,7 +155,7 @@ static void sharp_ls_disable(struct omap_dss_device *dssdev)msleep (100 ); - in->ops.dpi->disable (in); + in->ops->disable (in);if (ddata->vcc)regulator_disable (ddata->vcc);
@@ -171,7 +171,7 @@ static void sharp_ls_set_timings(struct omap_dss_device *dssdev, ddata->vm = *vm; - in->ops.dpi->set_timings (in, vm); + in->ops->set_timings (in, vm); } static void sharp_ls_get_timings(struct omap_dss_device *dssdev,
@@ -188,7 +188,7 @@ static int sharp_ls_check_timings(struct omap_dss_device *dssdev,struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -return in->ops.dpi->check_timings (in, vm); +return in->ops->check_timings (in, vm); }static const struct omap_dss_driver sharp_ls_ops = {
drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c +7 -7
@@ -522,7 +522,7 @@ static int acx565akm_connect(struct omap_dss_device *dssdev)return PTR_ERR (in); } - r = in->ops.sdi->connect (in, dssdev); + r = in->ops->connect (in, dssdev);if (r) {omap_dss_put_device (in);return r;
@@ -540,7 +540,7 @@ static void acx565akm_disconnect(struct omap_dss_device *dssdev)if (!omapdss_device_is_connected (dssdev))return ; - in->ops.sdi->disconnect (in, dssdev); + in->ops->disconnect (in, dssdev);omap_dss_put_device (in); ddata->in =NULL ;
@@ -554,9 +554,9 @@ static int acx565akm_panel_power_on(struct omap_dss_device *dssdev)dev_dbg (&ddata->spi->dev,"%s\n" , __func__); - in->ops.sdi->set_timings (in, &ddata->vm); + in->ops->set_timings (in, &ddata->vm); - r = in->ops.sdi->enable (in); + r = in->ops->enable (in);if (r) {pr_err ("%s sdi enable failed\n" , __func__);return r;
@@ -621,7 +621,7 @@ static void acx565akm_panel_power_off(struct omap_dss_device *dssdev)/* FIXME need to tweak this delay */ msleep (100 ); - in->ops.sdi->disable (in); + in->ops->disable (in); }static int acx565akm_enable (struct omap_dss_device *dssdev)
@@ -672,7 +672,7 @@ static void acx565akm_set_timings(struct omap_dss_device *dssdev, ddata->vm = *vm; - in->ops.sdi->set_timings (in, vm); + in->ops->set_timings (in, vm); } static void acx565akm_get_timings(struct omap_dss_device *dssdev,
@@ -689,7 +689,7 @@ static int acx565akm_check_timings(struct omap_dss_device *dssdev,struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -return in->ops.sdi->check_timings (in, vm); +return in->ops->check_timings (in, vm); }static const struct omap_dss_driver acx565akm_ops = {
drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c +7 -7
@@ -181,7 +181,7 @@ static int td028ttec1_panel_connect(struct omap_dss_device *dssdev)return PTR_ERR (in); } - r = in->ops.dpi->connect (in, dssdev); + r = in->ops->connect (in, dssdev);if (r) {omap_dss_put_device (in);return r;
@@ -199,7 +199,7 @@ static void td028ttec1_panel_disconnect(struct omap_dss_device *dssdev)if (!omapdss_device_is_connected (dssdev))return ; - in->ops.dpi->disconnect (in, dssdev); + in->ops->disconnect (in, dssdev);omap_dss_put_device (in); ddata->in =NULL ;
@@ -217,9 +217,9 @@ static int td028ttec1_panel_enable(struct omap_dss_device *dssdev)if (omapdss_device_is_enabled (dssdev))return 0 ; - in->ops.dpi->set_timings (in, &ddata->vm); + in->ops->set_timings (in, &ddata->vm); - r = in->ops.dpi->enable (in); + r = in->ops->enable (in);if (r)return r;
@@ -328,7 +328,7 @@ static void td028ttec1_panel_disable(struct omap_dss_device *dssdev)jbt_ret_write_0 (ddata,JBT_REG_SLEEP_IN );jbt_reg_write_1 (ddata,JBT_REG_POWER_ON_OFF ,0x00 ); - in->ops.dpi->disable (in); + in->ops->disable (in); dssdev->state =OMAP_DSS_DISPLAY_DISABLED ; }
@@ -341,7 +341,7 @@ static void td028ttec1_panel_set_timings(struct omap_dss_device *dssdev, ddata->vm = *vm; - in->ops.dpi->set_timings (in, vm); + in->ops->set_timings (in, vm); } static void td028ttec1_panel_get_timings(struct omap_dss_device *dssdev,
@@ -358,7 +358,7 @@ static int td028ttec1_panel_check_timings(struct omap_dss_device *dssdev,struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -return in->ops.dpi->check_timings (in, vm); +return in->ops->check_timings (in, vm); }static const struct omap_dss_driver td028ttec1_ops = {
drivers/gpu/drm/omapdrm/displays/panel-tpo-td043mtea1.c +8 -8
@@ -352,7 +352,7 @@ static int tpo_td043_connect(struct omap_dss_device *dssdev)return PTR_ERR (in); } - r = in->ops.dpi->connect (in, dssdev); + r = in->ops->connect (in, dssdev);if (r) {omap_dss_put_device (in);return r;
@@ -370,7 +370,7 @@ static void tpo_td043_disconnect(struct omap_dss_device *dssdev)if (!omapdss_device_is_connected (dssdev))return ; - in->ops.dpi->disconnect (in, dssdev); + in->ops->disconnect (in, dssdev);omap_dss_put_device (in); ddata->in =NULL ;
@@ -388,9 +388,9 @@ static int tpo_td043_enable(struct omap_dss_device *dssdev)if (omapdss_device_is_enabled (dssdev))return 0 ; - in->ops.dpi->set_timings (in, &ddata->vm); + in->ops->set_timings (in, &ddata->vm); - r = in->ops.dpi->enable (in); + r = in->ops->enable (in);if (r)return r;
@@ -401,7 +401,7 @@ static int tpo_td043_enable(struct omap_dss_device *dssdev)if (!ddata->spi_suspended) { r =tpo_td043_power_on (ddata);if (r) { - in->ops.dpi->disable (in); + in->ops->disable (in);return r; } }
@@ -419,7 +419,7 @@ static void tpo_td043_disable(struct omap_dss_device *dssdev)if (!omapdss_device_is_enabled (dssdev))return ; - in->ops.dpi->disable (in); + in->ops->disable (in);if (!ddata->spi_suspended)tpo_td043_power_off (ddata);
@@ -435,7 +435,7 @@ static void tpo_td043_set_timings(struct omap_dss_device *dssdev, ddata->vm = *vm; - in->ops.dpi->set_timings (in, vm); + in->ops->set_timings (in, vm); } static void tpo_td043_get_timings(struct omap_dss_device *dssdev,
@@ -452,7 +452,7 @@ static int tpo_td043_check_timings(struct omap_dss_device *dssdev,struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -return in->ops.dpi->check_timings (in, vm); +return in->ops->check_timings (in, vm); }static const struct omap_dss_driver tpo_td043_ops = {
drivers/gpu/drm/omapdrm/dss/dpi.c +2 -2
@@ -681,7 +681,7 @@ static void dpi_disconnect(struct omap_dss_device *dssdev,dss_mgr_disconnect (&dpi->output, dssdev); } -static const struct omapdss_dpi_ops dpi_ops = { +static const struct omap_dss_device_ops dpi_ops = { .connect = dpi_connect, .disconnect = dpi_disconnect,
@@ -720,7 +720,7 @@ static void dpi_init_output_port(struct dpi_data *dpi, struct device_node *port) out->output_type =OMAP_DISPLAY_TYPE_DPI ; out->dispc_channel =dpi_get_channel (dpi, port_num); out->port_num = port_num; - out->ops.dpi = &dpi_ops; + out->ops = &dpi_ops; out->owner =THIS_MODULE ;omapdss_register_output (out);
drivers/gpu/drm/omapdrm/dss/dsi.c +26 -24
76 lines not on this page · raw message
drivers/gpu/drm/omapdrm/dss/hdmi4.c +8 -6
@@ -540,7 +540,7 @@ static int hdmi_set_hdmi_mode(struct omap_dss_device *dssdev,return 0 ; } -static const struct omapdss_hdmi_ops hdmi_ops = { +static const struct omap_dss_device_ops hdmi_ops = { .connect = hdmi_connect, .disconnect = hdmi_disconnect,
@@ -550,10 +550,12 @@ static const struct omapdss_hdmi_ops hdmi_ops = { .check_timings = hdmi_display_check_timing, .set_timings = hdmi_display_set_timing, - .read_edid = hdmi_read_edid, - .lost_hotplug = hdmi_lost_hotplug, - .set_infoframe = hdmi_set_infoframe, - .set_hdmi_mode = hdmi_set_hdmi_mode, + .hdmi = { + .read_edid = hdmi_read_edid, + .lost_hotplug = hdmi_lost_hotplug, + .set_infoframe = hdmi_set_infoframe, + .set_hdmi_mode = hdmi_set_hdmi_mode, + }, };static void hdmi_init_output (struct omap_hdmi *hdmi)
@@ -565,7 +567,7 @@ static void hdmi_init_output(struct omap_hdmi *hdmi) out->output_type =OMAP_DISPLAY_TYPE_HDMI ; out->name ="hdmi.0" ; out->dispc_channel =OMAP_DSS_CHANNEL_DIGIT ; - out->ops.hdmi = &hdmi_ops; + out->ops = &hdmi_ops; out->owner =THIS_MODULE ;omapdss_register_output (out);
drivers/gpu/drm/omapdrm/dss/hdmi5.c +7 -5
@@ -532,7 +532,7 @@ static int hdmi_set_hdmi_mode(struct omap_dss_device *dssdev,return 0 ; } -static const struct omapdss_hdmi_ops hdmi_ops = { +static const struct omap_dss_device_ops hdmi_ops = { .connect = hdmi_connect, .disconnect = hdmi_disconnect,
@@ -542,9 +542,11 @@ static const struct omapdss_hdmi_ops hdmi_ops = { .check_timings = hdmi_display_check_timing, .set_timings = hdmi_display_set_timing, - .read_edid = hdmi_read_edid, - .set_infoframe = hdmi_set_infoframe, - .set_hdmi_mode = hdmi_set_hdmi_mode, + .hdmi = { + .read_edid = hdmi_read_edid, + .set_infoframe = hdmi_set_infoframe, + .set_hdmi_mode = hdmi_set_hdmi_mode, + }, };static void hdmi_init_output (struct omap_hdmi *hdmi)
@@ -556,7 +558,7 @@ static void hdmi_init_output(struct omap_hdmi *hdmi) out->output_type =OMAP_DISPLAY_TYPE_HDMI ; out->name ="hdmi.0" ; out->dispc_channel =OMAP_DSS_CHANNEL_DIGIT ; - out->ops.hdmi = &hdmi_ops; + out->ops = &hdmi_ops; out->owner =THIS_MODULE ;omapdss_register_output (out);
drivers/gpu/drm/omapdrm/dss/omapdss.h +21 -88
134 lines not on this page · raw message
drivers/gpu/drm/omapdrm/dss/sdi.c +2 -2
@@ -308,7 +308,7 @@ static void sdi_disconnect(struct omap_dss_device *dssdev,dss_mgr_disconnect (&sdi->output, dssdev); } -static const struct omapdss_sdi_ops sdi_ops = { +static const struct omap_dss_device_ops sdi_ops = { .connect = sdi_connect, .disconnect = sdi_disconnect,
@@ -330,7 +330,7 @@ static void sdi_init_output(struct sdi_device *sdi) out->dispc_channel =OMAP_DSS_CHANNEL_LCD ;/* We have SDI only on OMAP3, where it's on port 1 */ out->port_num =1 ; - out->ops.sdi = &sdi_ops; + out->ops = &sdi_ops; out->owner =THIS_MODULE ;omapdss_register_output (out);
drivers/gpu/drm/omapdrm/dss/venc.c +2 -2
@@ -750,7 +750,7 @@ static void venc_disconnect(struct omap_dss_device *dssdev,dss_mgr_disconnect (&venc->output, dssdev); } -static const struct omapdss_atv_ops venc_ops = { +static const struct omap_dss_device_ops venc_ops = { .connect = venc_connect, .disconnect = venc_disconnect,
@@ -770,7 +770,7 @@ static void venc_init_output(struct venc_device *venc) out->output_type =OMAP_DISPLAY_TYPE_VENC ; out->name ="venc.0" ; out->dispc_channel =OMAP_DSS_CHANNEL_DIGIT ; - out->ops.atv = &venc_ops; + out->ops = &venc_ops; out->owner =THIS_MODULE ;omapdss_register_output (out);
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 19/60] drm/omap: dss: Move common device operations to common structure
Hi,
Quoted 8 lines · Laurent Pinchart
The various types of omapdss_*_ops structures define multiple operations that are not specific to a bus type. To simplify the code and remove dependencies on specific bus types move those operations to a common structure. Operations that are specific to a bus type are kept in the specialized ops structures.
Signed-off-by Laurent Pinchart <[email protected]>---
-- Sebastian
Quoted 1,897 lines
.../gpu/drm/omapdrm/displays/connector-analog-tv.c | 14 +-- drivers/gpu/drm/omapdrm/displays/connector-dvi.c | 14 +-- drivers/gpu/drm/omapdrm/displays/connector-hdmi.c | 42 ++++---- drivers/gpu/drm/omapdrm/displays/encoder-opa362.c | 20 ++-- drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c | 20 ++-- .../gpu/drm/omapdrm/displays/encoder-tpd12s015.c | 48 ++++----- drivers/gpu/drm/omapdrm/displays/panel-dpi.c | 16 +-- drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 120 ++++++++++----------- .../omapdrm/displays/panel-lgphilips-lb035q02.c | 14 +-- .../drm/omapdrm/displays/panel-nec-nl8048hl11.c | 14 +-- .../drm/omapdrm/displays/panel-sharp-ls037v7dw01.c | 14 +-- .../drm/omapdrm/displays/panel-sony-acx565akm.c | 14 +-- .../drm/omapdrm/displays/panel-tpo-td028ttec1.c | 14 +-- .../drm/omapdrm/displays/panel-tpo-td043mtea1.c | 16 +-- drivers/gpu/drm/omapdrm/dss/dpi.c | 4 +- drivers/gpu/drm/omapdrm/dss/dsi.c | 50 ++++----- drivers/gpu/drm/omapdrm/dss/hdmi4.c | 14 +-- drivers/gpu/drm/omapdrm/dss/hdmi5.c | 12 ++- drivers/gpu/drm/omapdrm/dss/omapdss.h | 109 ++++--------------- drivers/gpu/drm/omapdrm/dss/sdi.c | 4 +- drivers/gpu/drm/omapdrm/dss/venc.c | 4 +- 21 files changed, 256 insertions(+), 321 deletions(-)drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c +7
-7@@ -59,7 +59,7 @@ static int tvc_connect(struct omap_dss_device *dssdev)return PTR_ERR (in); } - r = in->ops.atv->connect (in, dssdev); + r = in->ops->connect (in, dssdev);if (r) {omap_dss_put_device (in);return r;@@ -79,7 +79,7 @@ static void tvc_disconnect(struct omap_dss_device *dssdev)if (!omapdss_device_is_connected (dssdev))return ; - in->ops.atv->disconnect (in, dssdev); + in->ops->disconnect (in, dssdev);omap_dss_put_device (in); ddata->in =NULL ;@@ -99,9 +99,9 @@ static int tvc_enable(struct omap_dss_device *dssdev)if (omapdss_device_is_enabled (dssdev))return 0 ; - in->ops.atv->set_timings (in, &ddata->vm); + in->ops->set_timings (in, &ddata->vm); - r = in->ops.atv->enable (in); + r = in->ops->enable (in);if (r)return r;@@ -120,7 +120,7 @@ static void tvc_disable(struct omap_dss_device *dssdev)if (!omapdss_device_is_enabled (dssdev))return ; - in->ops.atv->disable (in); + in->ops->disable (in); dssdev->state =OMAP_DSS_DISPLAY_DISABLED ; }@@ -133,7 +133,7 @@ static void tvc_set_timings(struct omap_dss_device *dssdev, ddata->vm = *vm; - in->ops.atv->set_timings (in, vm); + in->ops->set_timings (in, vm); } static void tvc_get_timings(struct omap_dss_device *dssdev,@@ -150,7 +150,7 @@ static int tvc_check_timings(struct omap_dss_device *dssdev,struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -return in->ops.atv->check_timings (in, vm); +return in->ops->check_timings (in, vm); }static const struct omap_dss_driver tvc_driver = {drivers/gpu/drm/omapdrm/displays/connector-dvi.c +7
-7@@ -72,7 +72,7 @@ static int dvic_connect(struct omap_dss_device *dssdev)return PTR_ERR (in); } - r = in->ops.dvi->connect (in, dssdev); + r = in->ops->connect (in, dssdev);if (r) {omap_dss_put_device (in);return r;@@ -90,7 +90,7 @@ static void dvic_disconnect(struct omap_dss_device *dssdev)if (!omapdss_device_is_connected (dssdev))return ; - in->ops.dvi->disconnect (in, dssdev); + in->ops->disconnect (in, dssdev);omap_dss_put_device (in); ddata->in =NULL ;@@ -108,9 +108,9 @@ static int dvic_enable(struct omap_dss_device *dssdev)if (omapdss_device_is_enabled (dssdev))return 0 ; - in->ops.dvi->set_timings (in, &ddata->vm); + in->ops->set_timings (in, &ddata->vm); - r = in->ops.dvi->enable (in); + r = in->ops->enable (in);if (r)return r;@@ -127,7 +127,7 @@ static void dvic_disable(struct omap_dss_device *dssdev)if (!omapdss_device_is_enabled (dssdev))return ; - in->ops.dvi->disable (in); + in->ops->disable (in); dssdev->state =OMAP_DSS_DISPLAY_DISABLED ; }@@ -140,7 +140,7 @@ static void dvic_set_timings(struct omap_dss_device *dssdev, ddata->vm = *vm; - in->ops.dvi->set_timings (in, vm); + in->ops->set_timings (in, vm); } static void dvic_get_timings(struct omap_dss_device *dssdev,@@ -157,7 +157,7 @@ static int dvic_check_timings(struct omap_dss_device *dssdev,struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -return in->ops.dvi->check_timings (in, vm); +return in->ops->check_timings (in, vm); } static int dvic_ddc_read(struct i2c_adapter *adapter,drivers/gpu/drm/omapdrm/displays/connector-hdmi.c +21
-21@@ -69,7 +69,7 @@ static int hdmic_connect(struct omap_dss_device *dssdev)return PTR_ERR (in); } - r = in->ops.hdmi->connect (in, dssdev); + r = in->ops->connect (in, dssdev);if (r) {omap_dss_put_device (in);return r;@@ -89,7 +89,7 @@ static void hdmic_disconnect(struct omap_dss_device *dssdev)if (!omapdss_device_is_connected (dssdev))return ; - in->ops.hdmi->disconnect (in, dssdev); + in->ops->disconnect (in, dssdev);omap_dss_put_device (in); ddata->in =NULL ;@@ -109,9 +109,9 @@ static int hdmic_enable(struct omap_dss_device *dssdev)if (omapdss_device_is_enabled (dssdev))return 0 ; - in->ops.hdmi->set_timings (in, &ddata->vm); + in->ops->set_timings (in, &ddata->vm); - r = in->ops.hdmi->enable (in); + r = in->ops->enable (in);if (r)return r;@@ -130,7 +130,7 @@ static void hdmic_disable(struct omap_dss_device *dssdev)if (!omapdss_device_is_enabled (dssdev))return ; - in->ops.hdmi->disable (in); + in->ops->disable (in); dssdev->state =OMAP_DSS_DISPLAY_DISABLED ; }@@ -143,7 +143,7 @@ static void hdmic_set_timings(struct omap_dss_device *dssdev, ddata->vm = *vm; - in->ops.hdmi->set_timings (in, vm); + in->ops->set_timings (in, vm); } static void hdmic_get_timings(struct omap_dss_device *dssdev,@@ -160,7 +160,7 @@ static int hdmic_check_timings(struct omap_dss_device *dssdev,struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -return in->ops.hdmi->check_timings (in, vm); +return in->ops->check_timings (in, vm); } static int hdmic_read_edid(struct omap_dss_device *dssdev,@@ -169,7 +169,7 @@ static int hdmic_read_edid(struct omap_dss_device *dssdev,struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -return in->ops.hdmi->read_edid (in, edid, len); +return in->ops->hdmi.read_edid (in, edid, len); }static bool hdmic_detect (struct omap_dss_device *dssdev)@@ -181,9 +181,9 @@ static bool hdmic_detect(struct omap_dss_device *dssdev)if (gpio_is_valid (ddata->hpd_gpio)) connected =gpio_get_value_cansleep (ddata->hpd_gpio);else - connected = in->ops.hdmi->detect (in); -if (!connected && in->ops.hdmi->lost_hotplug) - in->ops.hdmi->lost_hotplug (in); + connected = in->ops->hdmi.detect (in); +if (!connected && in->ops->hdmi.lost_hotplug) + in->ops->hdmi.lost_hotplug (in);return connected; }@@ -201,8 +201,8 @@ static int hdmic_register_hpd_cb(struct omap_dss_device *dssdev, ddata->hpd_cb_data = cb_data;mutex_unlock (&ddata->hpd_lock);return 0 ; - }else if (in->ops.hdmi->register_hpd_cb) { -return in->ops.hdmi->register_hpd_cb (in, cb, cb_data); + }else if (in->ops->hdmi.register_hpd_cb) { +return in->ops->hdmi.register_hpd_cb (in, cb, cb_data); }return -ENOTSUPP ;@@ -218,8 +218,8 @@ static void hdmic_unregister_hpd_cb(struct omap_dss_device *dssdev) ddata->hpd_cb =NULL ; ddata->hpd_cb_data =NULL ;mutex_unlock (&ddata->hpd_lock); - }else if (in->ops.hdmi->unregister_hpd_cb) { - in->ops.hdmi->unregister_hpd_cb (in); + }else if (in->ops->hdmi.unregister_hpd_cb) { + in->ops->hdmi.unregister_hpd_cb (in); } }@@ -232,8 +232,8 @@ static void hdmic_enable_hpd(struct omap_dss_device *dssdev)mutex_lock (&ddata->hpd_lock); ddata->hpd_enabled = true;mutex_unlock (&ddata->hpd_lock); - }else if (in->ops.hdmi->enable_hpd) { - in->ops.hdmi->enable_hpd (in); + }else if (in->ops->hdmi.enable_hpd) { + in->ops->hdmi.enable_hpd (in); } }@@ -246,8 +246,8 @@ static void hdmic_disable_hpd(struct omap_dss_device *dssdev)mutex_lock (&ddata->hpd_lock); ddata->hpd_enabled = false;mutex_unlock (&ddata->hpd_lock); - }else if (in->ops.hdmi->disable_hpd) { - in->ops.hdmi->disable_hpd (in); + }else if (in->ops->hdmi.disable_hpd) { + in->ops->hdmi.disable_hpd (in); } }@@ -256,7 +256,7 @@ static int hdmic_set_hdmi_mode(struct omap_dss_device *dssdev, bool hdmi_mode)struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -return in->ops.hdmi->set_hdmi_mode (in, hdmi_mode); +return in->ops->hdmi.set_hdmi_mode (in, hdmi_mode); } static int hdmic_set_infoframe(struct omap_dss_device *dssdev,@@ -265,7 +265,7 @@ static int hdmic_set_infoframe(struct omap_dss_device *dssdev,struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -return in->ops.hdmi->set_infoframe (in, avi); +return in->ops->hdmi.set_infoframe (in, avi); }static const struct omap_dss_driver hdmic_driver = {drivers/gpu/drm/omapdrm/displays/encoder-opa362.c +9
-11@@ -50,7 +50,7 @@ static int opa362_connect(struct omap_dss_device *dssdev,return PTR_ERR (in); } - r = in->ops.atv->connect (in, dssdev); + r = in->ops->connect (in, dssdev);if (r) {omap_dss_put_device (in);return r;@@ -82,7 +82,7 @@ static void opa362_disconnect(struct omap_dss_device *dssdev, dst->src =NULL ; dssdev->dst =NULL ; - in->ops.atv->disconnect (in, &ddata->dssdev); + in->ops->disconnect (in, &ddata->dssdev);omap_dss_put_device (in); ddata->in =NULL ;@@ -102,9 +102,9 @@ static int opa362_enable(struct omap_dss_device *dssdev)if (omapdss_device_is_enabled (dssdev))return 0 ; - in->ops.atv->set_timings (in, &ddata->vm); + in->ops->set_timings (in, &ddata->vm); - r = in->ops.atv->enable (in); + r = in->ops->enable (in);if (r)return r;@@ -129,7 +129,7 @@ static void opa362_disable(struct omap_dss_device *dssdev)if (ddata->enable_gpio)gpiod_set_value_cansleep (ddata->enable_gpio,0 ); - in->ops.atv->disable (in); + in->ops->disable (in); dssdev->state =OMAP_DSS_DISPLAY_DISABLED ; }@@ -144,7 +144,7 @@ static void opa362_set_timings(struct omap_dss_device *dssdev, ddata->vm = *vm; - in->ops.atv->set_timings (in, vm); + in->ops->set_timings (in, vm); } static int opa362_check_timings(struct omap_dss_device *dssdev,@@ -155,16 +155,14 @@ static int opa362_check_timings(struct omap_dss_device *dssdev,dev_dbg (dssdev->dev,"check_timings\n" ); -return in->ops.atv->check_timings (in, vm); +return in->ops->check_timings (in, vm); } -static const struct omapdss_atv_ops opa362_atv_ops = { +static const struct omap_dss_device_ops opa362_ops = { .connect = opa362_connect, .disconnect = opa362_disconnect, - .enable = opa362_enable, .disable = opa362_disable, - .check_timings = opa362_check_timings, .set_timings = opa362_set_timings, };@@ -191,7 +189,7 @@ static int opa362_probe(struct platform_device *pdev) ddata->enable_gpio = gpio; dssdev = &ddata->dssdev; - dssdev->ops.atv = &opa362_atv_ops; + dssdev->ops = &opa362_ops; dssdev->dev = &pdev->dev; dssdev->type =OMAP_DISPLAY_TYPE_VENC ; dssdev->output_type =OMAP_DISPLAY_TYPE_VENC ;drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c +9
-11@@ -44,7 +44,7 @@ static int tfp410_connect(struct omap_dss_device *dssdev,return PTR_ERR (in); } - r = in->ops.dpi->connect (in, dssdev); + r = in->ops->connect (in, dssdev);if (r) {omap_dss_put_device (in);return r;@@ -74,7 +74,7 @@ static void tfp410_disconnect(struct omap_dss_device *dssdev, dst->src =NULL ; dssdev->dst =NULL ; - in->ops.dpi->disconnect (in, &ddata->dssdev); + in->ops->disconnect (in, &ddata->dssdev);omap_dss_put_device (in); ddata->in =NULL ;@@ -92,9 +92,9 @@ static int tfp410_enable(struct omap_dss_device *dssdev)if (omapdss_device_is_enabled (dssdev))return 0 ; - in->ops.dpi->set_timings (in, &ddata->vm); + in->ops->set_timings (in, &ddata->vm); - r = in->ops.dpi->enable (in); + r = in->ops->enable (in);if (r)return r;@@ -117,7 +117,7 @@ static void tfp410_disable(struct omap_dss_device *dssdev)if (gpio_is_valid (ddata->pd_gpio))gpio_set_value_cansleep (ddata->pd_gpio,0 ); - in->ops.dpi->disable (in); + in->ops->disable (in); dssdev->state =OMAP_DSS_DISPLAY_DISABLED ; }@@ -138,7 +138,7 @@ static void tfp410_set_timings(struct omap_dss_device *dssdev, ddata->vm = *vm; - in->ops.dpi->set_timings (in, vm); + in->ops->set_timings (in, vm); } static int tfp410_check_timings(struct omap_dss_device *dssdev,@@ -149,16 +149,14 @@ static int tfp410_check_timings(struct omap_dss_device *dssdev,tfp410_fix_timings (vm); -return in->ops.dpi->check_timings (in, vm); +return in->ops->check_timings (in, vm); } -static const struct omapdss_dvi_ops tfp410_dvi_ops = { +static const struct omap_dss_device_ops tfp410_ops = { .connect = tfp410_connect, .disconnect = tfp410_disconnect, - .enable = tfp410_enable, .disable = tfp410_disable, - .check_timings = tfp410_check_timings, .set_timings = tfp410_set_timings, };@@ -209,7 +207,7 @@ static int tfp410_probe(struct platform_device *pdev) } dssdev = &ddata->dssdev; - dssdev->ops.dvi = &tfp410_dvi_ops; + dssdev->ops = &tfp410_ops; dssdev->dev = &pdev->dev; dssdev->type =OMAP_DISPLAY_TYPE_DPI ; dssdev->output_type =OMAP_DISPLAY_TYPE_DVI ;drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c +24
-24@@ -49,7 +49,7 @@ static int tpd_connect(struct omap_dss_device *dssdev,return PTR_ERR (in); } - r = in->ops.hdmi->connect (in, dssdev); + r = in->ops->connect (in, dssdev);if (r) {omap_dss_put_device (in);return r;@@ -85,7 +85,7 @@ static void tpd_disconnect(struct omap_dss_device *dssdev, dst->src =NULL ; dssdev->dst =NULL ; - in->ops.hdmi->disconnect (in, &ddata->dssdev); + in->ops->disconnect (in, &ddata->dssdev);omap_dss_put_device (in); ddata->in =NULL ;@@ -100,9 +100,9 @@ static int tpd_enable(struct omap_dss_device *dssdev)if (dssdev->state ==OMAP_DSS_DISPLAY_ACTIVE )return 0 ; - in->ops.hdmi->set_timings (in, &ddata->vm); + in->ops->set_timings (in, &ddata->vm); - r = in->ops.hdmi->enable (in); + r = in->ops->enable (in);if (r)return r;@@ -119,7 +119,7 @@ static void tpd_disable(struct omap_dss_device *dssdev)if (dssdev->state !=OMAP_DSS_DISPLAY_ACTIVE )return ; - in->ops.hdmi->disable (in); + in->ops->disable (in); dssdev->state =OMAP_DSS_DISPLAY_DISABLED ; }@@ -132,7 +132,7 @@ static void tpd_set_timings(struct omap_dss_device *dssdev, ddata->vm = *vm; - in->ops.hdmi->set_timings (in, vm); + in->ops->set_timings (in, vm); } static int tpd_check_timings(struct omap_dss_device *dssdev,@@ -142,7 +142,7 @@ static int tpd_check_timings(struct omap_dss_device *dssdev,struct omap_dss_device *in = ddata->in;int r; - r = in->ops.hdmi->check_timings (in, vm); + r = in->ops->check_timings (in, vm);return r; }@@ -156,7 +156,7 @@ static int tpd_read_edid(struct omap_dss_device *dssdev,if (!gpiod_get_value_cansleep (ddata->hpd_gpio))return -ENODEV ; -return in->ops.hdmi->read_edid (in, edid, len); +return in->ops->hdmi.read_edid (in, edid, len); }static bool tpd_detect (struct omap_dss_device *dssdev)@@ -165,8 +165,8 @@ static bool tpd_detect(struct omap_dss_device *dssdev)struct omap_dss_device *in = ddata->in;bool connected =gpiod_get_value_cansleep (ddata->hpd_gpio); -if (!connected && in->ops.hdmi->lost_hotplug) - in->ops.hdmi->lost_hotplug (in); +if (!connected && in->ops->hdmi.lost_hotplug) + in->ops->hdmi.lost_hotplug (in);return connected; }@@ -219,7 +219,7 @@ static int tpd_set_infoframe(struct omap_dss_device *dssdev,struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -return in->ops.hdmi->set_infoframe (in, avi); +return in->ops->hdmi.set_infoframe (in, avi); } static int tpd_set_hdmi_mode(struct omap_dss_device *dssdev,@@ -228,27 +228,27 @@ static int tpd_set_hdmi_mode(struct omap_dss_device *dssdev,struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -return in->ops.hdmi->set_hdmi_mode (in, hdmi_mode); +return in->ops->hdmi.set_hdmi_mode (in, hdmi_mode); } -static const struct omapdss_hdmi_ops tpd_hdmi_ops = { +static const struct omap_dss_device_ops tpd_ops = { .connect = tpd_connect, .disconnect = tpd_disconnect, - .enable = tpd_enable, .disable = tpd_disable, - .check_timings = tpd_check_timings, .set_timings = tpd_set_timings, - .read_edid = tpd_read_edid, - .detect = tpd_detect, - .register_hpd_cb = tpd_register_hpd_cb, - .unregister_hpd_cb = tpd_unregister_hpd_cb, - .enable_hpd = tpd_enable_hpd, - .disable_hpd = tpd_disable_hpd, - .set_infoframe = tpd_set_infoframe, - .set_hdmi_mode = tpd_set_hdmi_mode, + .hdmi = { + .read_edid = tpd_read_edid, + .detect = tpd_detect, + .register_hpd_cb = tpd_register_hpd_cb, + .unregister_hpd_cb = tpd_unregister_hpd_cb, + .enable_hpd = tpd_enable_hpd, + .disable_hpd = tpd_disable_hpd, + .set_infoframe = tpd_set_infoframe, + .set_hdmi_mode = tpd_set_hdmi_mode, + }, };static irqreturn_t tpd_hpd_isr (int irq,void *data)@@ -315,7 +315,7 @@ static int tpd_probe(struct platform_device *pdev)return r; dssdev = &ddata->dssdev; - dssdev->ops.hdmi = &tpd_hdmi_ops; + dssdev->ops = &tpd_ops; dssdev->dev = &pdev->dev; dssdev->type =OMAP_DISPLAY_TYPE_HDMI ; dssdev->output_type =OMAP_DISPLAY_TYPE_HDMI ;drivers/gpu/drm/omapdrm/displays/panel-dpi.c +8
-8@@ -50,7 +50,7 @@ static int panel_dpi_connect(struct omap_dss_device *dssdev)return PTR_ERR (in); } - r = in->ops.dpi->connect (in, dssdev); + r = in->ops->connect (in, dssdev);if (r) {omap_dss_put_device (in);return r;@@ -68,7 +68,7 @@ static void panel_dpi_disconnect(struct omap_dss_device *dssdev)if (!omapdss_device_is_connected (dssdev))return ; - in->ops.dpi->disconnect (in, dssdev); + in->ops->disconnect (in, dssdev);omap_dss_put_device (in); ddata->in =NULL ;@@ -86,15 +86,15 @@ static int panel_dpi_enable(struct omap_dss_device *dssdev)if (omapdss_device_is_enabled (dssdev))return 0 ; - in->ops.dpi->set_timings (in, &ddata->vm); + in->ops->set_timings (in, &ddata->vm); - r = in->ops.dpi->enable (in); + r = in->ops->enable (in);if (r)return r; r =regulator_enable (ddata->vcc_supply);if (r) { - in->ops.dpi->disable (in); + in->ops->disable (in);return r; }@@ -119,7 +119,7 @@ static void panel_dpi_disable(struct omap_dss_device *dssdev)gpiod_set_value_cansleep (ddata->enable_gpio,0 );regulator_disable (ddata->vcc_supply); - in->ops.dpi->disable (in); + in->ops->disable (in); dssdev->state =OMAP_DSS_DISPLAY_DISABLED ; }@@ -132,7 +132,7 @@ static void panel_dpi_set_timings(struct omap_dss_device *dssdev, ddata->vm = *vm; - in->ops.dpi->set_timings (in, vm); + in->ops->set_timings (in, vm); } static void panel_dpi_get_timings(struct omap_dss_device *dssdev,@@ -149,7 +149,7 @@ static int panel_dpi_check_timings(struct omap_dss_device *dssdev,struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -return in->ops.dpi->check_timings (in, vm); +return in->ops->check_timings (in, vm); }static const struct omap_dss_driver panel_dpi_ops = {drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +60
-60@@ -146,7 +146,7 @@ static int dsicm_dcs_read_1(struct panel_drv_data *ddata, u8 dcs_cmd, u8 *data)int r;u8 buf[1 ]; - r = in->ops.dsi->dcs_read (in, ddata->channel, dcs_cmd, buf,1 ); + r = in->ops->dsi.dcs_read (in, ddata->channel, dcs_cmd, buf,1 );if (r <0 )return r;@@ -159,7 +159,7 @@ static int dsicm_dcs_read_1(struct panel_drv_data *ddata, u8 dcs_cmd, u8 *data)static int dsicm_dcs_write_0 (struct panel_drv_data *ddata,u8 dcs_cmd) {struct omap_dss_device *in = ddata->in; -return in->ops.dsi->dcs_write (in, ddata->channel, &dcs_cmd,1 ); +return in->ops->dsi.dcs_write (in, ddata->channel, &dcs_cmd,1 ); }static int dsicm_dcs_write_1 (struct panel_drv_data *ddata,u8 dcs_cmd,u8 param)@@ -167,7 +167,7 @@ static int dsicm_dcs_write_1(struct panel_drv_data *ddata, u8 dcs_cmd, u8 param)struct omap_dss_device *in = ddata->in;u8 buf[2 ] = { dcs_cmd, param }; -return in->ops.dsi->dcs_write (in, ddata->channel, buf,2 ); +return in->ops->dsi.dcs_write (in, ddata->channel, buf,2 ); }static int dsicm_sleep_in (struct panel_drv_data *ddata)@@ -180,7 +180,7 @@ static int dsicm_sleep_in(struct panel_drv_data *ddata)hw_guard_wait (ddata); cmd =MIPI_DCS_ENTER_SLEEP_MODE ; - r = in->ops.dsi->dcs_write_nosync (in, ddata->channel, &cmd,1 ); + r = in->ops->dsi.dcs_write_nosync (in, ddata->channel, &cmd,1 );if (r)return r;@@ -242,7 +242,7 @@ static int dsicm_set_update_window(struct panel_drv_data *ddata, buf[3 ] = (x2 >>8 ) &0xff ; buf[4 ] = (x2 >>0 ) &0xff ; - r = in->ops.dsi->dcs_write_nosync (in, ddata->channel, buf,sizeof (buf)); + r = in->ops->dsi.dcs_write_nosync (in, ddata->channel, buf,sizeof (buf));if (r)return r;@@ -252,11 +252,11 @@ static int dsicm_set_update_window(struct panel_drv_data *ddata, buf[3 ] = (y2 >>8 ) &0xff ; buf[4 ] = (y2 >>0 ) &0xff ; - r = in->ops.dsi->dcs_write_nosync (in, ddata->channel, buf,sizeof (buf)); + r = in->ops->dsi.dcs_write_nosync (in, ddata->channel, buf,sizeof (buf));if (r)return r; - in->ops.dsi->bta_sync (in, ddata->channel); + in->ops->dsi.bta_sync (in, ddata->channel);return r; }@@ -290,7 +290,7 @@ static int dsicm_enter_ulps(struct panel_drv_data *ddata)if (ddata->ext_te_gpio)disable_irq (gpiod_to_irq (ddata->ext_te_gpio)); - in->ops.dsi->disable (in, false, true); + in->ops->dsi.disable (in, false, true); ddata->ulps_enabled = true;@@ -315,13 +315,13 @@ static int dsicm_exit_ulps(struct panel_drv_data *ddata)if (!ddata->ulps_enabled)return 0 ; - r = in->ops.dsi->enable (in); + r = in->ops->enable (in);if (r) {dev_err (&ddata->pdev->dev,"failed to enable DSI\n" ); goto err1; } - in->ops.dsi->enable_hs (in, ddata->channel, true); + in->ops->dsi.enable_hs (in, ddata->channel, true); r =_dsicm_enable_te (ddata, true);if (r) {@@ -381,13 +381,13 @@ static int dsicm_bl_update_status(struct backlight_device *dev)mutex_lock (&ddata->lock);if (ddata->enabled) { - in->ops.dsi->bus_lock (in); + in->ops->dsi.bus_lock (in); r =dsicm_wake_up (ddata);if (!r) r =dsicm_dcs_write_1 (ddata,DCS_BRIGHTNESS , level); - in->ops.dsi->bus_unlock (in); + in->ops->dsi.bus_unlock (in); }mutex_unlock (&ddata->lock);@@ -421,14 +421,14 @@ static ssize_t dsicm_num_errors_show(struct device *dev,mutex_lock (&ddata->lock);if (ddata->enabled) { - in->ops.dsi->bus_lock (in); + in->ops->dsi.bus_lock (in); r =dsicm_wake_up (ddata);if (!r) r =dsicm_dcs_read_1 (ddata,DCS_READ_NUM_ERRORS , &errors); - in->ops.dsi->bus_unlock (in); + in->ops->dsi.bus_unlock (in); }else { r = -ENODEV ; }@@ -453,13 +453,13 @@ static ssize_t dsicm_hw_revision_show(struct device *dev,mutex_lock (&ddata->lock);if (ddata->enabled) { - in->ops.dsi->bus_lock (in); + in->ops->dsi.bus_lock (in); r =dsicm_wake_up (ddata);if (!r) r =dsicm_get_id (ddata, &id1, &id2, &id3); - in->ops.dsi->bus_unlock (in); + in->ops->dsi.bus_unlock (in); }else { r = -ENODEV ; }@@ -489,14 +489,14 @@ static ssize_t dsicm_store_ulps(struct device *dev,mutex_lock (&ddata->lock);if (ddata->enabled) { - in->ops.dsi->bus_lock (in); + in->ops->dsi.bus_lock (in);if (t) r =dsicm_enter_ulps (ddata);else r =dsicm_wake_up (ddata); - in->ops.dsi->bus_unlock (in); + in->ops->dsi.bus_unlock (in); }mutex_unlock (&ddata->lock);@@ -541,9 +541,9 @@ static ssize_t dsicm_store_ulps_timeout(struct device *dev,if (ddata->enabled) {/* dsicm_wake_up will restart the timer */ - in->ops.dsi->bus_lock (in); + in->ops->dsi.bus_lock (in); r =dsicm_wake_up (ddata); - in->ops.dsi->bus_unlock (in); + in->ops->dsi.bus_unlock (in); }mutex_unlock (&ddata->lock);@@ -635,7 +635,7 @@ static int dsicm_power_on(struct panel_drv_data *ddata) }if (ddata->pin_config.num_pins >0 ) { - r = in->ops.dsi->configure_pins (in, &ddata->pin_config); + r = in->ops->dsi.configure_pins (in, &ddata->pin_config);if (r) {dev_err (&ddata->pdev->dev,"failed to configure DSI pins\n" );@@ -643,13 +643,13 @@ static int dsicm_power_on(struct panel_drv_data *ddata) } } - r = in->ops.dsi->set_config (in, &dsi_config); + r = in->ops->dsi.set_config (in, &dsi_config);if (r) {dev_err (&ddata->pdev->dev,"failed to configure DSI\n" ); goto err_vddi; } - r = in->ops.dsi->enable (in); + r = in->ops->enable (in);if (r) {dev_err (&ddata->pdev->dev,"failed to enable DSI\n" ); goto err_vddi;@@ -657,7 +657,7 @@ static int dsicm_power_on(struct panel_drv_data *ddata)dsicm_hw_reset (ddata); - in->ops.dsi->enable_hs (in, ddata->channel, false); + in->ops->dsi.enable_hs (in, ddata->channel, false); r =dsicm_sleep_out (ddata);if (r)@@ -689,7 +689,7 @@ static int dsicm_power_on(struct panel_drv_data *ddata)if (r) goto err; - r = in->ops.dsi->enable_video_output (in, ddata->channel); + r = in->ops->dsi.enable_video_output (in, ddata->channel);if (r) goto err;@@ -701,7 +701,7 @@ static int dsicm_power_on(struct panel_drv_data *ddata) ddata->intro_printed = true; } - in->ops.dsi->enable_hs (in, ddata->channel, true); + in->ops->dsi.enable_hs (in, ddata->channel, true);return 0 ; err:@@ -709,7 +709,7 @@ static int dsicm_power_on(struct panel_drv_data *ddata)dsicm_hw_reset (ddata); - in->ops.dsi->disable (in, true, false); + in->ops->dsi.disable (in, true, false); err_vddi:if (ddata->vddi)regulator_disable (ddata->vddi);@@ -725,7 +725,7 @@ static void dsicm_power_off(struct panel_drv_data *ddata)struct omap_dss_device *in = ddata->in;int r; - in->ops.dsi->disable_video_output (in, ddata->channel); + in->ops->dsi.disable_video_output (in, ddata->channel); r =dsicm_dcs_write_0 (ddata,MIPI_DCS_SET_DISPLAY_OFF );if (!r)@@ -737,7 +737,7 @@ static void dsicm_power_off(struct panel_drv_data *ddata)dsicm_hw_reset (ddata); } - in->ops.dsi->disable (in, true, false); + in->ops->dsi.disable (in, true, false);if (ddata->vddi)regulator_disable (ddata->vddi);@@ -772,19 +772,19 @@ static int dsicm_connect(struct omap_dss_device *dssdev)return PTR_ERR (in); } - r = in->ops.dsi->connect (in, dssdev); + r = in->ops->connect (in, dssdev);if (r) {dev_err (dev,"Failed to connect to video source\n" ); goto err_connect; } - r = in->ops.dsi->request_vc (in, &ddata->channel); + r = in->ops->dsi.request_vc (in, &ddata->channel);if (r) {dev_err (dev,"failed to get virtual channel\n" ); goto err_req_vc; } - r = in->ops.dsi->set_vc_id (in, ddata->channel,TCH ); + r = in->ops->dsi.set_vc_id (in, ddata->channel,TCH );if (r) {dev_err (dev,"failed to set VC_ID\n" ); goto err_vc_id;@@ -794,9 +794,9 @@ static int dsicm_connect(struct omap_dss_device *dssdev)return 0 ; err_vc_id: - in->ops.dsi->release_vc (in, ddata->channel); + in->ops->dsi.release_vc (in, ddata->channel); err_req_vc: - in->ops.dsi->disconnect (in, dssdev); + in->ops->disconnect (in, dssdev); err_connect:omap_dss_put_device (in);return r;@@ -810,8 +810,8 @@ static void dsicm_disconnect(struct omap_dss_device *dssdev)if (!omapdss_device_is_connected (dssdev))return ; - in->ops.dsi->release_vc (in, ddata->channel); - in->ops.dsi->disconnect (in, dssdev); + in->ops->dsi.release_vc (in, ddata->channel); + in->ops->disconnect (in, dssdev);omap_dss_put_device (in); ddata->in =NULL ;@@ -837,11 +837,11 @@ static int dsicm_enable(struct omap_dss_device *dssdev) goto err; } - in->ops.dsi->bus_lock (in); + in->ops->dsi.bus_lock (in); r =dsicm_power_on (ddata); - in->ops.dsi->bus_unlock (in); + in->ops->dsi.bus_unlock (in);if (r) goto err;@@ -873,7 +873,7 @@ static void dsicm_disable(struct omap_dss_device *dssdev)dsicm_cancel_ulps_work (ddata); - in->ops.dsi->bus_lock (in); + in->ops->dsi.bus_lock (in);if (omapdss_device_is_enabled (dssdev)) { r =dsicm_wake_up (ddata);@@ -881,7 +881,7 @@ static void dsicm_disable(struct omap_dss_device *dssdev)dsicm_power_off (ddata); } - in->ops.dsi->bus_unlock (in); + in->ops->dsi.bus_unlock (in); dssdev->state =OMAP_DSS_DISPLAY_DISABLED ;@@ -894,7 +894,7 @@ static void dsicm_framedone_cb(int err, void *data)struct omap_dss_device *in = ddata->in;dev_dbg (&ddata->pdev->dev,"framedone, err %d\n" , err); - in->ops.dsi->bus_unlock (ddata->in); + in->ops->dsi.bus_unlock (ddata->in); }static irqreturn_t dsicm_te_isr (int irq,void *data)@@ -909,7 +909,7 @@ static irqreturn_t dsicm_te_isr(int irq, void *data)if (old) {cancel_delayed_work (&ddata->te_timeout_work); - r = in->ops.dsi->update (in, ddata->channel, dsicm_framedone_cb, + r = in->ops->dsi.update (in, ddata->channel, dsicm_framedone_cb, ddata);if (r) goto err;@@ -918,7 +918,7 @@ static irqreturn_t dsicm_te_isr(int irq, void *data)return IRQ_HANDLED ; err:dev_err (&ddata->pdev->dev,"start update failed\n" ); - in->ops.dsi->bus_unlock (in); + in->ops->dsi.bus_unlock (in);return IRQ_HANDLED ; }@@ -931,7 +931,7 @@ static void dsicm_te_timeout_work_callback(struct work_struct *work)dev_err (&ddata->pdev->dev,"TE not received for 250ms!\n" );atomic_set (&ddata->do_update,0 ); - in->ops.dsi->bus_unlock (in); + in->ops->dsi.bus_unlock (in); } static int dsicm_update(struct omap_dss_device *dssdev,@@ -944,7 +944,7 @@ static int dsicm_update(struct omap_dss_device *dssdev,dev_dbg (&ddata->pdev->dev,"update %d, %d, %d x %d\n" , x, y, w, h);mutex_lock (&ddata->lock); - in->ops.dsi->bus_lock (in); + in->ops->dsi.bus_lock (in); r =dsicm_wake_up (ddata);if (r)@@ -966,7 +966,7 @@ static int dsicm_update(struct omap_dss_device *dssdev, msecs_to_jiffies(250));atomic_set (&ddata->do_update,1 ); }else { - r = in->ops.dsi->update (in, ddata->channel, dsicm_framedone_cb, + r = in->ops->dsi.update (in, ddata->channel, dsicm_framedone_cb, ddata);if (r) goto err;@@ -976,7 +976,7 @@ static int dsicm_update(struct omap_dss_device *dssdev,mutex_unlock (&ddata->lock);return 0 ; err: - in->ops.dsi->bus_unlock (in); + in->ops->dsi.bus_unlock (in);mutex_unlock (&ddata->lock);return r; }@@ -989,8 +989,8 @@ static int dsicm_sync(struct omap_dss_device *dssdev)dev_dbg (&ddata->pdev->dev,"sync\n" );mutex_lock (&ddata->lock); - in->ops.dsi->bus_lock (in); - in->ops.dsi->bus_unlock (in); + in->ops->dsi.bus_lock (in); + in->ops->dsi.bus_unlock (in);mutex_unlock (&ddata->lock);dev_dbg (&ddata->pdev->dev,"sync done\n" );@@ -1009,7 +1009,7 @@ static int _dsicm_enable_te(struct panel_drv_data *ddata, bool enable) r =dsicm_dcs_write_0 (ddata,MIPI_DCS_SET_TEAR_OFF );if (!ddata->ext_te_gpio) - in->ops.dsi->enable_te (in, enable); + in->ops->dsi.enable_te (in, enable);/* possible panel bug */ msleep (100 );@@ -1028,7 +1028,7 @@ static int dsicm_enable_te(struct omap_dss_device *dssdev, bool enable)if (ddata->te_enabled == enable) goto end; - in->ops.dsi->bus_lock (in); + in->ops->dsi.bus_lock (in);if (ddata->enabled) { r =dsicm_wake_up (ddata);@@ -1042,13 +1042,13 @@ static int dsicm_enable_te(struct omap_dss_device *dssdev, bool enable) ddata->te_enabled = enable; - in->ops.dsi->bus_unlock (in); + in->ops->dsi.bus_unlock (in); end:mutex_unlock (&ddata->lock);return 0 ; err: - in->ops.dsi->bus_unlock (in); + in->ops->dsi.bus_unlock (in);mutex_unlock (&ddata->lock);return r;@@ -1090,7 +1090,7 @@ static int dsicm_memory_read(struct omap_dss_device *dssdev, size =min ((u32 )w * h *3 , ddata->vm.hactive * ddata->vm.vactive *3 ); - in->ops.dsi->bus_lock (in); + in->ops->dsi.bus_lock (in); r =dsicm_wake_up (ddata);if (r)@@ -1106,7 +1106,7 @@ static int dsicm_memory_read(struct omap_dss_device *dssdev,dsicm_set_update_window (ddata, x, y, w, h); - r = in->ops.dsi->set_max_rx_packet_size (in, ddata->channel, plen); + r = in->ops->dsi.set_max_rx_packet_size (in, ddata->channel, plen);if (r) goto err2;@@ -1114,7 +1114,7 @@ static int dsicm_memory_read(struct omap_dss_device *dssdev,u8 dcs_cmd = first ?0x2e :0x3e ; first =0 ; - r = in->ops.dsi->dcs_read (in, ddata->channel, dcs_cmd, + r = in->ops->dsi.dcs_read (in, ddata->channel, dcs_cmd, buf + buf_used, size - buf_used);if (r <0 ) {@@ -1140,9 +1140,9 @@ static int dsicm_memory_read(struct omap_dss_device *dssdev, r = buf_used; err3: - in->ops.dsi->set_max_rx_packet_size (in, ddata->channel,1 ); + in->ops->dsi.set_max_rx_packet_size (in, ddata->channel,1 ); err2: - in->ops.dsi->bus_unlock (in); + in->ops->dsi.bus_unlock (in); err1:mutex_unlock (&ddata->lock);return r;@@ -1162,11 +1162,11 @@ static void dsicm_ulps_work(struct work_struct *work)return ; } - in->ops.dsi->bus_lock (in); + in->ops->dsi.bus_lock (in);dsicm_enter_ulps (ddata); - in->ops.dsi->bus_unlock (in); + in->ops->dsi.bus_unlock (in);mutex_unlock (&ddata->lock); }drivers/gpu/drm/omapdrm/displays/panel-lgphilips-lb035q02.c +7
-7@@ -131,7 +131,7 @@ static int lb035q02_connect(struct omap_dss_device *dssdev)return PTR_ERR (in); } - r = in->ops.dpi->connect (in, dssdev); + r = in->ops->connect (in, dssdev);if (r) {omap_dss_put_device (in);return r;@@ -151,7 +151,7 @@ static void lb035q02_disconnect(struct omap_dss_device *dssdev)if (!omapdss_device_is_connected (dssdev))return ; - in->ops.dpi->disconnect (in, dssdev); + in->ops->disconnect (in, dssdev);omap_dss_put_device (in); ddata->in =NULL ;@@ -169,9 +169,9 @@ static int lb035q02_enable(struct omap_dss_device *dssdev)if (omapdss_device_is_enabled (dssdev))return 0 ; - in->ops.dpi->set_timings (in, &ddata->vm); + in->ops->set_timings (in, &ddata->vm); - r = in->ops.dpi->enable (in); + r = in->ops->enable (in);if (r)return r;@@ -194,7 +194,7 @@ static void lb035q02_disable(struct omap_dss_device *dssdev)if (ddata->enable_gpio)gpiod_set_value_cansleep (ddata->enable_gpio,0 ); - in->ops.dpi->disable (in); + in->ops->disable (in); dssdev->state =OMAP_DSS_DISPLAY_DISABLED ; }@@ -207,7 +207,7 @@ static void lb035q02_set_timings(struct omap_dss_device *dssdev, ddata->vm = *vm; - in->ops.dpi->set_timings (in, vm); + in->ops->set_timings (in, vm); } static void lb035q02_get_timings(struct omap_dss_device *dssdev,@@ -224,7 +224,7 @@ static int lb035q02_check_timings(struct omap_dss_device *dssdev,struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -return in->ops.dpi->check_timings (in, vm); +return in->ops->check_timings (in, vm); }static const struct omap_dss_driver lb035q02_ops = {drivers/gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c +7
-7@@ -127,7 +127,7 @@ static int nec_8048_connect(struct omap_dss_device *dssdev)return PTR_ERR (in); } - r = in->ops.dpi->connect (in, dssdev); + r = in->ops->connect (in, dssdev);if (r) {omap_dss_put_device (in);return r;@@ -145,7 +145,7 @@ static void nec_8048_disconnect(struct omap_dss_device *dssdev)if (!omapdss_device_is_connected (dssdev))return ; - in->ops.dpi->disconnect (in, dssdev); + in->ops->disconnect (in, dssdev);omap_dss_put_device (in); ddata->in =NULL ;@@ -163,9 +163,9 @@ static int nec_8048_enable(struct omap_dss_device *dssdev)if (omapdss_device_is_enabled (dssdev))return 0 ; - in->ops.dpi->set_timings (in, &ddata->vm); + in->ops->set_timings (in, &ddata->vm); - r = in->ops.dpi->enable (in); + r = in->ops->enable (in);if (r)return r;@@ -188,7 +188,7 @@ static void nec_8048_disable(struct omap_dss_device *dssdev)if (gpio_is_valid (ddata->res_gpio))gpio_set_value_cansleep (ddata->res_gpio,0 ); - in->ops.dpi->disable (in); + in->ops->disable (in); dssdev->state =OMAP_DSS_DISPLAY_DISABLED ; }@@ -201,7 +201,7 @@ static void nec_8048_set_timings(struct omap_dss_device *dssdev, ddata->vm = *vm; - in->ops.dpi->set_timings (in, vm); + in->ops->set_timings (in, vm); } static void nec_8048_get_timings(struct omap_dss_device *dssdev,@@ -218,7 +218,7 @@ static int nec_8048_check_timings(struct omap_dss_device *dssdev,struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -return in->ops.dpi->check_timings (in, vm); +return in->ops->check_timings (in, vm); }static const struct omap_dss_driver nec_8048_ops = {drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c +7
-7@@ -73,7 +73,7 @@ static int sharp_ls_connect(struct omap_dss_device *dssdev)return PTR_ERR (in); } - r = in->ops.dpi->connect (in, dssdev); + r = in->ops->connect (in, dssdev);if (r) {omap_dss_put_device (in);return r;@@ -91,7 +91,7 @@ static void sharp_ls_disconnect(struct omap_dss_device *dssdev)if (!omapdss_device_is_connected (dssdev))return ; - in->ops.dpi->disconnect (in, dssdev); + in->ops->disconnect (in, dssdev);omap_dss_put_device (in); ddata->in =NULL ;@@ -109,7 +109,7 @@ static int sharp_ls_enable(struct omap_dss_device *dssdev)if (omapdss_device_is_enabled (dssdev))return 0 ; - in->ops.dpi->set_timings (in, &ddata->vm); + in->ops->set_timings (in, &ddata->vm);if (ddata->vcc) { r =regulator_enable (ddata->vcc);@@ -117,7 +117,7 @@ static int sharp_ls_enable(struct omap_dss_device *dssdev)return r; } - r = in->ops.dpi->enable (in); + r = in->ops->enable (in);if (r) {regulator_disable (ddata->vcc);return r;@@ -155,7 +155,7 @@ static void sharp_ls_disable(struct omap_dss_device *dssdev)msleep (100 ); - in->ops.dpi->disable (in); + in->ops->disable (in);if (ddata->vcc)regulator_disable (ddata->vcc);@@ -171,7 +171,7 @@ static void sharp_ls_set_timings(struct omap_dss_device *dssdev, ddata->vm = *vm; - in->ops.dpi->set_timings (in, vm); + in->ops->set_timings (in, vm); } static void sharp_ls_get_timings(struct omap_dss_device *dssdev,@@ -188,7 +188,7 @@ static int sharp_ls_check_timings(struct omap_dss_device *dssdev,struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -return in->ops.dpi->check_timings (in, vm); +return in->ops->check_timings (in, vm); }static const struct omap_dss_driver sharp_ls_ops = {drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c +7
-7@@ -522,7 +522,7 @@ static int acx565akm_connect(struct omap_dss_device *dssdev)return PTR_ERR (in); } - r = in->ops.sdi->connect (in, dssdev); + r = in->ops->connect (in, dssdev);if (r) {omap_dss_put_device (in);return r;@@ -540,7 +540,7 @@ static void acx565akm_disconnect(struct omap_dss_device *dssdev)if (!omapdss_device_is_connected (dssdev))return ; - in->ops.sdi->disconnect (in, dssdev); + in->ops->disconnect (in, dssdev);omap_dss_put_device (in); ddata->in =NULL ;@@ -554,9 +554,9 @@ static int acx565akm_panel_power_on(struct omap_dss_device *dssdev)dev_dbg (&ddata->spi->dev,"%s\n" , __func__); - in->ops.sdi->set_timings (in, &ddata->vm); + in->ops->set_timings (in, &ddata->vm); - r = in->ops.sdi->enable (in); + r = in->ops->enable (in);if (r) {pr_err ("%s sdi enable failed\n" , __func__);return r;@@ -621,7 +621,7 @@ static void acx565akm_panel_power_off(struct omap_dss_device *dssdev)/* FIXME need to tweak this delay */ msleep (100 ); - in->ops.sdi->disable (in); + in->ops->disable (in); }static int acx565akm_enable (struct omap_dss_device *dssdev)@@ -672,7 +672,7 @@ static void acx565akm_set_timings(struct omap_dss_device *dssdev, ddata->vm = *vm; - in->ops.sdi->set_timings (in, vm); + in->ops->set_timings (in, vm); } static void acx565akm_get_timings(struct omap_dss_device *dssdev,@@ -689,7 +689,7 @@ static int acx565akm_check_timings(struct omap_dss_device *dssdev,struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -return in->ops.sdi->check_timings (in, vm); +return in->ops->check_timings (in, vm); }static const struct omap_dss_driver acx565akm_ops = {drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c +7
-7@@ -181,7 +181,7 @@ static int td028ttec1_panel_connect(struct omap_dss_device *dssdev)return PTR_ERR (in); } - r = in->ops.dpi->connect (in, dssdev); + r = in->ops->connect (in, dssdev);if (r) {omap_dss_put_device (in);return r;@@ -199,7 +199,7 @@ static void td028ttec1_panel_disconnect(struct omap_dss_device *dssdev)if (!omapdss_device_is_connected (dssdev))return ; - in->ops.dpi->disconnect (in, dssdev); + in->ops->disconnect (in, dssdev);omap_dss_put_device (in); ddata->in =NULL ;@@ -217,9 +217,9 @@ static int td028ttec1_panel_enable(struct omap_dss_device *dssdev)if (omapdss_device_is_enabled (dssdev))return 0 ; - in->ops.dpi->set_timings (in, &ddata->vm); + in->ops->set_timings (in, &ddata->vm); - r = in->ops.dpi->enable (in); + r = in->ops->enable (in);if (r)return r;@@ -328,7 +328,7 @@ static void td028ttec1_panel_disable(struct omap_dss_device *dssdev)jbt_ret_write_0 (ddata,JBT_REG_SLEEP_IN );jbt_reg_write_1 (ddata,JBT_REG_POWER_ON_OFF ,0x00 ); - in->ops.dpi->disable (in); + in->ops->disable (in); dssdev->state =OMAP_DSS_DISPLAY_DISABLED ; }@@ -341,7 +341,7 @@ static void td028ttec1_panel_set_timings(struct omap_dss_device *dssdev, ddata->vm = *vm; - in->ops.dpi->set_timings (in, vm); + in->ops->set_timings (in, vm); } static void td028ttec1_panel_get_timings(struct omap_dss_device *dssdev,@@ -358,7 +358,7 @@ static int td028ttec1_panel_check_timings(struct omap_dss_device *dssdev,struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -return in->ops.dpi->check_timings (in, vm); +return in->ops->check_timings (in, vm); }static const struct omap_dss_driver td028ttec1_ops = {drivers/gpu/drm/omapdrm/displays/panel-tpo-td043mtea1.c +8
-8@@ -352,7 +352,7 @@ static int tpo_td043_connect(struct omap_dss_device *dssdev)return PTR_ERR (in); } - r = in->ops.dpi->connect (in, dssdev); + r = in->ops->connect (in, dssdev);if (r) {omap_dss_put_device (in);return r;@@ -370,7 +370,7 @@ static void tpo_td043_disconnect(struct omap_dss_device *dssdev)if (!omapdss_device_is_connected (dssdev))return ; - in->ops.dpi->disconnect (in, dssdev); + in->ops->disconnect (in, dssdev);omap_dss_put_device (in); ddata->in =NULL ;@@ -388,9 +388,9 @@ static int tpo_td043_enable(struct omap_dss_device *dssdev)if (omapdss_device_is_enabled (dssdev))return 0 ; - in->ops.dpi->set_timings (in, &ddata->vm); + in->ops->set_timings (in, &ddata->vm); - r = in->ops.dpi->enable (in); + r = in->ops->enable (in);if (r)return r;@@ -401,7 +401,7 @@ static int tpo_td043_enable(struct omap_dss_device *dssdev)if (!ddata->spi_suspended) { r =tpo_td043_power_on (ddata);if (r) { - in->ops.dpi->disable (in); + in->ops->disable (in);return r; } }@@ -419,7 +419,7 @@ static void tpo_td043_disable(struct omap_dss_device *dssdev)if (!omapdss_device_is_enabled (dssdev))return ; - in->ops.dpi->disable (in); + in->ops->disable (in);if (!ddata->spi_suspended)tpo_td043_power_off (ddata);@@ -435,7 +435,7 @@ static void tpo_td043_set_timings(struct omap_dss_device *dssdev, ddata->vm = *vm; - in->ops.dpi->set_timings (in, vm); + in->ops->set_timings (in, vm); } static void tpo_td043_get_timings(struct omap_dss_device *dssdev,@@ -452,7 +452,7 @@ static int tpo_td043_check_timings(struct omap_dss_device *dssdev,struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -return in->ops.dpi->check_timings (in, vm); +return in->ops->check_timings (in, vm); }static const struct omap_dss_driver tpo_td043_ops = {drivers/gpu/drm/omapdrm/dss/dpi.c +2
-2@@ -681,7 +681,7 @@ static void dpi_disconnect(struct omap_dss_device *dssdev,dss_mgr_disconnect (&dpi->output, dssdev); } -static const struct omapdss_dpi_ops dpi_ops = { +static const struct omap_dss_device_ops dpi_ops = { .connect = dpi_connect, .disconnect = dpi_disconnect,@@ -720,7 +720,7 @@ static void dpi_init_output_port(struct dpi_data *dpi, struct device_node *port) out->output_type =OMAP_DISPLAY_TYPE_DPI ; out->dispc_channel =dpi_get_channel (dpi, port_num); out->port_num = port_num; - out->ops.dpi = &dpi_ops; + out->ops = &dpi_ops; out->owner =THIS_MODULE ;omapdss_register_output (out);drivers/gpu/drm/omapdrm/dss/dsi.c +26
-24@@ -5000,43 +5000,45 @@ static void dsi_disconnect(struct omap_dss_device *dssdev,dss_mgr_disconnect (&dsi->output, dssdev); } -static const struct omapdss_dsi_ops dsi_ops = { +static const struct omap_dss_device_ops dsi_ops = { .connect = dsi_connect, .disconnect = dsi_disconnect, + .enable = dsi_display_enable, - .bus_lock = dsi_bus_lock, - .bus_unlock = dsi_bus_unlock, + .dsi = { + .bus_lock = dsi_bus_lock, + .bus_unlock = dsi_bus_unlock, - .enable = dsi_display_enable, - .disable = dsi_display_disable, + .disable = dsi_display_disable, - .enable_hs = dsi_vc_enable_hs, + .enable_hs = dsi_vc_enable_hs, - .configure_pins = dsi_configure_pins, - .set_config = dsi_set_config, + .configure_pins = dsi_configure_pins, + .set_config = dsi_set_config, - .enable_video_output = dsi_enable_video_output, - .disable_video_output = dsi_disable_video_output, + .enable_video_output = dsi_enable_video_output, + .disable_video_output = dsi_disable_video_output, - .update = dsi_update, + .update = dsi_update, - .enable_te = dsi_enable_te, + .enable_te = dsi_enable_te, - .request_vc = dsi_request_vc, - .set_vc_id = dsi_set_vc_id, - .release_vc = dsi_release_vc, + .request_vc = dsi_request_vc, + .set_vc_id = dsi_set_vc_id, + .release_vc = dsi_release_vc, - .dcs_write = dsi_vc_dcs_write, - .dcs_write_nosync = dsi_vc_dcs_write_nosync, - .dcs_read = dsi_vc_dcs_read, + .dcs_write = dsi_vc_dcs_write, + .dcs_write_nosync = dsi_vc_dcs_write_nosync, + .dcs_read = dsi_vc_dcs_read, - .gen_write = dsi_vc_generic_write, - .gen_write_nosync = dsi_vc_generic_write_nosync, - .gen_read = dsi_vc_generic_read, + .gen_write = dsi_vc_generic_write, + .gen_write_nosync = dsi_vc_generic_write_nosync, + .gen_read = dsi_vc_generic_read, - .bta_sync = dsi_vc_send_bta_sync, + .bta_sync = dsi_vc_send_bta_sync, - .set_max_rx_packet_size = dsi_vc_set_max_rx_packet_size, + .set_max_rx_packet_size = dsi_vc_set_max_rx_packet_size, + }, };static void dsi_init_output (struct dsi_data *dsi)@@ -5050,7 +5052,7 @@ static void dsi_init_output(struct dsi_data *dsi) out->output_type =OMAP_DISPLAY_TYPE_DSI ; out->name = dsi->module_id ==0 ?"dsi.0" :"dsi.1" ; out->dispc_channel =dsi_get_channel (dsi); - out->ops.dsi = &dsi_ops; + out->ops = &dsi_ops; out->owner =THIS_MODULE ;omapdss_register_output (out);drivers/gpu/drm/omapdrm/dss/hdmi4.c +8
-6@@ -540,7 +540,7 @@ static int hdmi_set_hdmi_mode(struct omap_dss_device *dssdev,return 0 ; } -static const struct omapdss_hdmi_ops hdmi_ops = { +static const struct omap_dss_device_ops hdmi_ops = { .connect = hdmi_connect, .disconnect = hdmi_disconnect,@@ -550,10 +550,12 @@ static const struct omapdss_hdmi_ops hdmi_ops = { .check_timings = hdmi_display_check_timing, .set_timings = hdmi_display_set_timing, - .read_edid = hdmi_read_edid, - .lost_hotplug = hdmi_lost_hotplug, - .set_infoframe = hdmi_set_infoframe, - .set_hdmi_mode = hdmi_set_hdmi_mode, + .hdmi = { + .read_edid = hdmi_read_edid, + .lost_hotplug = hdmi_lost_hotplug, + .set_infoframe = hdmi_set_infoframe, + .set_hdmi_mode = hdmi_set_hdmi_mode, + }, };static void hdmi_init_output (struct omap_hdmi *hdmi)@@ -565,7 +567,7 @@ static void hdmi_init_output(struct omap_hdmi *hdmi) out->output_type =OMAP_DISPLAY_TYPE_HDMI ; out->name ="hdmi.0" ; out->dispc_channel =OMAP_DSS_CHANNEL_DIGIT ; - out->ops.hdmi = &hdmi_ops; + out->ops = &hdmi_ops; out->owner =THIS_MODULE ;omapdss_register_output (out);drivers/gpu/drm/omapdrm/dss/hdmi5.c +7
-5@@ -532,7 +532,7 @@ static int hdmi_set_hdmi_mode(struct omap_dss_device *dssdev,return 0 ; } -static const struct omapdss_hdmi_ops hdmi_ops = { +static const struct omap_dss_device_ops hdmi_ops = { .connect = hdmi_connect, .disconnect = hdmi_disconnect,@@ -542,9 +542,11 @@ static const struct omapdss_hdmi_ops hdmi_ops = { .check_timings = hdmi_display_check_timing, .set_timings = hdmi_display_set_timing, - .read_edid = hdmi_read_edid, - .set_infoframe = hdmi_set_infoframe, - .set_hdmi_mode = hdmi_set_hdmi_mode, + .hdmi = { + .read_edid = hdmi_read_edid, + .set_infoframe = hdmi_set_infoframe, + .set_hdmi_mode = hdmi_set_hdmi_mode, + }, };static void hdmi_init_output (struct omap_hdmi *hdmi)@@ -556,7 +558,7 @@ static void hdmi_init_output(struct omap_hdmi *hdmi) out->output_type =OMAP_DISPLAY_TYPE_HDMI ; out->name ="hdmi.0" ; out->dispc_channel =OMAP_DSS_CHANNEL_DIGIT ; - out->ops.hdmi = &hdmi_ops; + out->ops = &hdmi_ops; out->owner =THIS_MODULE ;omapdss_register_output (out);drivers/gpu/drm/omapdrm/dss/omapdss.h +21
-88@@ -296,80 +296,7 @@ struct omap_dss_writeback_info {u8 pre_mult_alpha; }; -struct omapdss_dpi_ops { -int (*connect)(struct omap_dss_device *dssdev, -struct omap_dss_device *dst); -void (*disconnect)(struct omap_dss_device *dssdev, -struct omap_dss_device *dst); - -int (*enable)(struct omap_dss_device *dssdev); -void (*disable)(struct omap_dss_device *dssdev); - -int (*check_timings)(struct omap_dss_device *dssdev, -struct videomode *vm); -void (*set_timings)(struct omap_dss_device *dssdev, -struct videomode *vm); -}; - -struct omapdss_sdi_ops { -int (*connect)(struct omap_dss_device *dssdev, -struct omap_dss_device *dst); -void (*disconnect)(struct omap_dss_device *dssdev, -struct omap_dss_device *dst); - -int (*enable)(struct omap_dss_device *dssdev); -void (*disable)(struct omap_dss_device *dssdev); - -int (*check_timings)(struct omap_dss_device *dssdev, -struct videomode *vm); -void (*set_timings)(struct omap_dss_device *dssdev, -struct videomode *vm); -}; - -struct omapdss_dvi_ops { -int (*connect)(struct omap_dss_device *dssdev, -struct omap_dss_device *dst); -void (*disconnect)(struct omap_dss_device *dssdev, -struct omap_dss_device *dst); - -int (*enable)(struct omap_dss_device *dssdev); -void (*disable)(struct omap_dss_device *dssdev); - -int (*check_timings)(struct omap_dss_device *dssdev, -struct videomode *vm); -void (*set_timings)(struct omap_dss_device *dssdev, -struct videomode *vm); -}; - -struct omapdss_atv_ops { -int (*connect)(struct omap_dss_device *dssdev, -struct omap_dss_device *dst); -void (*disconnect)(struct omap_dss_device *dssdev, -struct omap_dss_device *dst); - -int (*enable)(struct omap_dss_device *dssdev); -void (*disable)(struct omap_dss_device *dssdev); - -int (*check_timings)(struct omap_dss_device *dssdev, -struct videomode *vm); -void (*set_timings)(struct omap_dss_device *dssdev, -struct videomode *vm); -}; -struct omapdss_hdmi_ops { -int (*connect)(struct omap_dss_device *dssdev, -struct omap_dss_device *dst); -void (*disconnect)(struct omap_dss_device *dssdev, -struct omap_dss_device *dst); - -int (*enable)(struct omap_dss_device *dssdev); -void (*disable)(struct omap_dss_device *dssdev); - -int (*check_timings)(struct omap_dss_device *dssdev, -struct videomode *vm); -void (*set_timings)(struct omap_dss_device *dssdev, -struct videomode *vm); -int (*read_edid)(struct omap_dss_device *dssdev,u8 *buf,int len);void (*lost_hotplug)(struct omap_dss_device *dssdev);bool (*detect)(struct omap_dss_device *dssdev);@@ -388,12 +315,6 @@ struct omapdss_hdmi_ops { };struct omapdss_dsi_ops { -int (*connect)(struct omap_dss_device *dssdev, -struct omap_dss_device *dst); -void (*disconnect)(struct omap_dss_device *dssdev, -struct omap_dss_device *dst); - -int (*enable)(struct omap_dss_device *dssdev);void (*disable)(struct omap_dss_device *dssdev,bool disconnect_lanes,bool enter_ulps);@@ -444,6 +365,26 @@ struct omapdss_dsi_ops { int channel, u16 plen); }; +struct omap_dss_device_ops { +int (*connect)(struct omap_dss_device *dssdev, +struct omap_dss_device *dst); +void (*disconnect)(struct omap_dss_device *dssdev, +struct omap_dss_device *dst); + +int (*enable)(struct omap_dss_device *dssdev); +void (*disable)(struct omap_dss_device *dssdev); + +int (*check_timings)(struct omap_dss_device *dssdev, +struct videomode *vm); +void (*set_timings)(struct omap_dss_device *dssdev, +struct videomode *vm); + +union { +const struct omapdss_hdmi_ops hdmi; +const struct omapdss_dsi_ops dsi; + }; +}; +struct omap_dss_device {struct kobject kobj;struct device *dev;@@ -461,15 +402,7 @@ struct omap_dss_device {const char *name;const struct omap_dss_driver *driver; - -union { -const struct omapdss_dpi_ops *dpi; -const struct omapdss_sdi_ops *sdi; -const struct omapdss_dvi_ops *dvi; -const struct omapdss_hdmi_ops *hdmi; -const struct omapdss_atv_ops *atv; -const struct omapdss_dsi_ops *dsi; - } ops; +const struct omap_dss_device_ops *ops;/* helper variable for driver suspend/resume */ bool activate_after_resume;drivers/gpu/drm/omapdrm/dss/sdi.c +2
-2@@ -308,7 +308,7 @@ static void sdi_disconnect(struct omap_dss_device *dssdev,dss_mgr_disconnect (&sdi->output, dssdev); } -static const struct omapdss_sdi_ops sdi_ops = { +static const struct omap_dss_device_ops sdi_ops = { .connect = sdi_connect, .disconnect = sdi_disconnect,@@ -330,7 +330,7 @@ static void sdi_init_output(struct sdi_device *sdi) out->dispc_channel =OMAP_DSS_CHANNEL_LCD ;/* We have SDI only on OMAP3, where it's on port 1 */ out->port_num =1 ; - out->ops.sdi = &sdi_ops; + out->ops = &sdi_ops; out->owner =THIS_MODULE ;omapdss_register_output (out);drivers/gpu/drm/omapdrm/dss/venc.c +2
-2@@ -750,7 +750,7 @@ static void venc_disconnect(struct omap_dss_device *dssdev,dss_mgr_disconnect (&venc->output, dssdev); } -static const struct omapdss_atv_ops venc_ops = { +static const struct omap_dss_device_ops venc_ops = { .connect = venc_connect, .disconnect = venc_disconnect,@@ -770,7 +770,7 @@ static void venc_init_output(struct venc_device *venc) out->output_type =OMAP_DISPLAY_TYPE_VENC ; out->name ="venc.0" ; out->dispc_channel =OMAP_DSS_CHANNEL_DIGIT ; - out->ops.atv = &venc_ops; + out->ops = &venc_ops; out->owner =THIS_MODULE ;omapdss_register_output (out);Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 20/60 drm/omap: dss: Add functions to connect and disconnect devices
In reply to Laurent PinchartThe omap_dss_device objects model display components and are connected at runtime to create display pipelines. The connect and disconnect operations implemented by each component contain lots of duplicate code. As a first step towards fixing this, create new functions to wrap the direct calls to those operations and use them.
--- .../gpu/drm/omapdrm/displays/connector-analog-tv.c | 4 ++-- drivers/gpu/drm/omapdrm/displays/connector-dvi.c | 4 ++-- drivers/gpu/drm/omapdrm/displays/connector-hdmi.c | 4 ++-- drivers/gpu/drm/omapdrm/displays/encoder-opa362.c | 4 ++-- drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c | 4 ++-- drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c | 4 ++-- drivers/gpu/drm/omapdrm/displays/panel-dpi.c | 4 ++-- drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 6 +++--- .../drm/omapdrm/displays/panel-lgphilips-lb035q02.c | 4 ++-- .../gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c | 4 ++-- .../drm/omapdrm/displays/panel-sharp-ls037v7dw01.c | 4 ++-- .../gpu/drm/omapdrm/displays/panel-sony-acx565akm.c | 4 ++-- .../gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c | 4 ++-- .../gpu/drm/omapdrm/displays/panel-tpo-td043mtea1.c | 4 ++-- drivers/gpu/drm/omapdrm/dss/base.c | 20 ++++++++++++++++++++ drivers/gpu/drm/omapdrm/dss/omapdss.h | 4 ++++ drivers/gpu/drm/omapdrm/omap_drv.c | 4 ++-- 17 files changed, 55 insertions(+), 31 deletions(-)
drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c +2 -2
@@ -59,7 +59,7 @@ static int tvc_connect(struct omap_dss_device *dssdev)return PTR_ERR (in); } - r = in->ops->connect (in, dssdev); + r =omapdss_device_connect (in, dssdev);if (r) {omap_dss_put_device (in);return r;
@@ -79,7 +79,7 @@ static void tvc_disconnect(struct omap_dss_device *dssdev)if (!omapdss_device_is_connected (dssdev))return ; - in->ops->disconnect (in, dssdev); +omapdss_device_disconnect (in, dssdev);omap_dss_put_device (in); ddata->in =NULL ;
drivers/gpu/drm/omapdrm/displays/connector-dvi.c +2 -2
@@ -72,7 +72,7 @@ static int dvic_connect(struct omap_dss_device *dssdev)return PTR_ERR (in); } - r = in->ops->connect (in, dssdev); + r =omapdss_device_connect (in, dssdev);if (r) {omap_dss_put_device (in);return r;
@@ -90,7 +90,7 @@ static void dvic_disconnect(struct omap_dss_device *dssdev)if (!omapdss_device_is_connected (dssdev))return ; - in->ops->disconnect (in, dssdev); +omapdss_device_disconnect (in, dssdev);omap_dss_put_device (in); ddata->in =NULL ;
drivers/gpu/drm/omapdrm/displays/connector-hdmi.c +2 -2
@@ -69,7 +69,7 @@ static int hdmic_connect(struct omap_dss_device *dssdev)return PTR_ERR (in); } - r = in->ops->connect (in, dssdev); + r =omapdss_device_connect (in, dssdev);if (r) {omap_dss_put_device (in);return r;
@@ -89,7 +89,7 @@ static void hdmic_disconnect(struct omap_dss_device *dssdev)if (!omapdss_device_is_connected (dssdev))return ; - in->ops->disconnect (in, dssdev); +omapdss_device_disconnect (in, dssdev);omap_dss_put_device (in); ddata->in =NULL ;
drivers/gpu/drm/omapdrm/displays/encoder-opa362.c +2 -2
@@ -50,7 +50,7 @@ static int opa362_connect(struct omap_dss_device *dssdev,return PTR_ERR (in); } - r = in->ops->connect (in, dssdev); + r =omapdss_device_connect (in, dssdev);if (r) {omap_dss_put_device (in);return r;
@@ -82,7 +82,7 @@ static void opa362_disconnect(struct omap_dss_device *dssdev, dst->src =NULL ; dssdev->dst =NULL ; - in->ops->disconnect (in, &ddata->dssdev); +omapdss_device_disconnect (in, &ddata->dssdev);omap_dss_put_device (in); ddata->in =NULL ;
drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c +2 -2
@@ -44,7 +44,7 @@ static int tfp410_connect(struct omap_dss_device *dssdev,return PTR_ERR (in); } - r = in->ops->connect (in, dssdev); + r =omapdss_device_connect (in, dssdev);if (r) {omap_dss_put_device (in);return r;
@@ -74,7 +74,7 @@ static void tfp410_disconnect(struct omap_dss_device *dssdev, dst->src =NULL ; dssdev->dst =NULL ; - in->ops->disconnect (in, &ddata->dssdev); +omapdss_device_disconnect (in, &ddata->dssdev);omap_dss_put_device (in); ddata->in =NULL ;
drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c +2 -2
@@ -49,7 +49,7 @@ static int tpd_connect(struct omap_dss_device *dssdev,return PTR_ERR (in); } - r = in->ops->connect (in, dssdev); + r =omapdss_device_connect (in, dssdev);if (r) {omap_dss_put_device (in);return r;
@@ -85,7 +85,7 @@ static void tpd_disconnect(struct omap_dss_device *dssdev, dst->src =NULL ; dssdev->dst =NULL ; - in->ops->disconnect (in, &ddata->dssdev); +omapdss_device_disconnect (in, &ddata->dssdev);omap_dss_put_device (in); ddata->in =NULL ;
drivers/gpu/drm/omapdrm/displays/panel-dpi.c +2 -2
@@ -50,7 +50,7 @@ static int panel_dpi_connect(struct omap_dss_device *dssdev)return PTR_ERR (in); } - r = in->ops->connect (in, dssdev); + r =omapdss_device_connect (in, dssdev);if (r) {omap_dss_put_device (in);return r;
@@ -68,7 +68,7 @@ static void panel_dpi_disconnect(struct omap_dss_device *dssdev)if (!omapdss_device_is_connected (dssdev))return ; - in->ops->disconnect (in, dssdev); +omapdss_device_disconnect (in, dssdev);omap_dss_put_device (in); ddata->in =NULL ;
drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +3 -3
@@ -772,7 +772,7 @@ static int dsicm_connect(struct omap_dss_device *dssdev)return PTR_ERR (in); } - r = in->ops->connect (in, dssdev); + r =omapdss_device_connect (in, dssdev);if (r) {dev_err (dev,"Failed to connect to video source\n" ); goto err_connect;
@@ -796,7 +796,7 @@ static int dsicm_connect(struct omap_dss_device *dssdev) err_vc_id: in->ops->dsi.release_vc (in, ddata->channel); err_req_vc: - in->ops->disconnect (in, dssdev); +omapdss_device_disconnect (in, dssdev); err_connect:omap_dss_put_device (in);return r;
@@ -811,7 +811,7 @@ static void dsicm_disconnect(struct omap_dss_device *dssdev)return ; in->ops->dsi.release_vc (in, ddata->channel); - in->ops->disconnect (in, dssdev); +omapdss_device_disconnect (in, dssdev);omap_dss_put_device (in); ddata->in =NULL ;
drivers/gpu/drm/omapdrm/displays/panel-lgphilips-lb035q02.c +2 -2
@@ -131,7 +131,7 @@ static int lb035q02_connect(struct omap_dss_device *dssdev)return PTR_ERR (in); } - r = in->ops->connect (in, dssdev); + r =omapdss_device_connect (in, dssdev);if (r) {omap_dss_put_device (in);return r;
@@ -151,7 +151,7 @@ static void lb035q02_disconnect(struct omap_dss_device *dssdev)if (!omapdss_device_is_connected (dssdev))return ; - in->ops->disconnect (in, dssdev); +omapdss_device_disconnect (in, dssdev);omap_dss_put_device (in); ddata->in =NULL ;
drivers/gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c +2 -2
@@ -127,7 +127,7 @@ static int nec_8048_connect(struct omap_dss_device *dssdev)return PTR_ERR (in); } - r = in->ops->connect (in, dssdev); + r =omapdss_device_connect (in, dssdev);if (r) {omap_dss_put_device (in);return r;
@@ -145,7 +145,7 @@ static void nec_8048_disconnect(struct omap_dss_device *dssdev)if (!omapdss_device_is_connected (dssdev))return ; - in->ops->disconnect (in, dssdev); +omapdss_device_disconnect (in, dssdev);omap_dss_put_device (in); ddata->in =NULL ;
drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c +2 -2
@@ -73,7 +73,7 @@ static int sharp_ls_connect(struct omap_dss_device *dssdev)return PTR_ERR (in); } - r = in->ops->connect (in, dssdev); + r =omapdss_device_connect (in, dssdev);if (r) {omap_dss_put_device (in);return r;
@@ -91,7 +91,7 @@ static void sharp_ls_disconnect(struct omap_dss_device *dssdev)if (!omapdss_device_is_connected (dssdev))return ; - in->ops->disconnect (in, dssdev); +omapdss_device_disconnect (in, dssdev);omap_dss_put_device (in); ddata->in =NULL ;
drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c +2 -2
@@ -522,7 +522,7 @@ static int acx565akm_connect(struct omap_dss_device *dssdev)return PTR_ERR (in); } - r = in->ops->connect (in, dssdev); + r =omapdss_device_connect (in, dssdev);if (r) {omap_dss_put_device (in);return r;
@@ -540,7 +540,7 @@ static void acx565akm_disconnect(struct omap_dss_device *dssdev)if (!omapdss_device_is_connected (dssdev))return ; - in->ops->disconnect (in, dssdev); +omapdss_device_disconnect (in, dssdev);omap_dss_put_device (in); ddata->in =NULL ;
drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c +2 -2
@@ -181,7 +181,7 @@ static int td028ttec1_panel_connect(struct omap_dss_device *dssdev)return PTR_ERR (in); } - r = in->ops->connect (in, dssdev); + r =omapdss_device_connect (in, dssdev);if (r) {omap_dss_put_device (in);return r;
@@ -199,7 +199,7 @@ static void td028ttec1_panel_disconnect(struct omap_dss_device *dssdev)if (!omapdss_device_is_connected (dssdev))return ; - in->ops->disconnect (in, dssdev); +omapdss_device_disconnect (in, dssdev);omap_dss_put_device (in); ddata->in =NULL ;
drivers/gpu/drm/omapdrm/displays/panel-tpo-td043mtea1.c +2 -2
@@ -352,7 +352,7 @@ static int tpo_td043_connect(struct omap_dss_device *dssdev)return PTR_ERR (in); } - r = in->ops->connect (in, dssdev); + r =omapdss_device_connect (in, dssdev);if (r) {omap_dss_put_device (in);return r;
@@ -370,7 +370,7 @@ static void tpo_td043_disconnect(struct omap_dss_device *dssdev)if (!omapdss_device_is_connected (dssdev))return ; - in->ops->disconnect (in, dssdev); +omapdss_device_disconnect (in, dssdev);omap_dss_put_device (in); ddata->in =NULL ;
drivers/gpu/drm/omapdrm/dss/base.c +20 -0
@@ -102,6 +102,26 @@ struct omap_dss_device *omapdss_find_device_by_port(struct device_node *src,return NULL ; } +int omapdss_device_connect (struct omap_dss_device *src, +struct omap_dss_device *dst) +{ +if (src->driver) +return src->driver->connect (src); +else +return src->ops->connect (src, dst); +} +EXPORT_SYMBOL_GPL (omapdss_device_connect); + +void omapdss_device_disconnect (struct omap_dss_device *src, +struct omap_dss_device *dst) +{ +if (src->driver) + src->driver->disconnect (src); +else + src->ops->disconnect (src, dst); +} +EXPORT_SYMBOL_GPL (omapdss_device_disconnect); +/* ----------------------------------------------------------------------------- * Components Handling */
drivers/gpu/drm/omapdrm/dss/omapdss.h +4 -0
@@ -498,6 +498,10 @@ void omapdss_device_register(struct omap_dss_device *dssdev);void omapdss_device_unregister (struct omap_dss_device *dssdev);struct omap_dss_device *omapdss_find_device_by_port (struct device_node *src,unsigned int port); +int omapdss_device_connect (struct omap_dss_device *src, +struct omap_dss_device *dst); +void omapdss_device_disconnect (struct omap_dss_device *src, +struct omap_dss_device *dst);struct omap_dss_device *omap_dss_get_device (struct omap_dss_device *dssdev);void omap_dss_put_device (struct omap_dss_device *dssdev);
drivers/gpu/drm/omapdrm/omap_drv.c +2 -2
@@ -159,7 +159,7 @@ static void omap_disconnect_dssdevs(struct drm_device *ddev)for (i =0 ; i < priv->num_dssdevs; i++) {struct omap_dss_device *dssdev = priv->dssdevs[i]; - dssdev->driver->disconnect (dssdev); +omapdss_device_disconnect (dssdev,NULL ); priv->dssdevs[i] =NULL ;omap_dss_put_device (dssdev); }
@@ -189,7 +189,7 @@ static int omap_connect_dssdevs(struct drm_device *ddev)return -EPROBE_DEFER ;for_each_dss_dev (dssdev) { - r = dssdev->driver->connect (dssdev); + r =omapdss_device_connect (dssdev,NULL );if (r == -EPROBE_DEFER ) {omap_dss_put_device (dssdev); goto cleanup;
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 20/60] drm/omap: dss: Add functions to connect and disconnect devices
Hi,
Quoted 8 lines · Laurent Pinchart
The
omap_dss_deviceobjects model display components and are connected at runtime to create display pipelines. The connect and disconnect operations implemented by each component contain lots of duplicate code. As a first step towards fixing this, create new functions to wrap the direct calls to those operations and use them.Signed-off-by Laurent Pinchart <[email protected]>---
-- Sebastian
Quoted 413 lines
.../gpu/drm/omapdrm/displays/connector-analog-tv.c | 4 ++-- drivers/gpu/drm/omapdrm/displays/connector-dvi.c | 4 ++-- drivers/gpu/drm/omapdrm/displays/connector-hdmi.c | 4 ++-- drivers/gpu/drm/omapdrm/displays/encoder-opa362.c | 4 ++-- drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c | 4 ++-- drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c | 4 ++-- drivers/gpu/drm/omapdrm/displays/panel-dpi.c | 4 ++-- drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 6 +++--- .../drm/omapdrm/displays/panel-lgphilips-lb035q02.c | 4 ++-- .../gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c | 4 ++-- .../drm/omapdrm/displays/panel-sharp-ls037v7dw01.c | 4 ++-- .../gpu/drm/omapdrm/displays/panel-sony-acx565akm.c | 4 ++-- .../gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c | 4 ++-- .../gpu/drm/omapdrm/displays/panel-tpo-td043mtea1.c | 4 ++-- drivers/gpu/drm/omapdrm/dss/base.c | 20 ++++++++++++++++++++ drivers/gpu/drm/omapdrm/dss/omapdss.h | 4 ++++ drivers/gpu/drm/omapdrm/omap_drv.c | 4 ++-- 17 files changed, 55 insertions(+), 31 deletions(-)drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c +2
-2@@ -59,7 +59,7 @@ static int tvc_connect(struct omap_dss_device *dssdev)return PTR_ERR (in); } - r = in->ops->connect (in, dssdev); + r =omapdss_device_connect (in, dssdev);if (r) {omap_dss_put_device (in);return r;@@ -79,7 +79,7 @@ static void tvc_disconnect(struct omap_dss_device *dssdev)if (!omapdss_device_is_connected (dssdev))return ; - in->ops->disconnect (in, dssdev); +omapdss_device_disconnect (in, dssdev);omap_dss_put_device (in); ddata->in =NULL ;drivers/gpu/drm/omapdrm/displays/connector-dvi.c +2
-2@@ -72,7 +72,7 @@ static int dvic_connect(struct omap_dss_device *dssdev)return PTR_ERR (in); } - r = in->ops->connect (in, dssdev); + r =omapdss_device_connect (in, dssdev);if (r) {omap_dss_put_device (in);return r;@@ -90,7 +90,7 @@ static void dvic_disconnect(struct omap_dss_device *dssdev)if (!omapdss_device_is_connected (dssdev))return ; - in->ops->disconnect (in, dssdev); +omapdss_device_disconnect (in, dssdev);omap_dss_put_device (in); ddata->in =NULL ;drivers/gpu/drm/omapdrm/displays/connector-hdmi.c +2
-2@@ -69,7 +69,7 @@ static int hdmic_connect(struct omap_dss_device *dssdev)return PTR_ERR (in); } - r = in->ops->connect (in, dssdev); + r =omapdss_device_connect (in, dssdev);if (r) {omap_dss_put_device (in);return r;@@ -89,7 +89,7 @@ static void hdmic_disconnect(struct omap_dss_device *dssdev)if (!omapdss_device_is_connected (dssdev))return ; - in->ops->disconnect (in, dssdev); +omapdss_device_disconnect (in, dssdev);omap_dss_put_device (in); ddata->in =NULL ;drivers/gpu/drm/omapdrm/displays/encoder-opa362.c +2
-2@@ -50,7 +50,7 @@ static int opa362_connect(struct omap_dss_device *dssdev,return PTR_ERR (in); } - r = in->ops->connect (in, dssdev); + r =omapdss_device_connect (in, dssdev);if (r) {omap_dss_put_device (in);return r;@@ -82,7 +82,7 @@ static void opa362_disconnect(struct omap_dss_device *dssdev, dst->src =NULL ; dssdev->dst =NULL ; - in->ops->disconnect (in, &ddata->dssdev); +omapdss_device_disconnect (in, &ddata->dssdev);omap_dss_put_device (in); ddata->in =NULL ;drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c +2
-2@@ -44,7 +44,7 @@ static int tfp410_connect(struct omap_dss_device *dssdev,return PTR_ERR (in); } - r = in->ops->connect (in, dssdev); + r =omapdss_device_connect (in, dssdev);if (r) {omap_dss_put_device (in);return r;@@ -74,7 +74,7 @@ static void tfp410_disconnect(struct omap_dss_device *dssdev, dst->src =NULL ; dssdev->dst =NULL ; - in->ops->disconnect (in, &ddata->dssdev); +omapdss_device_disconnect (in, &ddata->dssdev);omap_dss_put_device (in); ddata->in =NULL ;drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c +2
-2@@ -49,7 +49,7 @@ static int tpd_connect(struct omap_dss_device *dssdev,return PTR_ERR (in); } - r = in->ops->connect (in, dssdev); + r =omapdss_device_connect (in, dssdev);if (r) {omap_dss_put_device (in);return r;@@ -85,7 +85,7 @@ static void tpd_disconnect(struct omap_dss_device *dssdev, dst->src =NULL ; dssdev->dst =NULL ; - in->ops->disconnect (in, &ddata->dssdev); +omapdss_device_disconnect (in, &ddata->dssdev);omap_dss_put_device (in); ddata->in =NULL ;drivers/gpu/drm/omapdrm/displays/panel-dpi.c +2
-2@@ -50,7 +50,7 @@ static int panel_dpi_connect(struct omap_dss_device *dssdev)return PTR_ERR (in); } - r = in->ops->connect (in, dssdev); + r =omapdss_device_connect (in, dssdev);if (r) {omap_dss_put_device (in);return r;@@ -68,7 +68,7 @@ static void panel_dpi_disconnect(struct omap_dss_device *dssdev)if (!omapdss_device_is_connected (dssdev))return ; - in->ops->disconnect (in, dssdev); +omapdss_device_disconnect (in, dssdev);omap_dss_put_device (in); ddata->in =NULL ;drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +3
-3@@ -772,7 +772,7 @@ static int dsicm_connect(struct omap_dss_device *dssdev)return PTR_ERR (in); } - r = in->ops->connect (in, dssdev); + r =omapdss_device_connect (in, dssdev);if (r) {dev_err (dev,"Failed to connect to video source\n" ); goto err_connect;@@ -796,7 +796,7 @@ static int dsicm_connect(struct omap_dss_device *dssdev) err_vc_id: in->ops->dsi.release_vc (in, ddata->channel); err_req_vc: - in->ops->disconnect (in, dssdev); +omapdss_device_disconnect (in, dssdev); err_connect:omap_dss_put_device (in);return r;@@ -811,7 +811,7 @@ static void dsicm_disconnect(struct omap_dss_device *dssdev)return ; in->ops->dsi.release_vc (in, ddata->channel); - in->ops->disconnect (in, dssdev); +omapdss_device_disconnect (in, dssdev);omap_dss_put_device (in); ddata->in =NULL ;drivers/gpu/drm/omapdrm/displays/panel-lgphilips-lb035q02.c +2
-2@@ -131,7 +131,7 @@ static int lb035q02_connect(struct omap_dss_device *dssdev)return PTR_ERR (in); } - r = in->ops->connect (in, dssdev); + r =omapdss_device_connect (in, dssdev);if (r) {omap_dss_put_device (in);return r;@@ -151,7 +151,7 @@ static void lb035q02_disconnect(struct omap_dss_device *dssdev)if (!omapdss_device_is_connected (dssdev))return ; - in->ops->disconnect (in, dssdev); +omapdss_device_disconnect (in, dssdev);omap_dss_put_device (in); ddata->in =NULL ;drivers/gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c +2
-2@@ -127,7 +127,7 @@ static int nec_8048_connect(struct omap_dss_device *dssdev)return PTR_ERR (in); } - r = in->ops->connect (in, dssdev); + r =omapdss_device_connect (in, dssdev);if (r) {omap_dss_put_device (in);return r;@@ -145,7 +145,7 @@ static void nec_8048_disconnect(struct omap_dss_device *dssdev)if (!omapdss_device_is_connected (dssdev))return ; - in->ops->disconnect (in, dssdev); +omapdss_device_disconnect (in, dssdev);omap_dss_put_device (in); ddata->in =NULL ;drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c +2
-2@@ -73,7 +73,7 @@ static int sharp_ls_connect(struct omap_dss_device *dssdev)return PTR_ERR (in); } - r = in->ops->connect (in, dssdev); + r =omapdss_device_connect (in, dssdev);if (r) {omap_dss_put_device (in);return r;@@ -91,7 +91,7 @@ static void sharp_ls_disconnect(struct omap_dss_device *dssdev)if (!omapdss_device_is_connected (dssdev))return ; - in->ops->disconnect (in, dssdev); +omapdss_device_disconnect (in, dssdev);omap_dss_put_device (in); ddata->in =NULL ;drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c +2
-2@@ -522,7 +522,7 @@ static int acx565akm_connect(struct omap_dss_device *dssdev)return PTR_ERR (in); } - r = in->ops->connect (in, dssdev); + r =omapdss_device_connect (in, dssdev);if (r) {omap_dss_put_device (in);return r;@@ -540,7 +540,7 @@ static void acx565akm_disconnect(struct omap_dss_device *dssdev)if (!omapdss_device_is_connected (dssdev))return ; - in->ops->disconnect (in, dssdev); +omapdss_device_disconnect (in, dssdev);omap_dss_put_device (in); ddata->in =NULL ;drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c +2
-2@@ -181,7 +181,7 @@ static int td028ttec1_panel_connect(struct omap_dss_device *dssdev)return PTR_ERR (in); } - r = in->ops->connect (in, dssdev); + r =omapdss_device_connect (in, dssdev);if (r) {omap_dss_put_device (in);return r;@@ -199,7 +199,7 @@ static void td028ttec1_panel_disconnect(struct omap_dss_device *dssdev)if (!omapdss_device_is_connected (dssdev))return ; - in->ops->disconnect (in, dssdev); +omapdss_device_disconnect (in, dssdev);omap_dss_put_device (in); ddata->in =NULL ;drivers/gpu/drm/omapdrm/displays/panel-tpo-td043mtea1.c +2
-2@@ -352,7 +352,7 @@ static int tpo_td043_connect(struct omap_dss_device *dssdev)return PTR_ERR (in); } - r = in->ops->connect (in, dssdev); + r =omapdss_device_connect (in, dssdev);if (r) {omap_dss_put_device (in);return r;@@ -370,7 +370,7 @@ static void tpo_td043_disconnect(struct omap_dss_device *dssdev)if (!omapdss_device_is_connected (dssdev))return ; - in->ops->disconnect (in, dssdev); +omapdss_device_disconnect (in, dssdev);omap_dss_put_device (in); ddata->in =NULL ;drivers/gpu/drm/omapdrm/dss/base.c +20
-0@@ -102,6 +102,26 @@ struct omap_dss_device *omapdss_find_device_by_port(struct device_node *src,return NULL ; } +int omapdss_device_connect (struct omap_dss_device *src, +struct omap_dss_device *dst) +{ +if (src->driver) +return src->driver->connect (src); +else +return src->ops->connect (src, dst); +} +EXPORT_SYMBOL_GPL (omapdss_device_connect); + +void omapdss_device_disconnect (struct omap_dss_device *src, +struct omap_dss_device *dst) +{ +if (src->driver) + src->driver->disconnect (src); +else + src->ops->disconnect (src, dst); +} +EXPORT_SYMBOL_GPL (omapdss_device_disconnect); +/* ----------------------------------------------------------------------------- * Components Handling */ drivers/gpu/drm/omapdrm/dss/omapdss.h +4
-0@@ -498,6 +498,10 @@ void omapdss_device_register(struct omap_dss_device *dssdev);void omapdss_device_unregister (struct omap_dss_device *dssdev);struct omap_dss_device *omapdss_find_device_by_port (struct device_node *src,unsigned int port); +int omapdss_device_connect (struct omap_dss_device *src, +struct omap_dss_device *dst); +void omapdss_device_disconnect (struct omap_dss_device *src, +struct omap_dss_device *dst);struct omap_dss_device *omap_dss_get_device (struct omap_dss_device *dssdev);void omap_dss_put_device (struct omap_dss_device *dssdev);drivers/gpu/drm/omapdrm/omap_drv.c +2
-2@@ -159,7 +159,7 @@ static void omap_disconnect_dssdevs(struct drm_device *ddev)for (i =0 ; i < priv->num_dssdevs; i++) {struct omap_dss_device *dssdev = priv->dssdevs[i]; - dssdev->driver->disconnect (dssdev); +omapdss_device_disconnect (dssdev,NULL ); priv->dssdevs[i] =NULL ;omap_dss_put_device (dssdev); }@@ -189,7 +189,7 @@ static int omap_connect_dssdevs(struct drm_device *ddev)return -EPROBE_DEFER ;for_each_dss_dev (dssdev) { - r = dssdev->driver->connect (dssdev); + r =omapdss_device_connect (dssdev,NULL );if (r == -EPROBE_DEFER ) {omap_dss_put_device (dssdev); goto cleanup;Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 21/60 drm/omap: dss: Move debug message and checks to connection handlers
In reply to Laurent PinchartThe connectors, encoders and display duplicate the same debug messages and connection checks in their omap_dss_device connect and disconnect handlers. Move the code to the connect and disconnect wrappers.
To simplify the code the connect function returns -EBUSY unconditionally if the device is already connected. This doesn't cause any change in
practice: the connect handler of displays is never called on a connected device as it is only invoked during omapdrm initialization.
--- drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c | 10 ---------- drivers/gpu/drm/omapdrm/displays/connector-dvi.c | 6 ------ drivers/gpu/drm/omapdrm/displays/connector-hdmi.c | 10 ---------- drivers/gpu/drm/omapdrm/displays/encoder-opa362.c | 11 ----------- drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c | 7 ------- drivers/gpu/drm/omapdrm/displays/panel-dpi.c | 6 ------ drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 6 ------ drivers/gpu/drm/omapdrm/displays/panel-lgphilips-lb035q02.c | 6 ------ drivers/gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c | 6 ------ drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c | 6 ------ drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c | 6 ------ drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c | 6 ------ drivers/gpu/drm/omapdrm/displays/panel-tpo-td043mtea1.c | 6 ------ drivers/gpu/drm/omapdrm/dss/base.c | 12 ++++++++++++ 14 files changed, 12 insertions(+), 92 deletions(-)
drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c +0 -10
@@ -48,11 +48,6 @@ static int tvc_connect(struct omap_dss_device *dssdev)struct omap_dss_device *in;int r; -dev_dbg (ddata->dev,"connect\n" ); - -if (omapdss_device_is_connected (dssdev)) -return 0 ; - in =omapdss_of_find_source_for_first_ep (ddata->dev->of_node);if (IS_ERR (in)) {dev_err (ddata->dev,"failed to find video source\n" );
@@ -74,11 +69,6 @@ static void tvc_disconnect(struct omap_dss_device *dssdev)struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -dev_dbg (ddata->dev,"disconnect\n" ); - -if (!omapdss_device_is_connected (dssdev)) -return ; -omapdss_device_disconnect (in, dssdev);omap_dss_put_device (in);
drivers/gpu/drm/omapdrm/displays/connector-dvi.c +0 -6
@@ -63,9 +63,6 @@ static int dvic_connect(struct omap_dss_device *dssdev)struct omap_dss_device *in;int r; -if (omapdss_device_is_connected (dssdev)) -return 0 ; - in =omapdss_of_find_source_for_first_ep (dssdev->dev->of_node);if (IS_ERR (in)) {dev_err (dssdev->dev,"failed to find video source\n" );
@@ -87,9 +84,6 @@ static void dvic_disconnect(struct omap_dss_device *dssdev)struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -if (!omapdss_device_is_connected (dssdev)) -return ; -omapdss_device_disconnect (in, dssdev);omap_dss_put_device (in);
drivers/gpu/drm/omapdrm/displays/connector-hdmi.c +0 -10
@@ -58,11 +58,6 @@ static int hdmic_connect(struct omap_dss_device *dssdev)struct omap_dss_device *in;int r; -dev_dbg (ddata->dev,"connect\n" ); - -if (omapdss_device_is_connected (dssdev)) -return 0 ; - in =omapdss_of_find_source_for_first_ep (ddata->dev->of_node);if (IS_ERR (in)) {dev_err (ddata->dev,"failed to find video source\n" );
@@ -84,11 +79,6 @@ static void hdmic_disconnect(struct omap_dss_device *dssdev)struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -dev_dbg (ddata->dev,"disconnect\n" ); - -if (!omapdss_device_is_connected (dssdev)) -return ; -omapdss_device_disconnect (in, dssdev);omap_dss_put_device (in);
drivers/gpu/drm/omapdrm/displays/encoder-opa362.c +0 -11
@@ -39,11 +39,6 @@ static int opa362_connect(struct omap_dss_device *dssdev,struct omap_dss_device *in;int r; -dev_dbg (dssdev->dev,"connect\n" ); - -if (omapdss_device_is_connected (dssdev)) -return -EBUSY ; - in =omapdss_of_find_source_for_first_ep (dssdev->dev->of_node);if (IS_ERR (in)) {dev_err (dssdev->dev,"failed to find video source\n" );
@@ -69,12 +64,6 @@ static void opa362_disconnect(struct omap_dss_device *dssdev,struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -dev_dbg (dssdev->dev,"disconnect\n" ); - -WARN_ON (!omapdss_device_is_connected (dssdev)); -if (!omapdss_device_is_connected (dssdev)) -return ; -WARN_ON (dst != dssdev->dst);if (dst != dssdev->dst)return ;
drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c +0 -7
@@ -35,9 +35,6 @@ static int tfp410_connect(struct omap_dss_device *dssdev,struct omap_dss_device *in;int r; -if (omapdss_device_is_connected (dssdev)) -return -EBUSY ; - in =omapdss_of_find_source_for_first_ep (dssdev->dev->of_node);if (IS_ERR (in)) {dev_err (dssdev->dev,"failed to find video source\n" );
@@ -63,10 +60,6 @@ static void tfp410_disconnect(struct omap_dss_device *dssdev,struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -WARN_ON (!omapdss_device_is_connected (dssdev)); -if (!omapdss_device_is_connected (dssdev)) -return ; -WARN_ON (dst != dssdev->dst);if (dst != dssdev->dst)return ;
drivers/gpu/drm/omapdrm/displays/panel-dpi.c +0 -6
@@ -41,9 +41,6 @@ static int panel_dpi_connect(struct omap_dss_device *dssdev)struct omap_dss_device *in;int r; -if (omapdss_device_is_connected (dssdev)) -return 0 ; - in =omapdss_of_find_source_for_first_ep (dssdev->dev->of_node);if (IS_ERR (in)) {dev_err (dssdev->dev,"failed to find video source\n" );
@@ -65,9 +62,6 @@ static void panel_dpi_disconnect(struct omap_dss_device *dssdev)struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -if (!omapdss_device_is_connected (dssdev)) -return ; -omapdss_device_disconnect (in, dssdev);omap_dss_put_device (in);
drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +0 -6
@@ -763,9 +763,6 @@ static int dsicm_connect(struct omap_dss_device *dssdev)struct omap_dss_device *in;int r; -if (omapdss_device_is_connected (dssdev)) -return 0 ; - in =omapdss_of_find_source_for_first_ep (dssdev->dev->of_node);if (IS_ERR (in)) {dev_err (dssdev->dev,"failed to find video source\n" );
@@ -807,9 +804,6 @@ static void dsicm_disconnect(struct omap_dss_device *dssdev)struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -if (!omapdss_device_is_connected (dssdev)) -return ; - in->ops->dsi.release_vc (in, ddata->channel);omapdss_device_disconnect (in, dssdev);
drivers/gpu/drm/omapdrm/displays/panel-lgphilips-lb035q02.c +0 -6
@@ -122,9 +122,6 @@ static int lb035q02_connect(struct omap_dss_device *dssdev)struct omap_dss_device *in;int r; -if (omapdss_device_is_connected (dssdev)) -return 0 ; - in =omapdss_of_find_source_for_first_ep (dssdev->dev->of_node);if (IS_ERR (in)) {dev_err (dssdev->dev,"failed to find video source\n" );
@@ -148,9 +145,6 @@ static void lb035q02_disconnect(struct omap_dss_device *dssdev)struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -if (!omapdss_device_is_connected (dssdev)) -return ; -omapdss_device_disconnect (in, dssdev);omap_dss_put_device (in);
drivers/gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c +0 -6
@@ -118,9 +118,6 @@ static int nec_8048_connect(struct omap_dss_device *dssdev)struct omap_dss_device *in;int r; -if (omapdss_device_is_connected (dssdev)) -return 0 ; - in =omapdss_of_find_source_for_first_ep (dssdev->dev->of_node);if (IS_ERR (in)) {dev_err (dssdev->dev,"failed to find video source\n" );
@@ -142,9 +139,6 @@ static void nec_8048_disconnect(struct omap_dss_device *dssdev)struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -if (!omapdss_device_is_connected (dssdev)) -return ; -omapdss_device_disconnect (in, dssdev);omap_dss_put_device (in);
drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c +0 -6
@@ -64,9 +64,6 @@ static int sharp_ls_connect(struct omap_dss_device *dssdev)struct omap_dss_device *in;int r; -if (omapdss_device_is_connected (dssdev)) -return 0 ; - in =omapdss_of_find_source_for_first_ep (dssdev->dev->of_node);if (IS_ERR (in)) {dev_err (dssdev->dev,"failed to find video source\n" );
@@ -88,9 +85,6 @@ static void sharp_ls_disconnect(struct omap_dss_device *dssdev)struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -if (!omapdss_device_is_connected (dssdev)) -return ; -omapdss_device_disconnect (in, dssdev);omap_dss_put_device (in);
drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c +0 -6
@@ -513,9 +513,6 @@ static int acx565akm_connect(struct omap_dss_device *dssdev)struct omap_dss_device *in;int r; -if (omapdss_device_is_connected (dssdev)) -return 0 ; - in =omapdss_of_find_source_for_first_ep (dssdev->dev->of_node);if (IS_ERR (in)) {dev_err (dssdev->dev,"failed to find video source\n" );
@@ -537,9 +534,6 @@ static void acx565akm_disconnect(struct omap_dss_device *dssdev)struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -if (!omapdss_device_is_connected (dssdev)) -return ; -omapdss_device_disconnect (in, dssdev);omap_dss_put_device (in);
drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c +0 -6
@@ -172,9 +172,6 @@ static int td028ttec1_panel_connect(struct omap_dss_device *dssdev)struct omap_dss_device *in;int r; -if (omapdss_device_is_connected (dssdev)) -return 0 ; - in =omapdss_of_find_source_for_first_ep (dssdev->dev->of_node);if (IS_ERR (in)) {dev_err (dssdev->dev,"failed to find video source\n" );
@@ -196,9 +193,6 @@ static void td028ttec1_panel_disconnect(struct omap_dss_device *dssdev)struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -if (!omapdss_device_is_connected (dssdev)) -return ; -omapdss_device_disconnect (in, dssdev);omap_dss_put_device (in);
drivers/gpu/drm/omapdrm/displays/panel-tpo-td043mtea1.c +0 -6
@@ -343,9 +343,6 @@ static int tpo_td043_connect(struct omap_dss_device *dssdev)struct omap_dss_device *in;int r; -if (omapdss_device_is_connected (dssdev)) -return 0 ; - in =omapdss_of_find_source_for_first_ep (dssdev->dev->of_node);if (IS_ERR (in)) {dev_err (dssdev->dev,"failed to find video source\n" );
@@ -367,9 +364,6 @@ static void tpo_td043_disconnect(struct omap_dss_device *dssdev)struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -if (!omapdss_device_is_connected (dssdev)) -return ; -omapdss_device_disconnect (in, dssdev);omap_dss_put_device (in);
drivers/gpu/drm/omapdrm/dss/base.c +12 -0
@@ -105,6 +105,11 @@ struct omap_dss_device *omapdss_find_device_by_port(struct device_node *src,int omapdss_device_connect (struct omap_dss_device *src,struct omap_dss_device *dst) { +dev_dbg (src->dev,"connect\n" ); + +if (omapdss_device_is_connected (src)) +return -EBUSY ; +if (src->driver)return src->driver->connect (src);else
@@ -115,6 +120,13 @@ EXPORT_SYMBOL_GPL(omapdss_device_connect);void omapdss_device_disconnect (struct omap_dss_device *src,struct omap_dss_device *dst) { +dev_dbg (src->dev,"disconnect\n" ); + +if (!omapdss_device_is_connected (src)) { +WARN_ON (!src->driver); +return ; + } +if (src->driver) src->driver->disconnect (src);else
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 21/60] drm/omap: dss: Move debug message and checks to connection handlers
Hi,
Quoted 11 lines · Laurent Pinchart
The connectors, encoders and display duplicate the same debug messages and connection checks in their
omap_dss_deviceconnect and disconnect handlers. Move the code to the connect and disconnect wrappers.To simplify the code the connect function returns
-EBUSYunconditionally if the device is already connected. This doesn't cause any change in
practice: the connect handler of displays is never called on a connected device as it is only invoked during omapdrm initialization.Signed-off-by Laurent Pinchart <[email protected]>---
-- Sebastian
Quoted 381 lines
drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c | 10 ---------- drivers/gpu/drm/omapdrm/displays/connector-dvi.c | 6 ------ drivers/gpu/drm/omapdrm/displays/connector-hdmi.c | 10 ---------- drivers/gpu/drm/omapdrm/displays/encoder-opa362.c | 11 ----------- drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c | 7 ------- drivers/gpu/drm/omapdrm/displays/panel-dpi.c | 6 ------ drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 6 ------ drivers/gpu/drm/omapdrm/displays/panel-lgphilips-lb035q02.c | 6 ------ drivers/gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c | 6 ------ drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c | 6 ------ drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c | 6 ------ drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c | 6 ------ drivers/gpu/drm/omapdrm/displays/panel-tpo-td043mtea1.c | 6 ------ drivers/gpu/drm/omapdrm/dss/base.c | 12 ++++++++++++ 14 files changed, 12 insertions(+), 92 deletions(-)drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c +0
-10@@ -48,11 +48,6 @@ static int tvc_connect(struct omap_dss_device *dssdev)struct omap_dss_device *in;int r; -dev_dbg (ddata->dev,"connect\n" ); - -if (omapdss_device_is_connected (dssdev)) -return 0 ; - in =omapdss_of_find_source_for_first_ep (ddata->dev->of_node);if (IS_ERR (in)) {dev_err (ddata->dev,"failed to find video source\n" );@@ -74,11 +69,6 @@ static void tvc_disconnect(struct omap_dss_device *dssdev)struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -dev_dbg (ddata->dev,"disconnect\n" ); - -if (!omapdss_device_is_connected (dssdev)) -return ; -omapdss_device_disconnect (in, dssdev);omap_dss_put_device (in);drivers/gpu/drm/omapdrm/displays/connector-dvi.c +0
-6@@ -63,9 +63,6 @@ static int dvic_connect(struct omap_dss_device *dssdev)struct omap_dss_device *in;int r; -if (omapdss_device_is_connected (dssdev)) -return 0 ; - in =omapdss_of_find_source_for_first_ep (dssdev->dev->of_node);if (IS_ERR (in)) {dev_err (dssdev->dev,"failed to find video source\n" );@@ -87,9 +84,6 @@ static void dvic_disconnect(struct omap_dss_device *dssdev)struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -if (!omapdss_device_is_connected (dssdev)) -return ; -omapdss_device_disconnect (in, dssdev);omap_dss_put_device (in);drivers/gpu/drm/omapdrm/displays/connector-hdmi.c +0
-10@@ -58,11 +58,6 @@ static int hdmic_connect(struct omap_dss_device *dssdev)struct omap_dss_device *in;int r; -dev_dbg (ddata->dev,"connect\n" ); - -if (omapdss_device_is_connected (dssdev)) -return 0 ; - in =omapdss_of_find_source_for_first_ep (ddata->dev->of_node);if (IS_ERR (in)) {dev_err (ddata->dev,"failed to find video source\n" );@@ -84,11 +79,6 @@ static void hdmic_disconnect(struct omap_dss_device *dssdev)struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -dev_dbg (ddata->dev,"disconnect\n" ); - -if (!omapdss_device_is_connected (dssdev)) -return ; -omapdss_device_disconnect (in, dssdev);omap_dss_put_device (in);drivers/gpu/drm/omapdrm/displays/encoder-opa362.c +0
-11@@ -39,11 +39,6 @@ static int opa362_connect(struct omap_dss_device *dssdev,struct omap_dss_device *in;int r; -dev_dbg (dssdev->dev,"connect\n" ); - -if (omapdss_device_is_connected (dssdev)) -return -EBUSY ; - in =omapdss_of_find_source_for_first_ep (dssdev->dev->of_node);if (IS_ERR (in)) {dev_err (dssdev->dev,"failed to find video source\n" );@@ -69,12 +64,6 @@ static void opa362_disconnect(struct omap_dss_device *dssdev,struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -dev_dbg (dssdev->dev,"disconnect\n" ); - -WARN_ON (!omapdss_device_is_connected (dssdev)); -if (!omapdss_device_is_connected (dssdev)) -return ; -WARN_ON (dst != dssdev->dst);if (dst != dssdev->dst)return ;drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c +0
-7@@ -35,9 +35,6 @@ static int tfp410_connect(struct omap_dss_device *dssdev,struct omap_dss_device *in;int r; -if (omapdss_device_is_connected (dssdev)) -return -EBUSY ; - in =omapdss_of_find_source_for_first_ep (dssdev->dev->of_node);if (IS_ERR (in)) {dev_err (dssdev->dev,"failed to find video source\n" );@@ -63,10 +60,6 @@ static void tfp410_disconnect(struct omap_dss_device *dssdev,struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -WARN_ON (!omapdss_device_is_connected (dssdev)); -if (!omapdss_device_is_connected (dssdev)) -return ; -WARN_ON (dst != dssdev->dst);if (dst != dssdev->dst)return ;drivers/gpu/drm/omapdrm/displays/panel-dpi.c +0
-6@@ -41,9 +41,6 @@ static int panel_dpi_connect(struct omap_dss_device *dssdev)struct omap_dss_device *in;int r; -if (omapdss_device_is_connected (dssdev)) -return 0 ; - in =omapdss_of_find_source_for_first_ep (dssdev->dev->of_node);if (IS_ERR (in)) {dev_err (dssdev->dev,"failed to find video source\n" );@@ -65,9 +62,6 @@ static void panel_dpi_disconnect(struct omap_dss_device *dssdev)struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -if (!omapdss_device_is_connected (dssdev)) -return ; -omapdss_device_disconnect (in, dssdev);omap_dss_put_device (in);drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +0
-6@@ -763,9 +763,6 @@ static int dsicm_connect(struct omap_dss_device *dssdev)struct omap_dss_device *in;int r; -if (omapdss_device_is_connected (dssdev)) -return 0 ; - in =omapdss_of_find_source_for_first_ep (dssdev->dev->of_node);if (IS_ERR (in)) {dev_err (dssdev->dev,"failed to find video source\n" );@@ -807,9 +804,6 @@ static void dsicm_disconnect(struct omap_dss_device *dssdev)struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -if (!omapdss_device_is_connected (dssdev)) -return ; - in->ops->dsi.release_vc (in, ddata->channel);omapdss_device_disconnect (in, dssdev);drivers/gpu/drm/omapdrm/displays/panel-lgphilips-lb035q02.c +0
-6@@ -122,9 +122,6 @@ static int lb035q02_connect(struct omap_dss_device *dssdev)struct omap_dss_device *in;int r; -if (omapdss_device_is_connected (dssdev)) -return 0 ; - in =omapdss_of_find_source_for_first_ep (dssdev->dev->of_node);if (IS_ERR (in)) {dev_err (dssdev->dev,"failed to find video source\n" );@@ -148,9 +145,6 @@ static void lb035q02_disconnect(struct omap_dss_device *dssdev)struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -if (!omapdss_device_is_connected (dssdev)) -return ; -omapdss_device_disconnect (in, dssdev);omap_dss_put_device (in);drivers/gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c +0
-6@@ -118,9 +118,6 @@ static int nec_8048_connect(struct omap_dss_device *dssdev)struct omap_dss_device *in;int r; -if (omapdss_device_is_connected (dssdev)) -return 0 ; - in =omapdss_of_find_source_for_first_ep (dssdev->dev->of_node);if (IS_ERR (in)) {dev_err (dssdev->dev,"failed to find video source\n" );@@ -142,9 +139,6 @@ static void nec_8048_disconnect(struct omap_dss_device *dssdev)struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -if (!omapdss_device_is_connected (dssdev)) -return ; -omapdss_device_disconnect (in, dssdev);omap_dss_put_device (in);drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c +0
-6@@ -64,9 +64,6 @@ static int sharp_ls_connect(struct omap_dss_device *dssdev)struct omap_dss_device *in;int r; -if (omapdss_device_is_connected (dssdev)) -return 0 ; - in =omapdss_of_find_source_for_first_ep (dssdev->dev->of_node);if (IS_ERR (in)) {dev_err (dssdev->dev,"failed to find video source\n" );@@ -88,9 +85,6 @@ static void sharp_ls_disconnect(struct omap_dss_device *dssdev)struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -if (!omapdss_device_is_connected (dssdev)) -return ; -omapdss_device_disconnect (in, dssdev);omap_dss_put_device (in);drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c +0
-6@@ -513,9 +513,6 @@ static int acx565akm_connect(struct omap_dss_device *dssdev)struct omap_dss_device *in;int r; -if (omapdss_device_is_connected (dssdev)) -return 0 ; - in =omapdss_of_find_source_for_first_ep (dssdev->dev->of_node);if (IS_ERR (in)) {dev_err (dssdev->dev,"failed to find video source\n" );@@ -537,9 +534,6 @@ static void acx565akm_disconnect(struct omap_dss_device *dssdev)struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -if (!omapdss_device_is_connected (dssdev)) -return ; -omapdss_device_disconnect (in, dssdev);omap_dss_put_device (in);drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c +0
-6@@ -172,9 +172,6 @@ static int td028ttec1_panel_connect(struct omap_dss_device *dssdev)struct omap_dss_device *in;int r; -if (omapdss_device_is_connected (dssdev)) -return 0 ; - in =omapdss_of_find_source_for_first_ep (dssdev->dev->of_node);if (IS_ERR (in)) {dev_err (dssdev->dev,"failed to find video source\n" );@@ -196,9 +193,6 @@ static void td028ttec1_panel_disconnect(struct omap_dss_device *dssdev)struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -if (!omapdss_device_is_connected (dssdev)) -return ; -omapdss_device_disconnect (in, dssdev);omap_dss_put_device (in);drivers/gpu/drm/omapdrm/displays/panel-tpo-td043mtea1.c +0
-6@@ -343,9 +343,6 @@ static int tpo_td043_connect(struct omap_dss_device *dssdev)struct omap_dss_device *in;int r; -if (omapdss_device_is_connected (dssdev)) -return 0 ; - in =omapdss_of_find_source_for_first_ep (dssdev->dev->of_node);if (IS_ERR (in)) {dev_err (dssdev->dev,"failed to find video source\n" );@@ -367,9 +364,6 @@ static void tpo_td043_disconnect(struct omap_dss_device *dssdev)struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -if (!omapdss_device_is_connected (dssdev)) -return ; -omapdss_device_disconnect (in, dssdev);omap_dss_put_device (in);drivers/gpu/drm/omapdrm/dss/base.c +12
-0@@ -105,6 +105,11 @@ struct omap_dss_device *omapdss_find_device_by_port(struct device_node *src,int omapdss_device_connect (struct omap_dss_device *src,struct omap_dss_device *dst) { +dev_dbg (src->dev,"connect\n" ); + +if (omapdss_device_is_connected (src)) +return -EBUSY ; +if (src->driver)return src->driver->connect (src);else @@ -115,6 +120,13 @@ EXPORT_SYMBOL_GPL(omapdss_device_connect);void omapdss_device_disconnect (struct omap_dss_device *src,struct omap_dss_device *dst) { +dev_dbg (src->dev,"disconnect\n" ); + +if (!omapdss_device_is_connected (src)) { +WARN_ON (!src->driver); +return ; + } +if (src->driver) src->driver->disconnect (src);else Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 22/60 drm/omap: dss: Move src and dst check and set to connection handlers
In reply to Laurent PinchartThe encoders duplicate the same omap_dss_device src and dst fields set and checks in their connect and disconnect handlers. Move the code to the connect and disconnect wrappers.
--- drivers/gpu/drm/omapdrm/displays/encoder-opa362.c | 10 --------- drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c | 10 --------- .../gpu/drm/omapdrm/displays/encoder-tpd12s015.c | 11 ---------- drivers/gpu/drm/omapdrm/dss/base.c | 24 ++++++++++++++++++++-- drivers/gpu/drm/omapdrm/dss/dpi.c | 5 ----- drivers/gpu/drm/omapdrm/dss/dsi.c | 5 ----- drivers/gpu/drm/omapdrm/dss/hdmi4.c | 5 ----- drivers/gpu/drm/omapdrm/dss/hdmi5.c | 5 ----- drivers/gpu/drm/omapdrm/dss/omapdss.h | 8 +++----- drivers/gpu/drm/omapdrm/dss/output.c | 6 ------ drivers/gpu/drm/omapdrm/dss/sdi.c | 5 ----- drivers/gpu/drm/omapdrm/dss/venc.c | 5 ----- 12 files changed, 25 insertions(+), 74 deletions(-)
drivers/gpu/drm/omapdrm/displays/encoder-opa362.c +0 -10
@@ -51,9 +51,6 @@ static int opa362_connect(struct omap_dss_device *dssdev,return r; } - dst->src = dssdev; - dssdev->dst = dst; - ddata->in = in;return 0 ; }
@@ -64,13 +61,6 @@ static void opa362_disconnect(struct omap_dss_device *dssdev,struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -WARN_ON (dst != dssdev->dst); -if (dst != dssdev->dst) -return ; - - dst->src =NULL ; - dssdev->dst =NULL ; -omapdss_device_disconnect (in, &ddata->dssdev);omap_dss_put_device (in);
drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c +0 -10
@@ -47,9 +47,6 @@ static int tfp410_connect(struct omap_dss_device *dssdev,return r; } - dst->src = dssdev; - dssdev->dst = dst; - ddata->in = in;return 0 ; }
@@ -60,13 +57,6 @@ static void tfp410_disconnect(struct omap_dss_device *dssdev,struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -WARN_ON (dst != dssdev->dst); -if (dst != dssdev->dst) -return ; - - dst->src =NULL ; - dssdev->dst =NULL ; -omapdss_device_disconnect (in, &ddata->dssdev);omap_dss_put_device (in);
drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c +0 -11
@@ -55,9 +55,6 @@ static int tpd_connect(struct omap_dss_device *dssdev,return r; } - dst->src = dssdev; - dssdev->dst = dst; -gpiod_set_value_cansleep (ddata->ct_cp_hpd_gpio,1 );gpiod_set_value_cansleep (ddata->ls_oe_gpio,1 );
@@ -74,17 +71,9 @@ static void tpd_disconnect(struct omap_dss_device *dssdev,struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -WARN_ON (dst != dssdev->dst); - -if (dst != dssdev->dst) -return ; -gpiod_set_value_cansleep (ddata->ct_cp_hpd_gpio,0 );gpiod_set_value_cansleep (ddata->ls_oe_gpio,0 ); - dst->src =NULL ; - dssdev->dst =NULL ; -omapdss_device_disconnect (in, &ddata->dssdev);omap_dss_put_device (in);
drivers/gpu/drm/omapdrm/dss/base.c +22 -2
@@ -105,15 +105,27 @@ struct omap_dss_device *omapdss_find_device_by_port(struct device_node *src,int omapdss_device_connect (struct omap_dss_device *src,struct omap_dss_device *dst) { +int ret; +dev_dbg (src->dev,"connect\n" );if (omapdss_device_is_connected (src))return -EBUSY ;if (src->driver) -return src->driver->connect (src); + ret = src->driver->connect (src);else -return src->ops->connect (src, dst); + ret = src->ops->connect (src, dst); + +if (ret <0 ) +return ret; + +if (dst) { + dst->src = src; + src->dst = dst; + } + +return 0 ; }EXPORT_SYMBOL_GPL (omapdss_device_connect);
@@ -127,6 +139,14 @@ void omapdss_device_disconnect(struct omap_dss_device *src,return ; } +if (dst) { +if (WARN_ON (dst != src->dst)) +return ; + + dst->src =NULL ; + src->dst =NULL ; + } +if (src->driver) src->driver->disconnect (src);else
drivers/gpu/drm/omapdrm/dss/dpi.c +0 -5
@@ -671,11 +671,6 @@ static void dpi_disconnect(struct omap_dss_device *dssdev, {struct dpi_data *dpi =dpi_get_data_from_dssdev (dssdev); -WARN_ON (dst != dssdev->dst); - -if (dst != dssdev->dst) -return ; -omapdss_output_unset_device (dssdev);dss_mgr_disconnect (&dpi->output, dssdev);
drivers/gpu/drm/omapdrm/dss/dsi.c +0 -5
@@ -4990,11 +4990,6 @@ static void dsi_disconnect(struct omap_dss_device *dssdev, {struct dsi_data *dsi =to_dsi_data (dssdev); -WARN_ON (dst != dssdev->dst); - -if (dst != dssdev->dst) -return ; -omapdss_output_unset_device (dssdev);dss_mgr_disconnect (&dsi->output, dssdev);
drivers/gpu/drm/omapdrm/dss/hdmi4.c +0 -5
@@ -478,11 +478,6 @@ static void hdmi_disconnect(struct omap_dss_device *dssdev, {struct omap_hdmi *hdmi =dssdev_to_hdmi (dssdev); -WARN_ON (dst != dssdev->dst); - -if (dst != dssdev->dst) -return ; -omapdss_output_unset_device (dssdev);dss_mgr_disconnect (&hdmi->output, dssdev);
drivers/gpu/drm/omapdrm/dss/hdmi5.c +0 -5
@@ -481,11 +481,6 @@ static void hdmi_disconnect(struct omap_dss_device *dssdev, {struct omap_hdmi *hdmi =dssdev_to_hdmi (dssdev); -WARN_ON (dst != dssdev->dst); - -if (dst != dssdev->dst) -return ; -omapdss_output_unset_device (dssdev);dss_mgr_disconnect (&hdmi->output, dssdev);
drivers/gpu/drm/omapdrm/dss/omapdss.h +3 -5
@@ -391,6 +391,9 @@ struct omap_dss_device {struct module *owner; +struct omap_dss_device *src; +struct omap_dss_device *dst; +struct list_head list;struct list_head panel_list;
@@ -409,8 +412,6 @@ struct omap_dss_device {enum omap_display_caps caps; -struct omap_dss_device *src; -enum omap_dss_display_state state;/* OMAP DSS output specific fields */
@@ -426,9 +427,6 @@ struct omap_dss_device {/* the port number in the DT node */ int port_num; - -/* dynamic fields */ -struct omap_dss_device *dst; };struct omap_dss_driver {
drivers/gpu/drm/omapdrm/dss/output.c +0 -6
@@ -47,9 +47,6 @@ int omapdss_output_set_device(struct omap_dss_device *out, goto err; } - out->dst = dssdev; - dssdev->src = out; -mutex_unlock (&output_lock);return 0 ;
@@ -81,9 +78,6 @@ int omapdss_output_unset_device(struct omap_dss_device *out) goto err; } - out->dst->src =NULL ; - out->dst =NULL ; -mutex_unlock (&output_lock);return 0 ;
drivers/gpu/drm/omapdrm/dss/sdi.c +0 -5
@@ -298,11 +298,6 @@ static void sdi_disconnect(struct omap_dss_device *dssdev, {struct sdi_device *sdi =dssdev_to_sdi (dssdev); -WARN_ON (dst != dssdev->dst); - -if (dst != dssdev->dst) -return ; -omapdss_output_unset_device (dssdev);dss_mgr_disconnect (&sdi->output, dssdev);
drivers/gpu/drm/omapdrm/dss/venc.c +0 -5
@@ -740,11 +740,6 @@ static void venc_disconnect(struct omap_dss_device *dssdev, {struct venc_device *venc =dssdev_to_venc (dssdev); -WARN_ON (dst != dssdev->dst); - -if (dst != dssdev->dst) -return ; -omapdss_output_unset_device (dssdev);dss_mgr_disconnect (&venc->output, dssdev);
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 22/60] drm/omap: dss: Move src and dst check and set to connection handlers
Hi,
Quoted 6 lines · Laurent Pinchart
The encoders duplicate the same
omap_dss_devicesrc and dst fields set and checks in their connect and disconnect handlers. Move the code to the connect and disconnect wrappers.Signed-off-by Laurent Pinchart <[email protected]>---
-- Sebastian
Quoted 313 lines
drivers/gpu/drm/omapdrm/displays/encoder-opa362.c | 10 --------- drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c | 10 --------- .../gpu/drm/omapdrm/displays/encoder-tpd12s015.c | 11 ---------- drivers/gpu/drm/omapdrm/dss/base.c | 24 ++++++++++++++++++++-- drivers/gpu/drm/omapdrm/dss/dpi.c | 5 ----- drivers/gpu/drm/omapdrm/dss/dsi.c | 5 ----- drivers/gpu/drm/omapdrm/dss/hdmi4.c | 5 ----- drivers/gpu/drm/omapdrm/dss/hdmi5.c | 5 ----- drivers/gpu/drm/omapdrm/dss/omapdss.h | 8 +++----- drivers/gpu/drm/omapdrm/dss/output.c | 6 ------ drivers/gpu/drm/omapdrm/dss/sdi.c | 5 ----- drivers/gpu/drm/omapdrm/dss/venc.c | 5 ----- 12 files changed, 25 insertions(+), 74 deletions(-)drivers/gpu/drm/omapdrm/displays/encoder-opa362.c +0
-10@@ -51,9 +51,6 @@ static int opa362_connect(struct omap_dss_device *dssdev,return r; } - dst->src = dssdev; - dssdev->dst = dst; - ddata->in = in;return 0 ; }@@ -64,13 +61,6 @@ static void opa362_disconnect(struct omap_dss_device *dssdev,struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -WARN_ON (dst != dssdev->dst); -if (dst != dssdev->dst) -return ; - - dst->src =NULL ; - dssdev->dst =NULL ; -omapdss_device_disconnect (in, &ddata->dssdev);omap_dss_put_device (in);drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c +0
-10@@ -47,9 +47,6 @@ static int tfp410_connect(struct omap_dss_device *dssdev,return r; } - dst->src = dssdev; - dssdev->dst = dst; - ddata->in = in;return 0 ; }@@ -60,13 +57,6 @@ static void tfp410_disconnect(struct omap_dss_device *dssdev,struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -WARN_ON (dst != dssdev->dst); -if (dst != dssdev->dst) -return ; - - dst->src =NULL ; - dssdev->dst =NULL ; -omapdss_device_disconnect (in, &ddata->dssdev);omap_dss_put_device (in);drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c +0
-11@@ -55,9 +55,6 @@ static int tpd_connect(struct omap_dss_device *dssdev,return r; } - dst->src = dssdev; - dssdev->dst = dst; -gpiod_set_value_cansleep (ddata->ct_cp_hpd_gpio,1 );gpiod_set_value_cansleep (ddata->ls_oe_gpio,1 );@@ -74,17 +71,9 @@ static void tpd_disconnect(struct omap_dss_device *dssdev,struct panel_drv_data *ddata =to_panel_data (dssdev);struct omap_dss_device *in = ddata->in; -WARN_ON (dst != dssdev->dst); - -if (dst != dssdev->dst) -return ; -gpiod_set_value_cansleep (ddata->ct_cp_hpd_gpio,0 );gpiod_set_value_cansleep (ddata->ls_oe_gpio,0 ); - dst->src =NULL ; - dssdev->dst =NULL ; -omapdss_device_disconnect (in, &ddata->dssdev);omap_dss_put_device (in);drivers/gpu/drm/omapdrm/dss/base.c +22
-2@@ -105,15 +105,27 @@ struct omap_dss_device *omapdss_find_device_by_port(struct device_node *src,int omapdss_device_connect (struct omap_dss_device *src,struct omap_dss_device *dst) { +int ret; +dev_dbg (src->dev,"connect\n" );if (omapdss_device_is_connected (src))return -EBUSY ;if (src->driver) -return src->driver->connect (src); + ret = src->driver->connect (src);else -return src->ops->connect (src, dst); + ret = src->ops->connect (src, dst); + +if (ret <0 ) +return ret; + +if (dst) { + dst->src = src; + src->dst = dst; + } + +return 0 ; }EXPORT_SYMBOL_GPL (omapdss_device_connect);@@ -127,6 +139,14 @@ void omapdss_device_disconnect(struct omap_dss_device *src,return ; } +if (dst) { +if (WARN_ON (dst != src->dst)) +return ; + + dst->src =NULL ; + src->dst =NULL ; + } +if (src->driver) src->driver->disconnect (src);else drivers/gpu/drm/omapdrm/dss/dpi.c +0
-5@@ -671,11 +671,6 @@ static void dpi_disconnect(struct omap_dss_device *dssdev, {struct dpi_data *dpi =dpi_get_data_from_dssdev (dssdev); -WARN_ON (dst != dssdev->dst); - -if (dst != dssdev->dst) -return ; -omapdss_output_unset_device (dssdev);dss_mgr_disconnect (&dpi->output, dssdev);drivers/gpu/drm/omapdrm/dss/dsi.c +0
-5@@ -4990,11 +4990,6 @@ static void dsi_disconnect(struct omap_dss_device *dssdev, {struct dsi_data *dsi =to_dsi_data (dssdev); -WARN_ON (dst != dssdev->dst); - -if (dst != dssdev->dst) -return ; -omapdss_output_unset_device (dssdev);dss_mgr_disconnect (&dsi->output, dssdev);drivers/gpu/drm/omapdrm/dss/hdmi4.c +0
-5@@ -478,11 +478,6 @@ static void hdmi_disconnect(struct omap_dss_device *dssdev, {struct omap_hdmi *hdmi =dssdev_to_hdmi (dssdev); -WARN_ON (dst != dssdev->dst); - -if (dst != dssdev->dst) -return ; -omapdss_output_unset_device (dssdev);dss_mgr_disconnect (&hdmi->output, dssdev);drivers/gpu/drm/omapdrm/dss/hdmi5.c +0
-5@@ -481,11 +481,6 @@ static void hdmi_disconnect(struct omap_dss_device *dssdev, {struct omap_hdmi *hdmi =dssdev_to_hdmi (dssdev); -WARN_ON (dst != dssdev->dst); - -if (dst != dssdev->dst) -return ; -omapdss_output_unset_device (dssdev);dss_mgr_disconnect (&hdmi->output, dssdev);drivers/gpu/drm/omapdrm/dss/omapdss.h +3
-5@@ -391,6 +391,9 @@ struct omap_dss_device {struct module *owner; +struct omap_dss_device *src; +struct omap_dss_device *dst; +struct list_head list;struct list_head panel_list;@@ -409,8 +412,6 @@ struct omap_dss_device {enum omap_display_caps caps; -struct omap_dss_device *src; -enum omap_dss_display_state state;/* OMAP DSS output specific fields */ @@ -426,9 +427,6 @@ struct omap_dss_device {/* the port number in the DT node */ int port_num; - -/* dynamic fields */ -struct omap_dss_device *dst; };struct omap_dss_driver {drivers/gpu/drm/omapdrm/dss/output.c +0
-6@@ -47,9 +47,6 @@ int omapdss_output_set_device(struct omap_dss_device *out, goto err; } - out->dst = dssdev; - dssdev->src = out; -mutex_unlock (&output_lock);return 0 ;@@ -81,9 +78,6 @@ int omapdss_output_unset_device(struct omap_dss_device *out) goto err; } - out->dst->src =NULL ; - out->dst =NULL ; -mutex_unlock (&output_lock);return 0 ;drivers/gpu/drm/omapdrm/dss/sdi.c +0
-5@@ -298,11 +298,6 @@ static void sdi_disconnect(struct omap_dss_device *dssdev, {struct sdi_device *sdi =dssdev_to_sdi (dssdev); -WARN_ON (dst != dssdev->dst); - -if (dst != dssdev->dst) -return ; -omapdss_output_unset_device (dssdev);dss_mgr_disconnect (&sdi->output, dssdev);drivers/gpu/drm/omapdrm/dss/venc.c +0
-5@@ -740,11 +740,6 @@ static void venc_disconnect(struct omap_dss_device *dssdev, {struct venc_device *venc =dssdev_to_venc (dssdev); -WARN_ON (dst != dssdev->dst); - -if (dst != dssdev->dst) -return ; -omapdss_output_unset_device (dssdev);dss_mgr_disconnect (&venc->output, dssdev);Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 23/60 drm/omap: displays: Remove input omap_dss_device from panel data
In reply to Laurent PinchartAll connectors, encoders and panels store a pointer to their input omap_dss_device in the panel driver data structure. This duplicates the src field in the omap_dss_device structure. Remove the private copy and use the src field.
--- .../gpu/drm/omapdrm/displays/connector-analog-tv.c | 41 ++--- drivers/gpu/drm/omapdrm/displays/connector-dvi.c | 43 ++--- drivers/gpu/drm/omapdrm/displays/connector-hdmi.c | 88 +++++----- drivers/gpu/drm/omapdrm/displays/encoder-opa362.c | 41 ++--- drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c | 41 ++--- .../gpu/drm/omapdrm/displays/encoder-tpd12s015.c | 68 +++----- drivers/gpu/drm/omapdrm/displays/panel-dpi.c | 44 +++-- drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 190 ++++++++++----------- .../omapdrm/displays/panel-lgphilips-lb035q02.c | 41 ++--- .../drm/omapdrm/displays/panel-nec-nl8048hl11.c | 42 ++--- .../drm/omapdrm/displays/panel-sharp-ls037v7dw01.c | 42 ++--- .../drm/omapdrm/displays/panel-sony-acx565akm.c | 42 ++--- .../drm/omapdrm/displays/panel-tpo-td028ttec1.c | 42 ++--- .../drm/omapdrm/displays/panel-tpo-td043mtea1.c | 44 +++-- 14 files changed, 362 insertions(+), 447 deletions(-)
drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c +18 -23
@@ -18,7 +18,6 @@struct panel_drv_data {struct omap_dss_device dssdev; -struct omap_dss_device *in;struct device *dev;
@@ -45,40 +44,37 @@ static const struct videomode tvc_pal_vm = {static int tvc_connect (struct omap_dss_device *dssdev) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in; +struct omap_dss_device *src;int r; - in =omapdss_of_find_source_for_first_ep (ddata->dev->of_node); -if (IS_ERR (in)) { + src =omapdss_of_find_source_for_first_ep (ddata->dev->of_node); +if (IS_ERR (src)) {dev_err (ddata->dev,"failed to find video source\n" ); -return PTR_ERR (in); +return PTR_ERR (src); } - r =omapdss_device_connect (in, dssdev); + r =omapdss_device_connect (src, dssdev);if (r) { -omap_dss_put_device (in); +omap_dss_put_device (src);return r; } - ddata->in = in;return 0 ; }static void tvc_disconnect (struct omap_dss_device *dssdev) { -struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src; -omapdss_device_disconnect (in, dssdev); +omapdss_device_disconnect (src, dssdev); -omap_dss_put_device (in); - ddata->in =NULL ; +omap_dss_put_device (src); }static int tvc_enable (struct omap_dss_device *dssdev) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src;int r;dev_dbg (ddata->dev,"enable\n" );
@@ -89,9 +85,9 @@ static int tvc_enable(struct omap_dss_device *dssdev)if (omapdss_device_is_enabled (dssdev))return 0 ; - in->ops->set_timings (in, &ddata->vm); + src->ops->set_timings (src, &ddata->vm); - r = in->ops->enable (in); + r = src->ops->enable (src);if (r)return r;
@@ -103,14 +99,14 @@ static int tvc_enable(struct omap_dss_device *dssdev)static void tvc_disable (struct omap_dss_device *dssdev) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src;dev_dbg (ddata->dev,"disable\n" );if (!omapdss_device_is_enabled (dssdev))return ; - in->ops->disable (in); + src->ops->disable (src); dssdev->state =OMAP_DSS_DISPLAY_DISABLED ; }
@@ -119,11 +115,11 @@ static void tvc_set_timings(struct omap_dss_device *dssdev, struct videomode *vm) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src; ddata->vm = *vm; - in->ops->set_timings (in, vm); + src->ops->set_timings (src, vm); } static void tvc_get_timings(struct omap_dss_device *dssdev,
@@ -137,10 +133,9 @@ static void tvc_get_timings(struct omap_dss_device *dssdev,static int tvc_check_timings (struct omap_dss_device *dssdev,struct videomode *vm) { -struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src; -return in->ops->check_timings (in, vm); +return src->ops->check_timings (src, vm); }static const struct omap_dss_driver tvc_driver = {
drivers/gpu/drm/omapdrm/displays/connector-dvi.c +18 -25
109 lines not on this page · raw message
drivers/gpu/drm/omapdrm/displays/connector-hdmi.c +40 -48
230 lines not on this page · raw message
drivers/gpu/drm/omapdrm/displays/encoder-opa362.c +18 -23
113 lines not on this page · raw message
drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c +18 -23
113 lines not on this page · raw message
drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c +28 -40
181 lines not on this page · raw message
drivers/gpu/drm/omapdrm/displays/panel-dpi.c +19 -25
117 lines not on this page · raw message
drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +94 -96
643 lines not on this page · raw message
drivers/gpu/drm/omapdrm/displays/panel-lgphilips-lb035q02.c +18 -23
111 lines not on this page · raw message
drivers/gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c +18 -24
110 lines not on this page · raw message
drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c +18 -24
115 lines not on this page · raw message
drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c +18 -24
108 lines not on this page · raw message
drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c +18 -24
110 lines not on this page · raw message
drivers/gpu/drm/omapdrm/displays/panel-tpo-td043mtea1.c +19 -25
116 lines not on this page · raw message
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 23/60] drm/omap: displays: Remove input omap_dss_device from panel data
Hi,
Quoted 7 lines · Laurent Pinchart
All connectors, encoders and panels store a pointer to their input
omap_dss_devicein the panel driver data structure. This duplicates the src field in theomap_dss_devicestructure. Remove the private copy and use the src field.Signed-off-by Laurent Pinchart <[email protected]>---
-- Sebastian
Quoted 2,508 lines
.../gpu/drm/omapdrm/displays/connector-analog-tv.c | 41 ++--- drivers/gpu/drm/omapdrm/displays/connector-dvi.c | 43 ++--- drivers/gpu/drm/omapdrm/displays/connector-hdmi.c | 88 +++++----- drivers/gpu/drm/omapdrm/displays/encoder-opa362.c | 41 ++--- drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c | 41 ++--- .../gpu/drm/omapdrm/displays/encoder-tpd12s015.c | 68 +++----- drivers/gpu/drm/omapdrm/displays/panel-dpi.c | 44 +++-- drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 190 ++++++++++----------- .../omapdrm/displays/panel-lgphilips-lb035q02.c | 41 ++--- .../drm/omapdrm/displays/panel-nec-nl8048hl11.c | 42 ++--- .../drm/omapdrm/displays/panel-sharp-ls037v7dw01.c | 42 ++--- .../drm/omapdrm/displays/panel-sony-acx565akm.c | 42 ++--- .../drm/omapdrm/displays/panel-tpo-td028ttec1.c | 42 ++--- .../drm/omapdrm/displays/panel-tpo-td043mtea1.c | 44 +++-- 14 files changed, 362 insertions(+), 447 deletions(-)drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c +18
-23@@ -18,7 +18,6 @@struct panel_drv_data {struct omap_dss_device dssdev; -struct omap_dss_device *in;struct device *dev;@@ -45,40 +44,37 @@ static const struct videomode tvc_pal_vm = {static int tvc_connect (struct omap_dss_device *dssdev) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in; +struct omap_dss_device *src;int r; - in =omapdss_of_find_source_for_first_ep (ddata->dev->of_node); -if (IS_ERR (in)) { + src =omapdss_of_find_source_for_first_ep (ddata->dev->of_node); +if (IS_ERR (src)) {dev_err (ddata->dev,"failed to find video source\n" ); -return PTR_ERR (in); +return PTR_ERR (src); } - r =omapdss_device_connect (in, dssdev); + r =omapdss_device_connect (src, dssdev);if (r) { -omap_dss_put_device (in); +omap_dss_put_device (src);return r; } - ddata->in = in;return 0 ; }static void tvc_disconnect (struct omap_dss_device *dssdev) { -struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src; -omapdss_device_disconnect (in, dssdev); +omapdss_device_disconnect (src, dssdev); -omap_dss_put_device (in); - ddata->in =NULL ; +omap_dss_put_device (src); }static int tvc_enable (struct omap_dss_device *dssdev) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src;int r;dev_dbg (ddata->dev,"enable\n" );@@ -89,9 +85,9 @@ static int tvc_enable(struct omap_dss_device *dssdev)if (omapdss_device_is_enabled (dssdev))return 0 ; - in->ops->set_timings (in, &ddata->vm); + src->ops->set_timings (src, &ddata->vm); - r = in->ops->enable (in); + r = src->ops->enable (src);if (r)return r;@@ -103,14 +99,14 @@ static int tvc_enable(struct omap_dss_device *dssdev)static void tvc_disable (struct omap_dss_device *dssdev) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src;dev_dbg (ddata->dev,"disable\n" );if (!omapdss_device_is_enabled (dssdev))return ; - in->ops->disable (in); + src->ops->disable (src); dssdev->state =OMAP_DSS_DISPLAY_DISABLED ; }@@ -119,11 +115,11 @@ static void tvc_set_timings(struct omap_dss_device *dssdev, struct videomode *vm) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src; ddata->vm = *vm; - in->ops->set_timings (in, vm); + src->ops->set_timings (src, vm); } static void tvc_get_timings(struct omap_dss_device *dssdev,@@ -137,10 +133,9 @@ static void tvc_get_timings(struct omap_dss_device *dssdev,static int tvc_check_timings (struct omap_dss_device *dssdev,struct videomode *vm) { -struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src; -return in->ops->check_timings (in, vm); +return src->ops->check_timings (src, vm); }static const struct omap_dss_driver tvc_driver = {drivers/gpu/drm/omapdrm/displays/connector-dvi.c +18
-25@@ -40,7 +40,6 @@ static const struct videomode dvic_default_vm = {struct panel_drv_data {struct omap_dss_device dssdev; -struct omap_dss_device *in;struct videomode vm;@@ -59,41 +58,37 @@ struct panel_drv_data {static int dvic_connect (struct omap_dss_device *dssdev) { -struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in; +struct omap_dss_device *src;int r; - in =omapdss_of_find_source_for_first_ep (dssdev->dev->of_node); -if (IS_ERR (in)) { + src =omapdss_of_find_source_for_first_ep (dssdev->dev->of_node); +if (IS_ERR (src)) {dev_err (dssdev->dev,"failed to find video source\n" ); -return PTR_ERR (in); +return PTR_ERR (src); } - r =omapdss_device_connect (in, dssdev); + r =omapdss_device_connect (src, dssdev);if (r) { -omap_dss_put_device (in); +omap_dss_put_device (src);return r; } - ddata->in = in;return 0 ; }static void dvic_disconnect (struct omap_dss_device *dssdev) { -struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src; -omapdss_device_disconnect (in, dssdev); +omapdss_device_disconnect (src, dssdev); -omap_dss_put_device (in); - ddata->in =NULL ; +omap_dss_put_device (src); }static int dvic_enable (struct omap_dss_device *dssdev) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src;int r;if (!omapdss_device_is_connected (dssdev))@@ -102,9 +97,9 @@ static int dvic_enable(struct omap_dss_device *dssdev)if (omapdss_device_is_enabled (dssdev))return 0 ; - in->ops->set_timings (in, &ddata->vm); + src->ops->set_timings (src, &ddata->vm); - r = in->ops->enable (in); + r = src->ops->enable (src);if (r)return r;@@ -115,13 +110,12 @@ static int dvic_enable(struct omap_dss_device *dssdev)static void dvic_disable (struct omap_dss_device *dssdev) { -struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src;if (!omapdss_device_is_enabled (dssdev))return ; - in->ops->disable (in); + src->ops->disable (src); dssdev->state =OMAP_DSS_DISPLAY_DISABLED ; }@@ -130,11 +124,11 @@ static void dvic_set_timings(struct omap_dss_device *dssdev, struct videomode *vm) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src; ddata->vm = *vm; - in->ops->set_timings (in, vm); + src->ops->set_timings (src, vm); } static void dvic_get_timings(struct omap_dss_device *dssdev,@@ -148,10 +142,9 @@ static void dvic_get_timings(struct omap_dss_device *dssdev,static int dvic_check_timings (struct omap_dss_device *dssdev,struct videomode *vm) { -struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src; -return in->ops->check_timings (in, vm); +return src->ops->check_timings (src, vm); } static int dvic_ddc_read(struct i2c_adapter *adapter,drivers/gpu/drm/omapdrm/displays/connector-hdmi.c +40
-48@@ -37,7 +37,6 @@ static const struct videomode hdmic_default_vm = {struct panel_drv_data {struct omap_dss_device dssdev; -struct omap_dss_device *in;void (*hpd_cb)(void *cb_data,enum drm_connector_status status);void *hpd_cb_data;bool hpd_enabled;@@ -55,40 +54,37 @@ struct panel_drv_data {static int hdmic_connect (struct omap_dss_device *dssdev) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in; +struct omap_dss_device *src;int r; - in =omapdss_of_find_source_for_first_ep (ddata->dev->of_node); -if (IS_ERR (in)) { + src =omapdss_of_find_source_for_first_ep (ddata->dev->of_node); +if (IS_ERR (src)) {dev_err (ddata->dev,"failed to find video source\n" ); -return PTR_ERR (in); +return PTR_ERR (src); } - r =omapdss_device_connect (in, dssdev); + r =omapdss_device_connect (src, dssdev);if (r) { -omap_dss_put_device (in); +omap_dss_put_device (src);return r; } - ddata->in = in;return 0 ; }static void hdmic_disconnect (struct omap_dss_device *dssdev) { -struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src; -omapdss_device_disconnect (in, dssdev); +omapdss_device_disconnect (src, dssdev); -omap_dss_put_device (in); - ddata->in =NULL ; +omap_dss_put_device (src); }static int hdmic_enable (struct omap_dss_device *dssdev) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src;int r;dev_dbg (ddata->dev,"enable\n" );@@ -99,9 +95,9 @@ static int hdmic_enable(struct omap_dss_device *dssdev)if (omapdss_device_is_enabled (dssdev))return 0 ; - in->ops->set_timings (in, &ddata->vm); + src->ops->set_timings (src, &ddata->vm); - r = in->ops->enable (in); + r = src->ops->enable (src);if (r)return r;@@ -113,14 +109,14 @@ static int hdmic_enable(struct omap_dss_device *dssdev)static void hdmic_disable (struct omap_dss_device *dssdev) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src;dev_dbg (ddata->dev,"disable\n" );if (!omapdss_device_is_enabled (dssdev))return ; - in->ops->disable (in); + src->ops->disable (src); dssdev->state =OMAP_DSS_DISPLAY_DISABLED ; }@@ -129,11 +125,11 @@ static void hdmic_set_timings(struct omap_dss_device *dssdev, struct videomode *vm) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src; ddata->vm = *vm; - in->ops->set_timings (in, vm); + src->ops->set_timings (src, vm); } static void hdmic_get_timings(struct omap_dss_device *dssdev,@@ -147,33 +143,31 @@ static void hdmic_get_timings(struct omap_dss_device *dssdev,static int hdmic_check_timings (struct omap_dss_device *dssdev,struct videomode *vm) { -struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src; -return in->ops->check_timings (in, vm); +return src->ops->check_timings (src, vm); }static int hdmic_read_edid (struct omap_dss_device *dssdev,u8 *edid,int len) { -struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src; -return in->ops->hdmi.read_edid (in, edid, len); +return src->ops->hdmi.read_edid (src, edid, len); }static bool hdmic_detect (struct omap_dss_device *dssdev) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src;bool connected;if (gpio_is_valid (ddata->hpd_gpio)) connected =gpio_get_value_cansleep (ddata->hpd_gpio);else - connected = in->ops->hdmi.detect (in); -if (!connected && in->ops->hdmi.lost_hotplug) - in->ops->hdmi.lost_hotplug (in); + connected = src->ops->hdmi.detect (src); +if (!connected && src->ops->hdmi.lost_hotplug) + src->ops->hdmi.lost_hotplug (src);return connected; }@@ -183,7 +177,7 @@ static int hdmic_register_hpd_cb(struct omap_dss_device *dssdev, void *cb_data) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src;if (gpio_is_valid (ddata->hpd_gpio)) {mutex_lock (&ddata->hpd_lock);@@ -191,8 +185,8 @@ static int hdmic_register_hpd_cb(struct omap_dss_device *dssdev, ddata->hpd_cb_data = cb_data;mutex_unlock (&ddata->hpd_lock);return 0 ; - }else if (in->ops->hdmi.register_hpd_cb) { -return in->ops->hdmi.register_hpd_cb (in, cb, cb_data); + }else if (src->ops->hdmi.register_hpd_cb) { +return src->ops->hdmi.register_hpd_cb (src, cb, cb_data); }return -ENOTSUPP ;@@ -201,61 +195,59 @@ static int hdmic_register_hpd_cb(struct omap_dss_device *dssdev,static void hdmic_unregister_hpd_cb (struct omap_dss_device *dssdev) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src;if (gpio_is_valid (ddata->hpd_gpio)) {mutex_lock (&ddata->hpd_lock); ddata->hpd_cb =NULL ; ddata->hpd_cb_data =NULL ;mutex_unlock (&ddata->hpd_lock); - }else if (in->ops->hdmi.unregister_hpd_cb) { - in->ops->hdmi.unregister_hpd_cb (in); + }else if (src->ops->hdmi.unregister_hpd_cb) { + src->ops->hdmi.unregister_hpd_cb (src); } }static void hdmic_enable_hpd (struct omap_dss_device *dssdev) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src;if (gpio_is_valid (ddata->hpd_gpio)) {mutex_lock (&ddata->hpd_lock); ddata->hpd_enabled = true;mutex_unlock (&ddata->hpd_lock); - }else if (in->ops->hdmi.enable_hpd) { - in->ops->hdmi.enable_hpd (in); + }else if (src->ops->hdmi.enable_hpd) { + src->ops->hdmi.enable_hpd (src); } }static void hdmic_disable_hpd (struct omap_dss_device *dssdev) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src;if (gpio_is_valid (ddata->hpd_gpio)) {mutex_lock (&ddata->hpd_lock); ddata->hpd_enabled = false;mutex_unlock (&ddata->hpd_lock); - }else if (in->ops->hdmi.disable_hpd) { - in->ops->hdmi.disable_hpd (in); + }else if (src->ops->hdmi.disable_hpd) { + src->ops->hdmi.disable_hpd (src); } }static int hdmic_set_hdmi_mode (struct omap_dss_device *dssdev,bool hdmi_mode) { -struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src; -return in->ops->hdmi.set_hdmi_mode (in, hdmi_mode); +return src->ops->hdmi.set_hdmi_mode (src, hdmi_mode); }static int hdmic_set_infoframe (struct omap_dss_device *dssdev,const struct hdmi_avi_infoframe *avi) { -struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src; -return in->ops->hdmi.set_infoframe (in, avi); +return src->ops->hdmi.set_infoframe (src, avi); }static const struct omap_dss_driver hdmic_driver = {drivers/gpu/drm/omapdrm/displays/encoder-opa362.c +18
-23@@ -23,7 +23,6 @@struct panel_drv_data {struct omap_dss_device dssdev; -struct omap_dss_device *in;struct gpio_desc *enable_gpio;@@ -35,23 +34,21 @@ struct panel_drv_data {static int opa362_connect (struct omap_dss_device *dssdev,struct omap_dss_device *dst) { -struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in; +struct omap_dss_device *src;int r; - in =omapdss_of_find_source_for_first_ep (dssdev->dev->of_node); -if (IS_ERR (in)) { + src =omapdss_of_find_source_for_first_ep (dssdev->dev->of_node); +if (IS_ERR (src)) {dev_err (dssdev->dev,"failed to find video source\n" ); -return PTR_ERR (in); +return PTR_ERR (src); } - r =omapdss_device_connect (in, dssdev); + r =omapdss_device_connect (src, dssdev);if (r) { -omap_dss_put_device (in); +omap_dss_put_device (src);return r; } - ddata->in = in;return 0 ; }@@ -59,18 +56,17 @@ static void opa362_disconnect(struct omap_dss_device *dssdev, struct omap_dss_device *dst) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src; -omapdss_device_disconnect (in, &ddata->dssdev); +omapdss_device_disconnect (src, &ddata->dssdev); -omap_dss_put_device (in); - ddata->in =NULL ; +omap_dss_put_device (src); }static int opa362_enable (struct omap_dss_device *dssdev) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src;int r;dev_dbg (dssdev->dev,"enable\n" );@@ -81,9 +77,9 @@ static int opa362_enable(struct omap_dss_device *dssdev)if (omapdss_device_is_enabled (dssdev))return 0 ; - in->ops->set_timings (in, &ddata->vm); + src->ops->set_timings (src, &ddata->vm); - r = in->ops->enable (in); + r = src->ops->enable (src);if (r)return r;@@ -98,7 +94,7 @@ static int opa362_enable(struct omap_dss_device *dssdev)static void opa362_disable (struct omap_dss_device *dssdev) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src;dev_dbg (dssdev->dev,"disable\n" );@@ -108,7 +104,7 @@ static void opa362_disable(struct omap_dss_device *dssdev)if (ddata->enable_gpio)gpiod_set_value_cansleep (ddata->enable_gpio,0 ); - in->ops->disable (in); + src->ops->disable (src); dssdev->state =OMAP_DSS_DISPLAY_DISABLED ; }@@ -117,24 +113,23 @@ static void opa362_set_timings(struct omap_dss_device *dssdev, struct videomode *vm) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src;dev_dbg (dssdev->dev,"set_timings\n" ); ddata->vm = *vm; - in->ops->set_timings (in, vm); + src->ops->set_timings (src, vm); }static int opa362_check_timings (struct omap_dss_device *dssdev,struct videomode *vm) { -struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src;dev_dbg (dssdev->dev,"check_timings\n" ); -return in->ops->check_timings (in, vm); +return src->ops->check_timings (src, vm); }static const struct omap_dss_device_ops opa362_ops = {drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c +18
-23@@ -19,7 +19,6 @@struct panel_drv_data {struct omap_dss_device dssdev; -struct omap_dss_device *in;int pd_gpio;@@ -31,23 +30,21 @@ struct panel_drv_data {static int tfp410_connect (struct omap_dss_device *dssdev,struct omap_dss_device *dst) { -struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in; +struct omap_dss_device *src;int r; - in =omapdss_of_find_source_for_first_ep (dssdev->dev->of_node); -if (IS_ERR (in)) { + src =omapdss_of_find_source_for_first_ep (dssdev->dev->of_node); +if (IS_ERR (src)) {dev_err (dssdev->dev,"failed to find video source\n" ); -return PTR_ERR (in); +return PTR_ERR (src); } - r =omapdss_device_connect (in, dssdev); + r =omapdss_device_connect (src, dssdev);if (r) { -omap_dss_put_device (in); +omap_dss_put_device (src);return r; } - ddata->in = in;return 0 ; }@@ -55,18 +52,17 @@ static void tfp410_disconnect(struct omap_dss_device *dssdev, struct omap_dss_device *dst) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src; -omapdss_device_disconnect (in, &ddata->dssdev); +omapdss_device_disconnect (src, &ddata->dssdev); -omap_dss_put_device (in); - ddata->in =NULL ; +omap_dss_put_device (src); }static int tfp410_enable (struct omap_dss_device *dssdev) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src;int r;if (!omapdss_device_is_connected (dssdev))@@ -75,9 +71,9 @@ static int tfp410_enable(struct omap_dss_device *dssdev)if (omapdss_device_is_enabled (dssdev))return 0 ; - in->ops->set_timings (in, &ddata->vm); + src->ops->set_timings (src, &ddata->vm); - r = in->ops->enable (in); + r = src->ops->enable (src);if (r)return r;@@ -92,7 +88,7 @@ static int tfp410_enable(struct omap_dss_device *dssdev)static void tfp410_disable (struct omap_dss_device *dssdev) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src;if (!omapdss_device_is_enabled (dssdev))return ;@@ -100,7 +96,7 @@ static void tfp410_disable(struct omap_dss_device *dssdev)if (gpio_is_valid (ddata->pd_gpio))gpio_set_value_cansleep (ddata->pd_gpio,0 ); - in->ops->disable (in); + src->ops->disable (src); dssdev->state =OMAP_DSS_DISPLAY_DISABLED ; }@@ -115,24 +111,23 @@ static void tfp410_set_timings(struct omap_dss_device *dssdev, struct videomode *vm) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src;tfp410_fix_timings (vm); ddata->vm = *vm; - in->ops->set_timings (in, vm); + src->ops->set_timings (src, vm); }static int tfp410_check_timings (struct omap_dss_device *dssdev,struct videomode *vm) { -struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src;tfp410_fix_timings (vm); -return in->ops->check_timings (in, vm); +return src->ops->check_timings (src, vm); }static const struct omap_dss_device_ops tfp410_ops = {drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c +28
-40@@ -21,7 +21,6 @@struct panel_drv_data {struct omap_dss_device dssdev; -struct omap_dss_device *in;void (*hpd_cb)(void *cb_data,enum drm_connector_status status);void *hpd_cb_data;bool hpd_enabled;@@ -40,18 +39,18 @@ static int tpd_connect(struct omap_dss_device *dssdev, struct omap_dss_device *dst) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in; +struct omap_dss_device *src;int r; - in =omapdss_of_find_source_for_first_ep (dssdev->dev->of_node); -if (IS_ERR (in)) { + src =omapdss_of_find_source_for_first_ep (dssdev->dev->of_node); +if (IS_ERR (src)) {dev_err (dssdev->dev,"failed to find video source\n" ); -return PTR_ERR (in); +return PTR_ERR (src); } - r =omapdss_device_connect (in, dssdev); + r =omapdss_device_connect (src, dssdev);if (r) { -omap_dss_put_device (in); +omap_dss_put_device (src);return r; }@@ -61,7 +60,6 @@ static int tpd_connect(struct omap_dss_device *dssdev,/* DC-DC converter needs at max 300us to get to 90% of 5V */ udelay (300 ); - ddata->in = in;return 0 ; }@@ -69,29 +67,28 @@ static void tpd_disconnect(struct omap_dss_device *dssdev, struct omap_dss_device *dst) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src;gpiod_set_value_cansleep (ddata->ct_cp_hpd_gpio,0 );gpiod_set_value_cansleep (ddata->ls_oe_gpio,0 ); -omapdss_device_disconnect (in, &ddata->dssdev); +omapdss_device_disconnect (src, &ddata->dssdev); -omap_dss_put_device (in); - ddata->in =NULL ; +omap_dss_put_device (src); }static int tpd_enable (struct omap_dss_device *dssdev) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src;int r;if (dssdev->state ==OMAP_DSS_DISPLAY_ACTIVE )return 0 ; - in->ops->set_timings (in, &ddata->vm); + src->ops->set_timings (src, &ddata->vm); - r = in->ops->enable (in); + r = src->ops->enable (src);if (r)return r;@@ -102,13 +99,12 @@ static int tpd_enable(struct omap_dss_device *dssdev)static void tpd_disable (struct omap_dss_device *dssdev) { -struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src;if (dssdev->state !=OMAP_DSS_DISPLAY_ACTIVE )return ; - in->ops->disable (in); + src->ops->disable (src); dssdev->state =OMAP_DSS_DISPLAY_DISABLED ; }@@ -117,45 +113,41 @@ static void tpd_set_timings(struct omap_dss_device *dssdev, struct videomode *vm) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src; ddata->vm = *vm; - in->ops->set_timings (in, vm); + src->ops->set_timings (src, vm); }static int tpd_check_timings (struct omap_dss_device *dssdev,struct videomode *vm) { -struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; -int r; - - r = in->ops->check_timings (in, vm); +struct omap_dss_device *src = dssdev->src; -return r; +return src->ops->check_timings (src, vm); }static int tpd_read_edid (struct omap_dss_device *dssdev,u8 *edid,int len) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src;if (!gpiod_get_value_cansleep (ddata->hpd_gpio))return -ENODEV ; -return in->ops->hdmi.read_edid (in, edid, len); +return src->ops->hdmi.read_edid (src, edid, len); }static bool tpd_detect (struct omap_dss_device *dssdev) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src;bool connected =gpiod_get_value_cansleep (ddata->hpd_gpio); -if (!connected && in->ops->hdmi.lost_hotplug) - in->ops->hdmi.lost_hotplug (in); +if (!connected && src->ops->hdmi.lost_hotplug) + src->ops->hdmi.lost_hotplug (src);return connected; }@@ -205,19 +197,17 @@ static void tpd_disable_hpd(struct omap_dss_device *dssdev)static int tpd_set_infoframe (struct omap_dss_device *dssdev,const struct hdmi_avi_infoframe *avi) { -struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src; -return in->ops->hdmi.set_infoframe (in, avi); +return src->ops->hdmi.set_infoframe (src, avi); }static int tpd_set_hdmi_mode (struct omap_dss_device *dssdev,bool hdmi_mode) { -struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src; -return in->ops->hdmi.set_hdmi_mode (in, hdmi_mode); +return src->ops->hdmi.set_hdmi_mode (src, hdmi_mode); }static const struct omap_dss_device_ops tpd_ops = {@@ -262,7 +252,7 @@ static irqreturn_t tpd_hpd_isr(int irq, void *data)static int tpd_probe (struct platform_device *pdev) { -struct omap_dss_device *in, *dssdev; +struct omap_dss_device *dssdev;struct panel_drv_data *ddata;int r;struct gpio_desc *gpio;@@ -311,8 +301,6 @@ static int tpd_probe(struct platform_device *pdev) dssdev->owner =THIS_MODULE ; dssdev->port_num =1 ; - in = ddata->in; - r =omapdss_register_output (dssdev);if (r) {dev_err (&pdev->dev,"Failed to register output\n" );drivers/gpu/drm/omapdrm/displays/panel-dpi.c +19
-25@@ -23,7 +23,6 @@struct panel_drv_data {struct omap_dss_device dssdev; -struct omap_dss_device *in;struct videomode vm;@@ -37,41 +36,37 @@ struct panel_drv_data {static int panel_dpi_connect (struct omap_dss_device *dssdev) { -struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in; +struct omap_dss_device *src;int r; - in =omapdss_of_find_source_for_first_ep (dssdev->dev->of_node); -if (IS_ERR (in)) { + src =omapdss_of_find_source_for_first_ep (dssdev->dev->of_node); +if (IS_ERR (src)) {dev_err (dssdev->dev,"failed to find video source\n" ); -return PTR_ERR (in); +return PTR_ERR (src); } - r =omapdss_device_connect (in, dssdev); + r =omapdss_device_connect (src, dssdev);if (r) { -omap_dss_put_device (in); +omap_dss_put_device (src);return r; } - ddata->in = in;return 0 ; }static void panel_dpi_disconnect (struct omap_dss_device *dssdev) { -struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src; -omapdss_device_disconnect (in, dssdev); +omapdss_device_disconnect (src, dssdev); -omap_dss_put_device (in); - ddata->in =NULL ; +omap_dss_put_device (src); }static int panel_dpi_enable (struct omap_dss_device *dssdev) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src;int r;if (!omapdss_device_is_connected (dssdev))@@ -80,15 +75,15 @@ static int panel_dpi_enable(struct omap_dss_device *dssdev)if (omapdss_device_is_enabled (dssdev))return 0 ; - in->ops->set_timings (in, &ddata->vm); + src->ops->set_timings (src, &ddata->vm); - r = in->ops->enable (in); + r = src->ops->enable (src);if (r)return r; r =regulator_enable (ddata->vcc_supply);if (r) { - in->ops->disable (in); + src->ops->disable (src);return r; }@@ -103,7 +98,7 @@ static int panel_dpi_enable(struct omap_dss_device *dssdev)static void panel_dpi_disable (struct omap_dss_device *dssdev) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src;if (!omapdss_device_is_enabled (dssdev))return ;@@ -113,7 +108,7 @@ static void panel_dpi_disable(struct omap_dss_device *dssdev)gpiod_set_value_cansleep (ddata->enable_gpio,0 );regulator_disable (ddata->vcc_supply); - in->ops->disable (in); + src->ops->disable (src); dssdev->state =OMAP_DSS_DISPLAY_DISABLED ; }@@ -122,11 +117,11 @@ static void panel_dpi_set_timings(struct omap_dss_device *dssdev, struct videomode *vm) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src; ddata->vm = *vm; - in->ops->set_timings (in, vm); + src->ops->set_timings (src, vm); } static void panel_dpi_get_timings(struct omap_dss_device *dssdev,@@ -140,10 +135,9 @@ static void panel_dpi_get_timings(struct omap_dss_device *dssdev,static int panel_dpi_check_timings (struct omap_dss_device *dssdev,struct videomode *vm) { -struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src; -return in->ops->check_timings (in, vm); +return src->ops->check_timings (src, vm); }static const struct omap_dss_driver panel_dpi_ops = {drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +94
-96@@ -41,7 +41,6 @@struct panel_drv_data {struct omap_dss_device dssdev; -struct omap_dss_device *in;struct videomode vm;@@ -142,11 +141,11 @@ static void hw_guard_wait(struct panel_drv_data *ddata)static int dsicm_dcs_read_1 (struct panel_drv_data *ddata,u8 dcs_cmd,u8 *data) { -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = ddata->dssdev.src;int r;u8 buf[1 ]; - r = in->ops->dsi.dcs_read (in, ddata->channel, dcs_cmd, buf,1 ); + r = src->ops->dsi.dcs_read (src, ddata->channel, dcs_cmd, buf,1 );if (r <0 )return r;@@ -158,29 +157,30 @@ static int dsicm_dcs_read_1(struct panel_drv_data *ddata, u8 dcs_cmd, u8 *data)static int dsicm_dcs_write_0 (struct panel_drv_data *ddata,u8 dcs_cmd) { -struct omap_dss_device *in = ddata->in; -return in->ops->dsi.dcs_write (in, ddata->channel, &dcs_cmd,1 ); +struct omap_dss_device *src = ddata->dssdev.src; + +return src->ops->dsi.dcs_write (src, ddata->channel, &dcs_cmd,1 ); }static int dsicm_dcs_write_1 (struct panel_drv_data *ddata,u8 dcs_cmd,u8 param) { -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = ddata->dssdev.src;u8 buf[2 ] = { dcs_cmd, param }; -return in->ops->dsi.dcs_write (in, ddata->channel, buf,2 ); +return src->ops->dsi.dcs_write (src, ddata->channel, buf,2 ); }static int dsicm_sleep_in (struct panel_drv_data *ddata) { -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = ddata->dssdev.src;u8 cmd;int r;hw_guard_wait (ddata); cmd =MIPI_DCS_ENTER_SLEEP_MODE ; - r = in->ops->dsi.dcs_write_nosync (in, ddata->channel, &cmd,1 ); + r = src->ops->dsi.dcs_write_nosync (src, ddata->channel, &cmd,1 );if (r)return r;@@ -228,7 +228,7 @@ static int dsicm_get_id(struct panel_drv_data *ddata, u8 *id1, u8 *id2, u8 *id3)static int dsicm_set_update_window (struct panel_drv_data *ddata,u16 x,u16 y,u16 w,u16 h) { -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = ddata->dssdev.src;int r;u16 x1 = x;u16 x2 = x + w -1 ;@@ -242,7 +242,7 @@ static int dsicm_set_update_window(struct panel_drv_data *ddata, buf[3 ] = (x2 >>8 ) &0xff ; buf[4 ] = (x2 >>0 ) &0xff ; - r = in->ops->dsi.dcs_write_nosync (in, ddata->channel, buf,sizeof (buf)); + r = src->ops->dsi.dcs_write_nosync (src, ddata->channel, buf,sizeof (buf));if (r)return r;@@ -252,11 +252,11 @@ static int dsicm_set_update_window(struct panel_drv_data *ddata, buf[3 ] = (y2 >>8 ) &0xff ; buf[4 ] = (y2 >>0 ) &0xff ; - r = in->ops->dsi.dcs_write_nosync (in, ddata->channel, buf,sizeof (buf)); + r = src->ops->dsi.dcs_write_nosync (src, ddata->channel, buf,sizeof (buf));if (r)return r; - in->ops->dsi.bta_sync (in, ddata->channel); + src->ops->dsi.bta_sync (src, ddata->channel);return r; }@@ -275,7 +275,7 @@ static void dsicm_cancel_ulps_work(struct panel_drv_data *ddata)static int dsicm_enter_ulps (struct panel_drv_data *ddata) { -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = ddata->dssdev.src;int r;if (ddata->ulps_enabled)@@ -290,7 +290,7 @@ static int dsicm_enter_ulps(struct panel_drv_data *ddata)if (ddata->ext_te_gpio)disable_irq (gpiod_to_irq (ddata->ext_te_gpio)); - in->ops->dsi.disable (in, false, true); + src->ops->dsi.disable (src, false, true); ddata->ulps_enabled = true;@@ -309,19 +309,19 @@ static int dsicm_enter_ulps(struct panel_drv_data *ddata)static int dsicm_exit_ulps (struct panel_drv_data *ddata) { -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = ddata->dssdev.src;int r;if (!ddata->ulps_enabled)return 0 ; - r = in->ops->enable (in); + r = src->ops->enable (src);if (r) {dev_err (&ddata->pdev->dev,"failed to enable DSI\n" ); goto err1; } - in->ops->dsi.enable_hs (in, ddata->channel, true); + src->ops->dsi.enable_hs (src, ddata->channel, true); r =_dsicm_enable_te (ddata, true);if (r) {@@ -366,7 +366,7 @@ static int dsicm_wake_up(struct panel_drv_data *ddata)static int dsicm_bl_update_status (struct backlight_device *dev) {struct panel_drv_data *ddata =dev_get_drvdata (&dev->dev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = ddata->dssdev.src;int r =0 ;int level;@@ -381,13 +381,13 @@ static int dsicm_bl_update_status(struct backlight_device *dev)mutex_lock (&ddata->lock);if (ddata->enabled) { - in->ops->dsi.bus_lock (in); + src->ops->dsi.bus_lock (src); r =dsicm_wake_up (ddata);if (!r) r =dsicm_dcs_write_1 (ddata,DCS_BRIGHTNESS , level); - in->ops->dsi.bus_unlock (in); + src->ops->dsi.bus_unlock (src); }mutex_unlock (&ddata->lock);@@ -414,21 +414,21 @@ static ssize_t dsicm_num_errors_show(struct device *dev, {struct platform_device *pdev =to_platform_device (dev);struct panel_drv_data *ddata =platform_get_drvdata (pdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = ddata->dssdev.src;u8 errors =0 ;int r;mutex_lock (&ddata->lock);if (ddata->enabled) { - in->ops->dsi.bus_lock (in); + src->ops->dsi.bus_lock (src); r =dsicm_wake_up (ddata);if (!r) r =dsicm_dcs_read_1 (ddata,DCS_READ_NUM_ERRORS , &errors); - in->ops->dsi.bus_unlock (in); + src->ops->dsi.bus_unlock (src); }else { r = -ENODEV ; }@@ -446,20 +446,20 @@ static ssize_t dsicm_hw_revision_show(struct device *dev, {struct platform_device *pdev =to_platform_device (dev);struct panel_drv_data *ddata =platform_get_drvdata (pdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = ddata->dssdev.src;u8 id1, id2, id3;int r;mutex_lock (&ddata->lock);if (ddata->enabled) { - in->ops->dsi.bus_lock (in); + src->ops->dsi.bus_lock (src); r =dsicm_wake_up (ddata);if (!r) r =dsicm_get_id (ddata, &id1, &id2, &id3); - in->ops->dsi.bus_unlock (in); + src->ops->dsi.bus_unlock (src); }else { r = -ENODEV ; }@@ -478,7 +478,7 @@ static ssize_t dsicm_store_ulps(struct device *dev, {struct platform_device *pdev =to_platform_device (dev);struct panel_drv_data *ddata =platform_get_drvdata (pdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = ddata->dssdev.src;unsigned long t;int r;@@ -489,14 +489,14 @@ static ssize_t dsicm_store_ulps(struct device *dev,mutex_lock (&ddata->lock);if (ddata->enabled) { - in->ops->dsi.bus_lock (in); + src->ops->dsi.bus_lock (src);if (t) r =dsicm_enter_ulps (ddata);else r =dsicm_wake_up (ddata); - in->ops->dsi.bus_unlock (in); + src->ops->dsi.bus_unlock (src); }mutex_unlock (&ddata->lock);@@ -528,7 +528,7 @@ static ssize_t dsicm_store_ulps_timeout(struct device *dev, {struct platform_device *pdev =to_platform_device (dev);struct panel_drv_data *ddata =platform_get_drvdata (pdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = ddata->dssdev.src;unsigned long t;int r;@@ -541,9 +541,9 @@ static ssize_t dsicm_store_ulps_timeout(struct device *dev,if (ddata->enabled) {/* dsicm_wake_up will restart the timer */ - in->ops->dsi.bus_lock (in); + src->ops->dsi.bus_lock (src); r =dsicm_wake_up (ddata); - in->ops->dsi.bus_unlock (in); + src->ops->dsi.bus_unlock (src); }mutex_unlock (&ddata->lock);@@ -603,7 +603,7 @@ static void dsicm_hw_reset(struct panel_drv_data *ddata)static int dsicm_power_on (struct panel_drv_data *ddata) { -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = ddata->dssdev.src;u8 id1, id2, id3;int r;struct omap_dss_dsi_config dsi_config = {@@ -635,7 +635,7 @@ static int dsicm_power_on(struct panel_drv_data *ddata) }if (ddata->pin_config.num_pins >0 ) { - r = in->ops->dsi.configure_pins (in, &ddata->pin_config); + r = src->ops->dsi.configure_pins (src, &ddata->pin_config);if (r) {dev_err (&ddata->pdev->dev,"failed to configure DSI pins\n" );@@ -643,13 +643,13 @@ static int dsicm_power_on(struct panel_drv_data *ddata) } } - r = in->ops->dsi.set_config (in, &dsi_config); + r = src->ops->dsi.set_config (src, &dsi_config);if (r) {dev_err (&ddata->pdev->dev,"failed to configure DSI\n" ); goto err_vddi; } - r = in->ops->enable (in); + r = src->ops->enable (src);if (r) {dev_err (&ddata->pdev->dev,"failed to enable DSI\n" ); goto err_vddi;@@ -657,7 +657,7 @@ static int dsicm_power_on(struct panel_drv_data *ddata)dsicm_hw_reset (ddata); - in->ops->dsi.enable_hs (in, ddata->channel, false); + src->ops->dsi.enable_hs (src, ddata->channel, false); r =dsicm_sleep_out (ddata);if (r)@@ -689,7 +689,7 @@ static int dsicm_power_on(struct panel_drv_data *ddata)if (r) goto err; - r = in->ops->dsi.enable_video_output (in, ddata->channel); + r = src->ops->dsi.enable_video_output (src, ddata->channel);if (r) goto err;@@ -701,7 +701,7 @@ static int dsicm_power_on(struct panel_drv_data *ddata) ddata->intro_printed = true; } - in->ops->dsi.enable_hs (in, ddata->channel, true); + src->ops->dsi.enable_hs (src, ddata->channel, true);return 0 ; err:@@ -709,7 +709,7 @@ static int dsicm_power_on(struct panel_drv_data *ddata)dsicm_hw_reset (ddata); - in->ops->dsi.disable (in, true, false); + src->ops->dsi.disable (src, true, false); err_vddi:if (ddata->vddi)regulator_disable (ddata->vddi);@@ -722,10 +722,10 @@ static int dsicm_power_on(struct panel_drv_data *ddata)static void dsicm_power_off (struct panel_drv_data *ddata) { -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = ddata->dssdev.src;int r; - in->ops->dsi.disable_video_output (in, ddata->channel); + src->ops->dsi.disable_video_output (src, ddata->channel); r =dsicm_dcs_write_0 (ddata,MIPI_DCS_SET_DISPLAY_OFF );if (!r)@@ -737,7 +737,7 @@ static void dsicm_power_off(struct panel_drv_data *ddata)dsicm_hw_reset (ddata); } - in->ops->dsi.disable (in, true, false); + src->ops->dsi.disable (src, true, false);if (ddata->vddi)regulator_disable (ddata->vddi);@@ -760,61 +760,59 @@ static int dsicm_connect(struct omap_dss_device *dssdev) {struct panel_drv_data *ddata =to_panel_data (dssdev);struct device *dev = &ddata->pdev->dev; -struct omap_dss_device *in; +struct omap_dss_device *src;int r; - in =omapdss_of_find_source_for_first_ep (dssdev->dev->of_node); -if (IS_ERR (in)) { + src =omapdss_of_find_source_for_first_ep (dssdev->dev->of_node); +if (IS_ERR (src)) {dev_err (dssdev->dev,"failed to find video source\n" ); -return PTR_ERR (in); +return PTR_ERR (src); } - r =omapdss_device_connect (in, dssdev); + r =omapdss_device_connect (src, dssdev);if (r) {dev_err (dev,"Failed to connect to video source\n" ); goto err_connect; } - r = in->ops->dsi.request_vc (in, &ddata->channel); + r = src->ops->dsi.request_vc (src, &ddata->channel);if (r) {dev_err (dev,"failed to get virtual channel\n" ); goto err_req_vc; } - r = in->ops->dsi.set_vc_id (in, ddata->channel,TCH ); + r = src->ops->dsi.set_vc_id (src, ddata->channel,TCH );if (r) {dev_err (dev,"failed to set VC_ID\n" ); goto err_vc_id; } - ddata->in = in;return 0 ; err_vc_id: - in->ops->dsi.release_vc (in, ddata->channel); + src->ops->dsi.release_vc (src, ddata->channel); err_req_vc: -omapdss_device_disconnect (in, dssdev); +omapdss_device_disconnect (src, dssdev); err_connect: -omap_dss_put_device (in); +omap_dss_put_device (src);return r; }static void dsicm_disconnect (struct omap_dss_device *dssdev) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src; - in->ops->dsi.release_vc (in, ddata->channel); -omapdss_device_disconnect (in, dssdev); + src->ops->dsi.release_vc (src, ddata->channel); +omapdss_device_disconnect (src, dssdev); -omap_dss_put_device (in); - ddata->in =NULL ; +omap_dss_put_device (src); }static int dsicm_enable (struct omap_dss_device *dssdev) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src;int r;dev_dbg (&ddata->pdev->dev,"enable\n" );@@ -831,11 +829,11 @@ static int dsicm_enable(struct omap_dss_device *dssdev) goto err; } - in->ops->dsi.bus_lock (in); + src->ops->dsi.bus_lock (src); r =dsicm_power_on (ddata); - in->ops->dsi.bus_unlock (in); + src->ops->dsi.bus_unlock (src);if (r) goto err;@@ -856,7 +854,7 @@ static int dsicm_enable(struct omap_dss_device *dssdev)static void dsicm_disable (struct omap_dss_device *dssdev) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src;int r;dev_dbg (&ddata->pdev->dev,"disable\n" );@@ -867,7 +865,7 @@ static void dsicm_disable(struct omap_dss_device *dssdev)dsicm_cancel_ulps_work (ddata); - in->ops->dsi.bus_lock (in); + src->ops->dsi.bus_lock (src);if (omapdss_device_is_enabled (dssdev)) { r =dsicm_wake_up (ddata);@@ -875,7 +873,7 @@ static void dsicm_disable(struct omap_dss_device *dssdev)dsicm_power_off (ddata); } - in->ops->dsi.bus_unlock (in); + src->ops->dsi.bus_unlock (src); dssdev->state =OMAP_DSS_DISPLAY_DISABLED ;@@ -885,16 +883,16 @@ static void dsicm_disable(struct omap_dss_device *dssdev)static void dsicm_framedone_cb (int err,void *data) {struct panel_drv_data *ddata = data; -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = ddata->dssdev.src;dev_dbg (&ddata->pdev->dev,"framedone, err %d\n" , err); - in->ops->dsi.bus_unlock (ddata->in); + src->ops->dsi.bus_unlock (src); }static irqreturn_t dsicm_te_isr (int irq,void *data) {struct panel_drv_data *ddata = data; -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = ddata->dssdev.src;int old;int r;@@ -903,7 +901,7 @@ static irqreturn_t dsicm_te_isr(int irq, void *data)if (old) {cancel_delayed_work (&ddata->te_timeout_work); - r = in->ops->dsi.update (in, ddata->channel, dsicm_framedone_cb, + r = src->ops->dsi.update (src, ddata->channel, dsicm_framedone_cb, ddata);if (r) goto err;@@ -912,7 +910,7 @@ static irqreturn_t dsicm_te_isr(int irq, void *data)return IRQ_HANDLED ; err:dev_err (&ddata->pdev->dev,"start update failed\n" ); - in->ops->dsi.bus_unlock (in); + src->ops->dsi.bus_unlock (src);return IRQ_HANDLED ; }@@ -920,25 +918,25 @@ static void dsicm_te_timeout_work_callback(struct work_struct *work) { struct panel_drv_data *ddata = container_of(work, struct panel_drv_data, te_timeout_work.work); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = ddata->dssdev.src;dev_err (&ddata->pdev->dev,"TE not received for 250ms!\n" );atomic_set (&ddata->do_update,0 ); - in->ops->dsi.bus_unlock (in); + src->ops->dsi.bus_unlock (src); }static int dsicm_update (struct omap_dss_device *dssdev,u16 x,u16 y,u16 w,u16 h) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src;int r;dev_dbg (&ddata->pdev->dev,"update %d, %d, %d x %d\n" , x, y, w, h);mutex_lock (&ddata->lock); - in->ops->dsi.bus_lock (in); + src->ops->dsi.bus_lock (src); r =dsicm_wake_up (ddata);if (r)@@ -960,17 +958,17 @@ static int dsicm_update(struct omap_dss_device *dssdev, msecs_to_jiffies(250));atomic_set (&ddata->do_update,1 ); }else { - r = in->ops->dsi.update (in, ddata->channel, dsicm_framedone_cb, + r = src->ops->dsi.update (src, ddata->channel, dsicm_framedone_cb, ddata);if (r) goto err; } -/* note: no bus_unlock here. unlock is in framedone_cb */ +/* note: no bus_unlock here. unlock is src framedone_cb */ mutex_unlock (&ddata->lock);return 0 ; err: - in->ops->dsi.bus_unlock (in); + src->ops->dsi.bus_unlock (src);mutex_unlock (&ddata->lock);return r; }@@ -978,13 +976,13 @@ static int dsicm_update(struct omap_dss_device *dssdev,static int dsicm_sync (struct omap_dss_device *dssdev) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src;dev_dbg (&ddata->pdev->dev,"sync\n" );mutex_lock (&ddata->lock); - in->ops->dsi.bus_lock (in); - in->ops->dsi.bus_unlock (in); + src->ops->dsi.bus_lock (src); + src->ops->dsi.bus_unlock (src);mutex_unlock (&ddata->lock);dev_dbg (&ddata->pdev->dev,"sync done\n" );@@ -994,7 +992,7 @@ static int dsicm_sync(struct omap_dss_device *dssdev)static int _dsicm_enable_te (struct panel_drv_data *ddata,bool enable) { -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = ddata->dssdev.src;int r;if (enable)@@ -1003,7 +1001,7 @@ static int _dsicm_enable_te(struct panel_drv_data *ddata, bool enable) r =dsicm_dcs_write_0 (ddata,MIPI_DCS_SET_TEAR_OFF );if (!ddata->ext_te_gpio) - in->ops->dsi.enable_te (in, enable); + src->ops->dsi.enable_te (src, enable);/* possible panel bug */ msleep (100 );@@ -1014,7 +1012,7 @@ static int _dsicm_enable_te(struct panel_drv_data *ddata, bool enable)static int dsicm_enable_te (struct omap_dss_device *dssdev,bool enable) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src;int r;mutex_lock (&ddata->lock);@@ -1022,7 +1020,7 @@ static int dsicm_enable_te(struct omap_dss_device *dssdev, bool enable)if (ddata->te_enabled == enable) goto end; - in->ops->dsi.bus_lock (in); + src->ops->dsi.bus_lock (src);if (ddata->enabled) { r =dsicm_wake_up (ddata);@@ -1036,13 +1034,13 @@ static int dsicm_enable_te(struct omap_dss_device *dssdev, bool enable) ddata->te_enabled = enable; - in->ops->dsi.bus_unlock (in); + src->ops->dsi.bus_unlock (src); end:mutex_unlock (&ddata->lock);return 0 ; err: - in->ops->dsi.bus_unlock (in); + src->ops->dsi.bus_unlock (src);mutex_unlock (&ddata->lock);return r;@@ -1065,7 +1063,7 @@ static int dsicm_memory_read(struct omap_dss_device *dssdev, u16 x, u16 y, u16 w, u16 h) { struct panel_drv_data *ddata = to_panel_data(dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src;int r;int first =1 ;int plen;@@ -1084,7 +1082,7 @@ static int dsicm_memory_read(struct omap_dss_device *dssdev, size =min ((u32 )w * h *3 , ddata->vm.hactive * ddata->vm.vactive *3 ); - in->ops->dsi.bus_lock (in); + src->ops->dsi.bus_lock (src); r =dsicm_wake_up (ddata);if (r)@@ -1100,7 +1098,7 @@ static int dsicm_memory_read(struct omap_dss_device *dssdev,dsicm_set_update_window (ddata, x, y, w, h); - r = in->ops->dsi.set_max_rx_packet_size (in, ddata->channel, plen); + r = src->ops->dsi.set_max_rx_packet_size (src, ddata->channel, plen);if (r) goto err2;@@ -1108,7 +1106,7 @@ static int dsicm_memory_read(struct omap_dss_device *dssdev,u8 dcs_cmd = first ?0x2e :0x3e ; first =0 ; - r = in->ops->dsi.dcs_read (in, ddata->channel, dcs_cmd, + r = src->ops->dsi.dcs_read (src, ddata->channel, dcs_cmd, buf + buf_used, size - buf_used);if (r <0 ) {@@ -1134,9 +1132,9 @@ static int dsicm_memory_read(struct omap_dss_device *dssdev, r = buf_used; err3: - in->ops->dsi.set_max_rx_packet_size (in, ddata->channel,1 ); + src->ops->dsi.set_max_rx_packet_size (src, ddata->channel,1 ); err2: - in->ops->dsi.bus_unlock (in); + src->ops->dsi.bus_unlock (src); err1:mutex_unlock (&ddata->lock);return r;@@ -1147,7 +1145,7 @@ static void dsicm_ulps_work(struct work_struct *work) struct panel_drv_data *ddata = container_of(work, struct panel_drv_data, ulps_work.work);struct omap_dss_device *dssdev = &ddata->dssdev; -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src;mutex_lock (&ddata->lock);@@ -1156,11 +1154,11 @@ static void dsicm_ulps_work(struct work_struct *work)return ; } - in->ops->dsi.bus_lock (in); + src->ops->dsi.bus_lock (src);dsicm_enter_ulps (ddata); - in->ops->dsi.bus_unlock (in); + src->ops->dsi.bus_unlock (src);mutex_unlock (&ddata->lock); }drivers/gpu/drm/omapdrm/displays/panel-lgphilips-lb035q02.c +18
-23@@ -45,7 +45,6 @@ static const struct videomode lb035q02_vm = {struct panel_drv_data {struct omap_dss_device dssdev; -struct omap_dss_device *in;struct spi_device *spi;@@ -119,42 +118,39 @@ static void init_lb035q02_panel(struct spi_device *spi)static int lb035q02_connect (struct omap_dss_device *dssdev) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in; +struct omap_dss_device *src;int r; - in =omapdss_of_find_source_for_first_ep (dssdev->dev->of_node); -if (IS_ERR (in)) { + src =omapdss_of_find_source_for_first_ep (dssdev->dev->of_node); +if (IS_ERR (src)) {dev_err (dssdev->dev,"failed to find video source\n" ); -return PTR_ERR (in); +return PTR_ERR (src); } - r =omapdss_device_connect (in, dssdev); + r =omapdss_device_connect (src, dssdev);if (r) { -omap_dss_put_device (in); +omap_dss_put_device (src);return r; }init_lb035q02_panel (ddata->spi); - ddata->in = in;return 0 ; }static void lb035q02_disconnect (struct omap_dss_device *dssdev) { -struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src; -omapdss_device_disconnect (in, dssdev); +omapdss_device_disconnect (src, dssdev); -omap_dss_put_device (in); - ddata->in =NULL ; +omap_dss_put_device (src); }static int lb035q02_enable (struct omap_dss_device *dssdev) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src;int r;if (!omapdss_device_is_connected (dssdev))@@ -163,9 +159,9 @@ static int lb035q02_enable(struct omap_dss_device *dssdev)if (omapdss_device_is_enabled (dssdev))return 0 ; - in->ops->set_timings (in, &ddata->vm); + src->ops->set_timings (src, &ddata->vm); - r = in->ops->enable (in); + r = src->ops->enable (src);if (r)return r;@@ -180,7 +176,7 @@ static int lb035q02_enable(struct omap_dss_device *dssdev)static void lb035q02_disable (struct omap_dss_device *dssdev) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src;if (!omapdss_device_is_enabled (dssdev))return ;@@ -188,7 +184,7 @@ static void lb035q02_disable(struct omap_dss_device *dssdev)if (ddata->enable_gpio)gpiod_set_value_cansleep (ddata->enable_gpio,0 ); - in->ops->disable (in); + src->ops->disable (src); dssdev->state =OMAP_DSS_DISPLAY_DISABLED ; }@@ -197,11 +193,11 @@ static void lb035q02_set_timings(struct omap_dss_device *dssdev, struct videomode *vm) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src; ddata->vm = *vm; - in->ops->set_timings (in, vm); + src->ops->set_timings (src, vm); } static void lb035q02_get_timings(struct omap_dss_device *dssdev,@@ -215,10 +211,9 @@ static void lb035q02_get_timings(struct omap_dss_device *dssdev,static int lb035q02_check_timings (struct omap_dss_device *dssdev,struct videomode *vm) { -struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src; -return in->ops->check_timings (in, vm); +return src->ops->check_timings (src, vm); }static const struct omap_dss_driver lb035q02_ops = {drivers/gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c +18
-24@@ -21,7 +21,6 @@struct panel_drv_data {struct omap_dss_device dssdev; -struct omap_dss_device *in;struct videomode vm;@@ -114,41 +113,37 @@ static int init_nec_8048_wvga_lcd(struct spi_device *spi)static int nec_8048_connect (struct omap_dss_device *dssdev) { -struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in; +struct omap_dss_device *src;int r; - in =omapdss_of_find_source_for_first_ep (dssdev->dev->of_node); -if (IS_ERR (in)) { + src =omapdss_of_find_source_for_first_ep (dssdev->dev->of_node); +if (IS_ERR (src)) {dev_err (dssdev->dev,"failed to find video source\n" ); -return PTR_ERR (in); +return PTR_ERR (src); } - r =omapdss_device_connect (in, dssdev); + r =omapdss_device_connect (src, dssdev);if (r) { -omap_dss_put_device (in); +omap_dss_put_device (src);return r; } - ddata->in = in;return 0 ; }static void nec_8048_disconnect (struct omap_dss_device *dssdev) { -struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src; -omapdss_device_disconnect (in, dssdev); +omapdss_device_disconnect (src, dssdev); -omap_dss_put_device (in); - ddata->in =NULL ; +omap_dss_put_device (src); }static int nec_8048_enable (struct omap_dss_device *dssdev) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src;int r;if (!omapdss_device_is_connected (dssdev))@@ -157,9 +152,9 @@ static int nec_8048_enable(struct omap_dss_device *dssdev)if (omapdss_device_is_enabled (dssdev))return 0 ; - in->ops->set_timings (in, &ddata->vm); + src->ops->set_timings (src, &ddata->vm); - r = in->ops->enable (in); + r = src->ops->enable (src);if (r)return r;@@ -174,7 +169,7 @@ static int nec_8048_enable(struct omap_dss_device *dssdev)static void nec_8048_disable (struct omap_dss_device *dssdev) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src;if (!omapdss_device_is_enabled (dssdev))return ;@@ -182,7 +177,7 @@ static void nec_8048_disable(struct omap_dss_device *dssdev)if (gpio_is_valid (ddata->res_gpio))gpio_set_value_cansleep (ddata->res_gpio,0 ); - in->ops->disable (in); + src->ops->disable (src); dssdev->state =OMAP_DSS_DISPLAY_DISABLED ; }@@ -191,11 +186,11 @@ static void nec_8048_set_timings(struct omap_dss_device *dssdev, struct videomode *vm) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src; ddata->vm = *vm; - in->ops->set_timings (in, vm); + src->ops->set_timings (src, vm); } static void nec_8048_get_timings(struct omap_dss_device *dssdev,@@ -209,10 +204,9 @@ static void nec_8048_get_timings(struct omap_dss_device *dssdev,static int nec_8048_check_timings (struct omap_dss_device *dssdev,struct videomode *vm) { -struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src; -return in->ops->check_timings (in, vm); +return src->ops->check_timings (src, vm); }static const struct omap_dss_driver nec_8048_ops = {drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c +18
-24@@ -21,7 +21,6 @@struct panel_drv_data {struct omap_dss_device dssdev; -struct omap_dss_device *in;struct regulator *vcc;struct videomode vm;@@ -60,41 +59,37 @@ static const struct videomode sharp_ls_vm = {static int sharp_ls_connect (struct omap_dss_device *dssdev) { -struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in; +struct omap_dss_device *src;int r; - in =omapdss_of_find_source_for_first_ep (dssdev->dev->of_node); -if (IS_ERR (in)) { + src =omapdss_of_find_source_for_first_ep (dssdev->dev->of_node); +if (IS_ERR (src)) {dev_err (dssdev->dev,"failed to find video source\n" ); -return PTR_ERR (in); +return PTR_ERR (src); } - r =omapdss_device_connect (in, dssdev); + r =omapdss_device_connect (src, dssdev);if (r) { -omap_dss_put_device (in); +omap_dss_put_device (src);return r; } - ddata->in = in;return 0 ; }static void sharp_ls_disconnect (struct omap_dss_device *dssdev) { -struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src; -omapdss_device_disconnect (in, dssdev); +omapdss_device_disconnect (src, dssdev); -omap_dss_put_device (in); - ddata->in =NULL ; +omap_dss_put_device (src); }static int sharp_ls_enable (struct omap_dss_device *dssdev) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src;int r;if (!omapdss_device_is_connected (dssdev))@@ -103,7 +98,7 @@ static int sharp_ls_enable(struct omap_dss_device *dssdev)if (omapdss_device_is_enabled (dssdev))return 0 ; - in->ops->set_timings (in, &ddata->vm); + src->ops->set_timings (src, &ddata->vm);if (ddata->vcc) { r =regulator_enable (ddata->vcc);@@ -111,7 +106,7 @@ static int sharp_ls_enable(struct omap_dss_device *dssdev)return r; } - r = in->ops->enable (in); + r = src->ops->enable (src);if (r) {regulator_disable (ddata->vcc);return r;@@ -134,7 +129,7 @@ static int sharp_ls_enable(struct omap_dss_device *dssdev)static void sharp_ls_disable (struct omap_dss_device *dssdev) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src;if (!omapdss_device_is_enabled (dssdev))return ;@@ -149,7 +144,7 @@ static void sharp_ls_disable(struct omap_dss_device *dssdev)msleep (100 ); - in->ops->disable (in); + src->ops->disable (src);if (ddata->vcc)regulator_disable (ddata->vcc);@@ -161,11 +156,11 @@ static void sharp_ls_set_timings(struct omap_dss_device *dssdev, struct videomode *vm) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src; ddata->vm = *vm; - in->ops->set_timings (in, vm); + src->ops->set_timings (src, vm); } static void sharp_ls_get_timings(struct omap_dss_device *dssdev,@@ -179,10 +174,9 @@ static void sharp_ls_get_timings(struct omap_dss_device *dssdev,static int sharp_ls_check_timings (struct omap_dss_device *dssdev,struct videomode *vm) { -struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src; -return in->ops->check_timings (in, vm); +return src->ops->check_timings (src, vm); }static const struct omap_dss_driver sharp_ls_ops = {drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c +18
-24@@ -64,7 +64,6 @@struct panel_drv_data {struct omap_dss_device dssdev; -struct omap_dss_device *in;int reset_gpio;@@ -509,48 +508,44 @@ static const struct attribute_group bldev_attr_group = {static int acx565akm_connect (struct omap_dss_device *dssdev) { -struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in; +struct omap_dss_device *src;int r; - in =omapdss_of_find_source_for_first_ep (dssdev->dev->of_node); -if (IS_ERR (in)) { + src =omapdss_of_find_source_for_first_ep (dssdev->dev->of_node); +if (IS_ERR (src)) {dev_err (dssdev->dev,"failed to find video source\n" ); -return PTR_ERR (in); +return PTR_ERR (src); } - r =omapdss_device_connect (in, dssdev); + r =omapdss_device_connect (src, dssdev);if (r) { -omap_dss_put_device (in); +omap_dss_put_device (src);return r; } - ddata->in = in;return 0 ; }static void acx565akm_disconnect (struct omap_dss_device *dssdev) { -struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src; -omapdss_device_disconnect (in, dssdev); +omapdss_device_disconnect (src, dssdev); -omap_dss_put_device (in); - ddata->in =NULL ; +omap_dss_put_device (src); }static int acx565akm_panel_power_on (struct omap_dss_device *dssdev) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src;int r;dev_dbg (&ddata->spi->dev,"%s\n" , __func__); - in->ops->set_timings (in, &ddata->vm); + src->ops->set_timings (src, &ddata->vm); - r = in->ops->enable (in); + r = src->ops->enable (src);if (r) {pr_err ("%s sdi enable failed\n" , __func__);return r;@@ -591,7 +586,7 @@ static int acx565akm_panel_power_on(struct omap_dss_device *dssdev)static void acx565akm_panel_power_off (struct omap_dss_device *dssdev) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src;dev_dbg (dssdev->dev,"%s\n" , __func__);@@ -615,7 +610,7 @@ static void acx565akm_panel_power_off(struct omap_dss_device *dssdev)/* FIXME need to tweak this delay */ msleep (100 ); - in->ops->disable (in); + src->ops->disable (src); }static int acx565akm_enable (struct omap_dss_device *dssdev)@@ -662,11 +657,11 @@ static void acx565akm_set_timings(struct omap_dss_device *dssdev, struct videomode *vm) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src; ddata->vm = *vm; - in->ops->set_timings (in, vm); + src->ops->set_timings (src, vm); } static void acx565akm_get_timings(struct omap_dss_device *dssdev,@@ -680,10 +675,9 @@ static void acx565akm_get_timings(struct omap_dss_device *dssdev,static int acx565akm_check_timings (struct omap_dss_device *dssdev,struct videomode *vm) { -struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src; -return in->ops->check_timings (in, vm); +return src->ops->check_timings (src, vm); }static const struct omap_dss_driver acx565akm_ops = {drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c +18
-24@@ -33,7 +33,6 @@struct panel_drv_data {struct omap_dss_device dssdev; -struct omap_dss_device *in;struct videomode vm;@@ -168,41 +167,37 @@ enum jbt_register {static int td028ttec1_panel_connect (struct omap_dss_device *dssdev) { -struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in; +struct omap_dss_device *src;int r; - in =omapdss_of_find_source_for_first_ep (dssdev->dev->of_node); -if (IS_ERR (in)) { + src =omapdss_of_find_source_for_first_ep (dssdev->dev->of_node); +if (IS_ERR (src)) {dev_err (dssdev->dev,"failed to find video source\n" ); -return PTR_ERR (in); +return PTR_ERR (src); } - r =omapdss_device_connect (in, dssdev); + r =omapdss_device_connect (src, dssdev);if (r) { -omap_dss_put_device (in); +omap_dss_put_device (src);return r; } - ddata->in = in;return 0 ; }static void td028ttec1_panel_disconnect (struct omap_dss_device *dssdev) { -struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src; -omapdss_device_disconnect (in, dssdev); +omapdss_device_disconnect (src, dssdev); -omap_dss_put_device (in); - ddata->in =NULL ; +omap_dss_put_device (src); }static int td028ttec1_panel_enable (struct omap_dss_device *dssdev) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src;int r;if (!omapdss_device_is_connected (dssdev))@@ -211,9 +206,9 @@ static int td028ttec1_panel_enable(struct omap_dss_device *dssdev)if (omapdss_device_is_enabled (dssdev))return 0 ; - in->ops->set_timings (in, &ddata->vm); + src->ops->set_timings (src, &ddata->vm); - r = in->ops->enable (in); + r = src->ops->enable (src);if (r)return r;@@ -310,7 +305,7 @@ static int td028ttec1_panel_enable(struct omap_dss_device *dssdev)static void td028ttec1_panel_disable (struct omap_dss_device *dssdev) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src;if (!omapdss_device_is_enabled (dssdev))return ;@@ -322,7 +317,7 @@ static void td028ttec1_panel_disable(struct omap_dss_device *dssdev)jbt_ret_write_0 (ddata,JBT_REG_SLEEP_IN );jbt_reg_write_1 (ddata,JBT_REG_POWER_ON_OFF ,0x00 ); - in->ops->disable (in); + src->ops->disable (src); dssdev->state =OMAP_DSS_DISPLAY_DISABLED ; }@@ -331,11 +326,11 @@ static void td028ttec1_panel_set_timings(struct omap_dss_device *dssdev, struct videomode *vm) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src; ddata->vm = *vm; - in->ops->set_timings (in, vm); + src->ops->set_timings (src, vm); } static void td028ttec1_panel_get_timings(struct omap_dss_device *dssdev,@@ -349,10 +344,9 @@ static void td028ttec1_panel_get_timings(struct omap_dss_device *dssdev,static int td028ttec1_panel_check_timings (struct omap_dss_device *dssdev,struct videomode *vm) { -struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src; -return in->ops->check_timings (in, vm); +return src->ops->check_timings (src, vm); }static const struct omap_dss_driver td028ttec1_ops = {drivers/gpu/drm/omapdrm/displays/panel-tpo-td043mtea1.c +19
-25@@ -54,7 +54,6 @@ static const u16 tpo_td043_def_gamma[12] = {struct panel_drv_data {struct omap_dss_device dssdev; -struct omap_dss_device *in;struct videomode vm;@@ -339,41 +338,37 @@ static void tpo_td043_power_off(struct panel_drv_data *ddata)static int tpo_td043_connect (struct omap_dss_device *dssdev) { -struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in; +struct omap_dss_device *src;int r; - in =omapdss_of_find_source_for_first_ep (dssdev->dev->of_node); -if (IS_ERR (in)) { + src =omapdss_of_find_source_for_first_ep (dssdev->dev->of_node); +if (IS_ERR (src)) {dev_err (dssdev->dev,"failed to find video source\n" ); -return PTR_ERR (in); +return PTR_ERR (src); } - r =omapdss_device_connect (in, dssdev); + r =omapdss_device_connect (src, dssdev);if (r) { -omap_dss_put_device (in); +omap_dss_put_device (src);return r; } - ddata->in = in;return 0 ; }static void tpo_td043_disconnect (struct omap_dss_device *dssdev) { -struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src; -omapdss_device_disconnect (in, dssdev); +omapdss_device_disconnect (src, dssdev); -omap_dss_put_device (in); - ddata->in =NULL ; +omap_dss_put_device (src); }static int tpo_td043_enable (struct omap_dss_device *dssdev) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src;int r;if (!omapdss_device_is_connected (dssdev))@@ -382,9 +377,9 @@ static int tpo_td043_enable(struct omap_dss_device *dssdev)if (omapdss_device_is_enabled (dssdev))return 0 ; - in->ops->set_timings (in, &ddata->vm); + src->ops->set_timings (src, &ddata->vm); - r = in->ops->enable (in); + r = src->ops->enable (src);if (r)return r;@@ -395,7 +390,7 @@ static int tpo_td043_enable(struct omap_dss_device *dssdev)if (!ddata->spi_suspended) { r =tpo_td043_power_on (ddata);if (r) { - in->ops->disable (in); + src->ops->disable (src);return r; } }@@ -408,12 +403,12 @@ static int tpo_td043_enable(struct omap_dss_device *dssdev)static void tpo_td043_disable (struct omap_dss_device *dssdev) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src;if (!omapdss_device_is_enabled (dssdev))return ; - in->ops->disable (in); + src->ops->disable (src);if (!ddata->spi_suspended)tpo_td043_power_off (ddata);@@ -425,11 +420,11 @@ static void tpo_td043_set_timings(struct omap_dss_device *dssdev, struct videomode *vm) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src; ddata->vm = *vm; - in->ops->set_timings (in, vm); + src->ops->set_timings (src, vm); } static void tpo_td043_get_timings(struct omap_dss_device *dssdev,@@ -443,10 +438,9 @@ static void tpo_td043_get_timings(struct omap_dss_device *dssdev,static int tpo_td043_check_timings (struct omap_dss_device *dssdev,struct videomode *vm) { -struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in; +struct omap_dss_device *src = dssdev->src; -return in->ops->check_timings (in, vm); +return src->ops->check_timings (src, vm); }static const struct omap_dss_driver tpo_td043_ops = {Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 24/60 drm/omap: dsi: Simplify debugfs implementation
In reply to Laurent PinchartThe DSI debugfs regs and irqs show handlers received a pointer to the DSI private data. There's no need to look it up from the list of DSS outputs. Use the pointer directly, this allows simplifying the implementation of the handlers.
--- drivers/gpu/drm/omapdrm/dss/dsi.c | 63 +++++++++------------------------------ 1 file changed, 14 insertions(+), 49 deletions(-)
drivers/gpu/drm/omapdrm/dss/dsi.c +14 -49
@@ -1518,8 +1518,9 @@ void dsi_dump_clocks(struct seq_file *s) }#ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS -static void dsi_dump_dsi_irqs (struct dsi_data *dsi,struct seq_file *s) +static int dsi_dump_dsi_irqs (struct seq_file *s,void *p) { +struct dsi_data *dsi = p;unsigned long flags;struct dsi_irq_stats stats;
@@ -1603,33 +1604,20 @@ static void dsi_dump_dsi_irqs(struct dsi_data *dsi, struct seq_file *s)PIS (ULPSACTIVENOT_ALL0 );PIS (ULPSACTIVENOT_ALL1 );#undef PIS -} - -static int dsi1_dump_irqs (struct seq_file *s,void *p) -{ -struct dsi_data *dsi =dsi_get_dsi_from_id (0 ); -dsi_dump_dsi_irqs (dsi, s); -return 0 ; -} - -static int dsi2_dump_irqs (struct seq_file *s,void *p) -{ -struct dsi_data *dsi =dsi_get_dsi_from_id (1 ); - -dsi_dump_dsi_irqs (dsi, s); return 0; }#endif -static void dsi_dump_dsi_regs (struct dsi_data *dsi,struct seq_file *s) +static int dsi_dump_dsi_regs (struct seq_file *s,void *p) { -#define DUMPREG (r) seq_printf(s, "%-35s %08x\n", #r, dsi_read_reg(dsi, r)) +struct dsi_data *dsi = p;if (dsi_runtime_get (dsi)) -return ; +return 0 ;dsi_enable_scp_clk (dsi); +#define DUMPREG (r) seq_printf(s, "%-35s %08x\n", #r, dsi_read_reg(dsi, r))DUMPREG (DSI_REVISION );DUMPREG (DSI_SYSCONFIG );DUMPREG (DSI_SYSSTATUS );
@@ -1699,25 +1687,11 @@ static void dsi_dump_dsi_regs(struct dsi_data *dsi, struct seq_file *s)DUMPREG (DSI_PLL_GO );DUMPREG (DSI_PLL_CONFIGURATION1 );DUMPREG (DSI_PLL_CONFIGURATION2 ); +#undef DUMPREGdsi_disable_scp_clk (dsi);dsi_runtime_put (dsi); -#undef DUMPREG -} - -static int dsi1_dump_regs (struct seq_file *s,void *p) -{ -struct dsi_data *dsi =dsi_get_dsi_from_id (0 ); -dsi_dump_dsi_regs (dsi, s); -return 0 ; -} - -static int dsi2_dump_regs (struct seq_file *s,void *p) -{ -struct dsi_data *dsi =dsi_get_dsi_from_id (1 ); - -dsi_dump_dsi_regs (dsi, s);return 0 ; }
@@ -5305,6 +5279,7 @@ static int dsi_bind(struct device *dev, struct device *master, void *data)struct dsi_data *dsi;struct resource *dsi_mem;struct resource *res; +char name[10 ]; dsi =devm_kzalloc (dev,sizeof (*dsi),GFP_KERNEL );if (!dsi)
@@ -5443,23 +5418,13 @@ static int dsi_bind(struct device *dev, struct device *master, void *data)dsi_runtime_put (dsi); -if (dsi->module_id ==0 ) - dsi->debugfs.regs =dss_debugfs_create_file (dss,"dsi1_regs" , - dsi1_dump_regs, - &dsi); -else - dsi->debugfs.regs =dss_debugfs_create_file (dss,"dsi2_regs" , - dsi2_dump_regs, - &dsi); +snprintf (name,sizeof (name),"dsi%u_regs" , dsi->module_id +1 ); + dsi->debugfs.regs =dss_debugfs_create_file (dss, name, + dsi_dump_dsi_regs, &dsi);#ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS -if (dsi->module_id ==0 ) - dsi->debugfs.irqs =dss_debugfs_create_file (dss,"dsi1_irqs" , - dsi1_dump_irqs, - &dsi); -else - dsi->debugfs.irqs =dss_debugfs_create_file (dss,"dsi2_irqs" , - dsi2_dump_irqs, - &dsi); +snprintf (name,sizeof (name),"dsi%u_irqs" , dsi->module_id +1 ); + dsi->debugfs.irqs =dss_debugfs_create_file (dss, name, + dsi_dump_dsi_irqs, &dsi);#endif return 0 ;
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 24/60] drm/omap: dsi: Simplify debugfs implementation
Hi,
Quoted 7 lines · Laurent Pinchart
The DSI debugfs regs and irqs show handlers received a pointer to the DSI private data. There's no need to look it up from the list of DSS outputs. Use the pointer directly, this allows simplifying the implementation of the handlers.
Signed-off-by Laurent Pinchart <[email protected]>---
-- Sebastian
Quoted 130 lines
drivers/gpu/drm/omapdrm/dss/dsi.c | 63 +++++++++------------------------------ 1 file changed, 14 insertions(+), 49 deletions(-)drivers/gpu/drm/omapdrm/dss/dsi.c +14
-49@@ -1518,8 +1518,9 @@ void dsi_dump_clocks(struct seq_file *s) }#ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS -static void dsi_dump_dsi_irqs (struct dsi_data *dsi,struct seq_file *s) +static int dsi_dump_dsi_irqs (struct seq_file *s,void *p) { +struct dsi_data *dsi = p;unsigned long flags;struct dsi_irq_stats stats;@@ -1603,33 +1604,20 @@ static void dsi_dump_dsi_irqs(struct dsi_data *dsi, struct seq_file *s)PIS (ULPSACTIVENOT_ALL0 );PIS (ULPSACTIVENOT_ALL1 );#undef PIS -} - -static int dsi1_dump_irqs (struct seq_file *s,void *p) -{ -struct dsi_data *dsi =dsi_get_dsi_from_id (0 ); -dsi_dump_dsi_irqs (dsi, s); -return 0 ; -} - -static int dsi2_dump_irqs (struct seq_file *s,void *p) -{ -struct dsi_data *dsi =dsi_get_dsi_from_id (1 ); - -dsi_dump_dsi_irqs (dsi, s); return 0; }#endif -static void dsi_dump_dsi_regs (struct dsi_data *dsi,struct seq_file *s) +static int dsi_dump_dsi_regs (struct seq_file *s,void *p) { -#define DUMPREG (r) seq_printf(s, "%-35s %08x\n", #r, dsi_read_reg(dsi, r)) +struct dsi_data *dsi = p;if (dsi_runtime_get (dsi)) -return ; +return 0 ;dsi_enable_scp_clk (dsi); +#define DUMPREG (r) seq_printf(s, "%-35s %08x\n", #r, dsi_read_reg(dsi, r))DUMPREG (DSI_REVISION );DUMPREG (DSI_SYSCONFIG );DUMPREG (DSI_SYSSTATUS );@@ -1699,25 +1687,11 @@ static void dsi_dump_dsi_regs(struct dsi_data *dsi, struct seq_file *s)DUMPREG (DSI_PLL_GO );DUMPREG (DSI_PLL_CONFIGURATION1 );DUMPREG (DSI_PLL_CONFIGURATION2 ); +#undef DUMPREGdsi_disable_scp_clk (dsi);dsi_runtime_put (dsi); -#undef DUMPREG -} - -static int dsi1_dump_regs (struct seq_file *s,void *p) -{ -struct dsi_data *dsi =dsi_get_dsi_from_id (0 ); -dsi_dump_dsi_regs (dsi, s); -return 0 ; -} - -static int dsi2_dump_regs (struct seq_file *s,void *p) -{ -struct dsi_data *dsi =dsi_get_dsi_from_id (1 ); - -dsi_dump_dsi_regs (dsi, s);return 0 ; }@@ -5305,6 +5279,7 @@ static int dsi_bind(struct device *dev, struct device *master, void *data)struct dsi_data *dsi;struct resource *dsi_mem;struct resource *res; +char name[10 ]; dsi =devm_kzalloc (dev,sizeof (*dsi),GFP_KERNEL );if (!dsi)@@ -5443,23 +5418,13 @@ static int dsi_bind(struct device *dev, struct device *master, void *data)dsi_runtime_put (dsi); -if (dsi->module_id ==0 ) - dsi->debugfs.regs =dss_debugfs_create_file (dss,"dsi1_regs" , - dsi1_dump_regs, - &dsi); -else - dsi->debugfs.regs =dss_debugfs_create_file (dss,"dsi2_regs" , - dsi2_dump_regs, - &dsi); +snprintf (name,sizeof (name),"dsi%u_regs" , dsi->module_id +1 ); + dsi->debugfs.regs =dss_debugfs_create_file (dss, name, + dsi_dump_dsi_regs, &dsi);#ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS -if (dsi->module_id ==0 ) - dsi->debugfs.irqs =dss_debugfs_create_file (dss,"dsi1_irqs" , - dsi1_dump_irqs, - &dsi); -else - dsi->debugfs.irqs =dss_debugfs_create_file (dss,"dsi2_irqs" , - dsi2_dump_irqs, - &dsi); +snprintf (name,sizeof (name),"dsi%u_irqs" , dsi->module_id +1 ); + dsi->debugfs.irqs =dss_debugfs_create_file (dss, name, + dsi_dump_dsi_irqs, &dsi);#endif return 0 ;Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 25/60 drm/omap: Move DSI debugfs clocks dump to dsi%u_clks files
In reply to Laurent PinchartThe DSI clocks are dumped in the DSS-level debugfs clocks file. This complicates the implementation as the DSI private data has to be looked up through the outputs list. Simplify it by creating two debugfs files, dsi1_clks and dsi2_clks, to dump the DSI clocks.
--- drivers/gpu/drm/omapdrm/dss/dsi.c | 43 ++++++++------------------------------- drivers/gpu/drm/omapdrm/dss/dss.c | 3 --- drivers/gpu/drm/omapdrm/dss/dss.h | 2 -- 3 files changed, 9 insertions(+), 39 deletions(-)
drivers/gpu/drm/omapdrm/dss/dsi.c +9 -34
@@ -403,6 +403,7 @@ struct dsi_data {struct {struct dss_debugfs_entry *irqs;struct dss_debugfs_entry *regs; +struct dss_debugfs_entry *clks; } debugfs;#ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS
@@ -442,27 +443,6 @@ static inline struct dsi_data *to_dsi_data(struct omap_dss_device *dssdev)return dev_get_drvdata (dssdev->dev); } -static struct dsi_data *dsi_get_dsi_from_id (int module) -{ -struct omap_dss_device *out; -enum omap_dss_output_id id; - -switch (module) { -case 0 : - id =OMAP_DSS_OUTPUT_DSI1 ; -break ; -case 1 : - id =OMAP_DSS_OUTPUT_DSI2 ; -break ; -default : -return NULL ; - } - - out =omap_dss_get_output (id); - -return out ?to_dsi_data (out) :NULL ; -} -static inline void dsi_write_reg (struct dsi_data *dsi,const struct dsi_reg idx,u32 val) {
@@ -1448,8 +1428,9 @@ static void dsi_pll_disable(struct dss_pll *pll)dsi_pll_uninit (dsi, true); } -static void dsi_dump_dsi_clocks (struct dsi_data *dsi,struct seq_file *s) +static int dsi_dump_dsi_clocks (struct seq_file *s,void *p) { +struct dsi_data *dsi = p;struct dss_pll_clock_info *cinfo = &dsi->pll.cinfo;enum dss_clk_source dispc_clk_src, dsi_clk_src;int dsi_module = dsi->module_id;
@@ -1459,7 +1440,7 @@ static void dsi_dump_dsi_clocks(struct dsi_data *dsi, struct seq_file *s) dsi_clk_src =dss_get_dsi_clk_source (dsi->dss, dsi_module);if (dsi_runtime_get (dsi)) -return ; +return 0 ;seq_printf (s,"- DSI%d PLL -\n" , dsi_module +1 );
@@ -1503,18 +1484,8 @@ static void dsi_dump_dsi_clocks(struct dsi_data *dsi, struct seq_file *s)seq_printf (s,"LP_CLK\t\t%lu\n" , dsi->current_lp_cinfo.lp_clk);dsi_runtime_put (dsi); -} - -void dsi_dump_clocks (struct seq_file *s) -{ -struct dsi_data *dsi; -int i; -for (i =0 ; i <MAX_NUM_DSI ; i++) { - dsi =dsi_get_dsi_from_id (i); -if (dsi) -dsi_dump_dsi_clocks (dsi, s); - } +return 0 ; }#ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS
@@ -5426,6 +5397,9 @@ static int dsi_bind(struct device *dev, struct device *master, void *data) dsi->debugfs.irqs =dss_debugfs_create_file (dss, name, dsi_dump_dsi_irqs, &dsi);#endif +snprintf (name,sizeof (name),"dsi%u_clks" , dsi->module_id +1 ); + dsi->debugfs.clks =dss_debugfs_create_file (dss, name, + dsi_dump_dsi_clocks, &dsi);return 0 ;
@@ -5442,6 +5416,7 @@ static void dsi_unbind(struct device *dev, struct device *master, void *data) {struct dsi_data *dsi =dev_get_drvdata (dev); +dss_debugfs_remove_file (dsi->debugfs.clks);dss_debugfs_remove_file (dsi->debugfs.irqs);dss_debugfs_remove_file (dsi->debugfs.regs);
drivers/gpu/drm/omapdrm/dss/dss.c +0 -3
@@ -394,9 +394,6 @@ static int dss_debug_dump_clocks(struct seq_file *s, void *p)dss_dump_clocks (dss, s);dispc_dump_clocks (dss->dispc, s); -#ifdef CONFIG_OMAP2_DSS_DSI -dsi_dump_clocks (s); -#endif return 0 ; }
drivers/gpu/drm/omapdrm/dss/dss.h +0 -2
@@ -373,8 +373,6 @@ static inline void sdi_uninit_port(struct device_node *port)#ifdef CONFIG_OMAP2_DSS_DSI -void dsi_dump_clocks (struct seq_file *s); -void dsi_irq_handler (void );#endif
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 25/60] drm/omap: Move DSI debugfs clocks dump to dsi%u_clks files
Hi,
Quoted 7 lines · Laurent Pinchart
The DSI clocks are dumped in the DSS-level debugfs clocks file. This complicates the implementation as the DSI private data has to be looked up through the outputs list. Simplify it by creating two debugfs files,
dsi1_clksanddsi2_clks, to dump the DSI clocks.Signed-off-by Laurent Pinchart <[email protected]>---
-- Sebastian
Quoted 139 lines
drivers/gpu/drm/omapdrm/dss/dsi.c | 43 ++++++++------------------------------- drivers/gpu/drm/omapdrm/dss/dss.c | 3 --- drivers/gpu/drm/omapdrm/dss/dss.h | 2 -- 3 files changed, 9 insertions(+), 39 deletions(-)drivers/gpu/drm/omapdrm/dss/dsi.c +9
-34@@ -403,6 +403,7 @@ struct dsi_data {struct {struct dss_debugfs_entry *irqs;struct dss_debugfs_entry *regs; +struct dss_debugfs_entry *clks; } debugfs;#ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS @@ -442,27 +443,6 @@ static inline struct dsi_data *to_dsi_data(struct omap_dss_device *dssdev)return dev_get_drvdata (dssdev->dev); } -static struct dsi_data *dsi_get_dsi_from_id (int module) -{ -struct omap_dss_device *out; -enum omap_dss_output_id id; - -switch (module) { -case 0 : - id =OMAP_DSS_OUTPUT_DSI1 ; -break ; -case 1 : - id =OMAP_DSS_OUTPUT_DSI2 ; -break ; -default : -return NULL ; - } - - out =omap_dss_get_output (id); - -return out ?to_dsi_data (out) :NULL ; -} -static inline void dsi_write_reg (struct dsi_data *dsi,const struct dsi_reg idx,u32 val) {@@ -1448,8 +1428,9 @@ static void dsi_pll_disable(struct dss_pll *pll)dsi_pll_uninit (dsi, true); } -static void dsi_dump_dsi_clocks (struct dsi_data *dsi,struct seq_file *s) +static int dsi_dump_dsi_clocks (struct seq_file *s,void *p) { +struct dsi_data *dsi = p;struct dss_pll_clock_info *cinfo = &dsi->pll.cinfo;enum dss_clk_source dispc_clk_src, dsi_clk_src;int dsi_module = dsi->module_id;@@ -1459,7 +1440,7 @@ static void dsi_dump_dsi_clocks(struct dsi_data *dsi, struct seq_file *s) dsi_clk_src =dss_get_dsi_clk_source (dsi->dss, dsi_module);if (dsi_runtime_get (dsi)) -return ; +return 0 ;seq_printf (s,"- DSI%d PLL -\n" , dsi_module +1 );@@ -1503,18 +1484,8 @@ static void dsi_dump_dsi_clocks(struct dsi_data *dsi, struct seq_file *s)seq_printf (s,"LP_CLK\t\t%lu\n" , dsi->current_lp_cinfo.lp_clk);dsi_runtime_put (dsi); -} - -void dsi_dump_clocks (struct seq_file *s) -{ -struct dsi_data *dsi; -int i; -for (i =0 ; i <MAX_NUM_DSI ; i++) { - dsi =dsi_get_dsi_from_id (i); -if (dsi) -dsi_dump_dsi_clocks (dsi, s); - } +return 0 ; }#ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS @@ -5426,6 +5397,9 @@ static int dsi_bind(struct device *dev, struct device *master, void *data) dsi->debugfs.irqs =dss_debugfs_create_file (dss, name, dsi_dump_dsi_irqs, &dsi);#endif +snprintf (name,sizeof (name),"dsi%u_clks" , dsi->module_id +1 ); + dsi->debugfs.clks =dss_debugfs_create_file (dss, name, + dsi_dump_dsi_clocks, &dsi);return 0 ;@@ -5442,6 +5416,7 @@ static void dsi_unbind(struct device *dev, struct device *master, void *data) {struct dsi_data *dsi =dev_get_drvdata (dev); +dss_debugfs_remove_file (dsi->debugfs.clks);dss_debugfs_remove_file (dsi->debugfs.irqs);dss_debugfs_remove_file (dsi->debugfs.regs);drivers/gpu/drm/omapdrm/dss/dss.c +0
-3@@ -394,9 +394,6 @@ static int dss_debug_dump_clocks(struct seq_file *s, void *p)dss_dump_clocks (dss, s);dispc_dump_clocks (dss->dispc, s); -#ifdef CONFIG_OMAP2_DSS_DSI -dsi_dump_clocks (s); -#endif return 0 ; }drivers/gpu/drm/omapdrm/dss/dss.h +0
-2@@ -373,8 +373,6 @@ static inline void sdi_uninit_port(struct device_node *port)#ifdef CONFIG_OMAP2_DSS_DSI -void dsi_dump_clocks (struct seq_file *s); -void dsi_irq_handler (void );#endif Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 26/60 drm/omap: dss: Remove output devices list
In reply to Laurent PinchartThe output devices list isn't used anymore, all output devices are accessed through the global devices list. Remove it.
--- drivers/gpu/drm/omapdrm/displays/encoder-opa362.c | 9 ++----- drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c | 8 ++---- .../gpu/drm/omapdrm/displays/encoder-tpd12s015.c | 8 ++---- drivers/gpu/drm/omapdrm/dss/base.c | 2 ++ drivers/gpu/drm/omapdrm/dss/dpi.c | 4 +-- drivers/gpu/drm/omapdrm/dss/dsi.c | 4 +-- drivers/gpu/drm/omapdrm/dss/hdmi4.c | 4 +-- drivers/gpu/drm/omapdrm/dss/hdmi5.c | 4 +-- drivers/gpu/drm/omapdrm/dss/omapdss.h | 5 ---- drivers/gpu/drm/omapdrm/dss/output.c | 29 ---------------------- drivers/gpu/drm/omapdrm/dss/sdi.c | 4 +-- drivers/gpu/drm/omapdrm/dss/venc.c | 4 +-- 12 files changed, 20 insertions(+), 65 deletions(-)
drivers/gpu/drm/omapdrm/displays/encoder-opa362.c +2 -7
@@ -146,7 +146,6 @@ static int opa362_probe(struct platform_device *pdev)struct panel_drv_data *ddata;struct omap_dss_device *dssdev;struct gpio_desc *gpio; -int r;dev_dbg (&pdev->dev,"probe\n" );
@@ -169,11 +168,7 @@ static int opa362_probe(struct platform_device *pdev) dssdev->output_type =OMAP_DISPLAY_TYPE_VENC ; dssdev->owner =THIS_MODULE ; - r =omapdss_register_output (dssdev); -if (r) { -dev_err (&pdev->dev,"Failed to register output\n" ); -return r; - } +omapdss_device_register (dssdev);return 0 ; }
@@ -183,7 +178,7 @@ static int __exit opa362_remove(struct platform_device *pdev)struct panel_drv_data *ddata =platform_get_drvdata (pdev);struct omap_dss_device *dssdev = &ddata->dssdev; -omapdss_unregister_output (&ddata->dssdev); +omapdss_device_unregister (&ddata->dssdev);WARN_ON (omapdss_device_is_enabled (dssdev));if (omapdss_device_is_enabled (dssdev))
drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c +2 -6
@@ -192,11 +192,7 @@ static int tfp410_probe(struct platform_device *pdev) dssdev->owner =THIS_MODULE ; dssdev->port_num =1 ; - r =omapdss_register_output (dssdev); -if (r) { -dev_err (&pdev->dev,"Failed to register output\n" ); -return r; - } +omapdss_device_register (dssdev);return 0 ; }
@@ -206,7 +202,7 @@ static int __exit tfp410_remove(struct platform_device *pdev)struct panel_drv_data *ddata =platform_get_drvdata (pdev);struct omap_dss_device *dssdev = &ddata->dssdev; -omapdss_unregister_output (&ddata->dssdev); +omapdss_device_unregister (&ddata->dssdev);WARN_ON (omapdss_device_is_enabled (dssdev));if (omapdss_device_is_enabled (dssdev))
drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c +2 -6
@@ -301,11 +301,7 @@ static int tpd_probe(struct platform_device *pdev) dssdev->owner =THIS_MODULE ; dssdev->port_num =1 ; - r =omapdss_register_output (dssdev); -if (r) { -dev_err (&pdev->dev,"Failed to register output\n" ); -return r; - } +omapdss_device_register (dssdev);return 0 ; }
@@ -315,7 +311,7 @@ static int __exit tpd_remove(struct platform_device *pdev)struct panel_drv_data *ddata =platform_get_drvdata (pdev);struct omap_dss_device *dssdev = &ddata->dssdev; -omapdss_unregister_output (&ddata->dssdev); +omapdss_device_unregister (&ddata->dssdev);WARN_ON (omapdss_device_is_enabled (dssdev));if (omapdss_device_is_enabled (dssdev))
drivers/gpu/drm/omapdrm/dss/base.c +2 -0
@@ -63,6 +63,7 @@ void omapdss_device_register(struct omap_dss_device *dssdev)list_add_tail (&dssdev->list, &omapdss_devices_list);mutex_unlock (&omapdss_devices_lock); } +EXPORT_SYMBOL_GPL (omapdss_device_register);void omapdss_device_unregister (struct omap_dss_device *dssdev) {
@@ -70,6 +71,7 @@ void omapdss_device_unregister(struct omap_dss_device *dssdev)list_del (&dssdev->list);mutex_unlock (&omapdss_devices_lock); } +EXPORT_SYMBOL_GPL (omapdss_device_unregister);static bool omapdss_device_is_registered (struct device_node *node) {
drivers/gpu/drm/omapdrm/dss/dpi.c +2 -2
@@ -718,7 +718,7 @@ static void dpi_init_output_port(struct dpi_data *dpi, struct device_node *port) out->ops = &dpi_ops; out->owner =THIS_MODULE ; -omapdss_register_output (out); +omapdss_device_register (out); }static void dpi_uninit_output_port (struct device_node *port)
@@ -726,7 +726,7 @@ static void dpi_uninit_output_port(struct device_node *port)struct dpi_data *dpi = port->data;struct omap_dss_device *out = &dpi->output; -omapdss_unregister_output (out); +omapdss_device_unregister (out); } int dpi_init_port(struct dss_device *dss, struct platform_device *pdev,
drivers/gpu/drm/omapdrm/dss/dsi.c +2 -2
@@ -4995,14 +4995,14 @@ static void dsi_init_output(struct dsi_data *dsi) out->ops = &dsi_ops; out->owner =THIS_MODULE ; -omapdss_register_output (out); +omapdss_device_register (out); }static void dsi_uninit_output (struct dsi_data *dsi) {struct omap_dss_device *out = &dsi->output; -omapdss_unregister_output (out); +omapdss_device_unregister (out); }static int dsi_probe_of (struct dsi_data *dsi)
drivers/gpu/drm/omapdrm/dss/hdmi4.c +2 -2
@@ -565,14 +565,14 @@ static void hdmi_init_output(struct omap_hdmi *hdmi) out->ops = &hdmi_ops; out->owner =THIS_MODULE ; -omapdss_register_output (out); +omapdss_device_register (out); }static void hdmi_uninit_output (struct omap_hdmi *hdmi) {struct omap_dss_device *out = &hdmi->output; -omapdss_unregister_output (out); +omapdss_device_unregister (out); }static int hdmi_probe_of (struct omap_hdmi *hdmi)
drivers/gpu/drm/omapdrm/dss/hdmi5.c +2 -2
@@ -556,14 +556,14 @@ static void hdmi_init_output(struct omap_hdmi *hdmi) out->ops = &hdmi_ops; out->owner =THIS_MODULE ; -omapdss_register_output (out); +omapdss_device_register (out); }static void hdmi_uninit_output (struct omap_hdmi *hdmi) {struct omap_dss_device *out = &hdmi->output; -omapdss_unregister_output (out); +omapdss_device_unregister (out); }static int hdmi_probe_of (struct omap_hdmi *hdmi)
drivers/gpu/drm/omapdrm/dss/omapdss.h +0 -5
@@ -416,8 +416,6 @@ struct omap_dss_device {/* OMAP DSS output specific fields */ -struct list_head output_list; -/* DISPC channel for this output */ enum omap_channel dispc_channel;bool dispc_channel_connected;
@@ -510,9 +508,6 @@ int omap_dss_get_num_overlay_managers(void);int omap_dss_get_num_overlays (void ); -int omapdss_register_output (struct omap_dss_device *output); -void omapdss_unregister_output (struct omap_dss_device *output); -struct omap_dss_device *omap_dss_get_output (enum omap_dss_output_id id);int omapdss_output_set_device (struct omap_dss_device *out,struct omap_dss_device *dssdev);int omapdss_output_unset_device (struct omap_dss_device *out);
drivers/gpu/drm/omapdrm/dss/output.c +0 -29
@@ -23,7 +23,6 @@#include "omapdss.h" -static LIST_HEAD (output_list);static DEFINE_MUTEX (output_lock); int omapdss_output_set_device(struct omap_dss_device *out,
@@ -88,34 +87,6 @@ int omapdss_output_unset_device(struct omap_dss_device *out) }EXPORT_SYMBOL (omapdss_output_unset_device); -int omapdss_register_output (struct omap_dss_device *out) -{ -list_add_tail (&out->output_list, &output_list); -omapdss_device_register (out); -return 0 ; -} -EXPORT_SYMBOL (omapdss_register_output); - -void omapdss_unregister_output (struct omap_dss_device *out) -{ -list_del (&out->output_list); -omapdss_device_unregister (out); -} -EXPORT_SYMBOL (omapdss_unregister_output); - -struct omap_dss_device *omap_dss_get_output (enum omap_dss_output_id id) -{ -struct omap_dss_device *out; - -list_for_each_entry (out, &output_list, output_list) { -if (out->id == id) -return out; - } - -return NULL ; -} -EXPORT_SYMBOL (omap_dss_get_output); -struct omap_dss_device *omapdss_find_output_from_display (struct omap_dss_device *dssdev) {while (dssdev->src)
drivers/gpu/drm/omapdrm/dss/sdi.c +2 -2
@@ -328,12 +328,12 @@ static void sdi_init_output(struct sdi_device *sdi) out->ops = &sdi_ops; out->owner =THIS_MODULE ; -omapdss_register_output (out); +omapdss_device_register (out); }static void sdi_uninit_output (struct sdi_device *sdi) { -omapdss_unregister_output (&sdi->output); +omapdss_device_unregister (&sdi->output); } int sdi_init_port(struct dss_device *dss, struct platform_device *pdev,
drivers/gpu/drm/omapdrm/dss/venc.c +2 -2
@@ -768,12 +768,12 @@ static void venc_init_output(struct venc_device *venc) out->ops = &venc_ops; out->owner =THIS_MODULE ; -omapdss_register_output (out); +omapdss_device_register (out); }static void venc_uninit_output (struct venc_device *venc) { -omapdss_unregister_output (&venc->output); +omapdss_device_unregister (&venc->output); }static int venc_probe_of (struct venc_device *venc)
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 26/60] drm/omap: dss: Remove output devices list
Hi,
Quoted 5 lines · Laurent Pinchart
The output devices list isn't used anymore, all output devices are accessed through the global devices list. Remove it.
Signed-off-by Laurent Pinchart <[email protected]>---
-- Sebastian
Quoted 322 lines
drivers/gpu/drm/omapdrm/displays/encoder-opa362.c | 9 ++----- drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c | 8 ++---- .../gpu/drm/omapdrm/displays/encoder-tpd12s015.c | 8 ++---- drivers/gpu/drm/omapdrm/dss/base.c | 2 ++ drivers/gpu/drm/omapdrm/dss/dpi.c | 4 +-- drivers/gpu/drm/omapdrm/dss/dsi.c | 4 +-- drivers/gpu/drm/omapdrm/dss/hdmi4.c | 4 +-- drivers/gpu/drm/omapdrm/dss/hdmi5.c | 4 +-- drivers/gpu/drm/omapdrm/dss/omapdss.h | 5 ---- drivers/gpu/drm/omapdrm/dss/output.c | 29 ---------------------- drivers/gpu/drm/omapdrm/dss/sdi.c | 4 +-- drivers/gpu/drm/omapdrm/dss/venc.c | 4 +-- 12 files changed, 20 insertions(+), 65 deletions(-)drivers/gpu/drm/omapdrm/displays/encoder-opa362.c +2
-7@@ -146,7 +146,6 @@ static int opa362_probe(struct platform_device *pdev)struct panel_drv_data *ddata;struct omap_dss_device *dssdev;struct gpio_desc *gpio; -int r;dev_dbg (&pdev->dev,"probe\n" );@@ -169,11 +168,7 @@ static int opa362_probe(struct platform_device *pdev) dssdev->output_type =OMAP_DISPLAY_TYPE_VENC ; dssdev->owner =THIS_MODULE ; - r =omapdss_register_output (dssdev); -if (r) { -dev_err (&pdev->dev,"Failed to register output\n" ); -return r; - } +omapdss_device_register (dssdev);return 0 ; }@@ -183,7 +178,7 @@ static int __exit opa362_remove(struct platform_device *pdev)struct panel_drv_data *ddata =platform_get_drvdata (pdev);struct omap_dss_device *dssdev = &ddata->dssdev; -omapdss_unregister_output (&ddata->dssdev); +omapdss_device_unregister (&ddata->dssdev);WARN_ON (omapdss_device_is_enabled (dssdev));if (omapdss_device_is_enabled (dssdev))drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c +2
-6@@ -192,11 +192,7 @@ static int tfp410_probe(struct platform_device *pdev) dssdev->owner =THIS_MODULE ; dssdev->port_num =1 ; - r =omapdss_register_output (dssdev); -if (r) { -dev_err (&pdev->dev,"Failed to register output\n" ); -return r; - } +omapdss_device_register (dssdev);return 0 ; }@@ -206,7 +202,7 @@ static int __exit tfp410_remove(struct platform_device *pdev)struct panel_drv_data *ddata =platform_get_drvdata (pdev);struct omap_dss_device *dssdev = &ddata->dssdev; -omapdss_unregister_output (&ddata->dssdev); +omapdss_device_unregister (&ddata->dssdev);WARN_ON (omapdss_device_is_enabled (dssdev));if (omapdss_device_is_enabled (dssdev))drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c +2
-6@@ -301,11 +301,7 @@ static int tpd_probe(struct platform_device *pdev) dssdev->owner =THIS_MODULE ; dssdev->port_num =1 ; - r =omapdss_register_output (dssdev); -if (r) { -dev_err (&pdev->dev,"Failed to register output\n" ); -return r; - } +omapdss_device_register (dssdev);return 0 ; }@@ -315,7 +311,7 @@ static int __exit tpd_remove(struct platform_device *pdev)struct panel_drv_data *ddata =platform_get_drvdata (pdev);struct omap_dss_device *dssdev = &ddata->dssdev; -omapdss_unregister_output (&ddata->dssdev); +omapdss_device_unregister (&ddata->dssdev);WARN_ON (omapdss_device_is_enabled (dssdev));if (omapdss_device_is_enabled (dssdev))drivers/gpu/drm/omapdrm/dss/base.c +2
-0@@ -63,6 +63,7 @@ void omapdss_device_register(struct omap_dss_device *dssdev)list_add_tail (&dssdev->list, &omapdss_devices_list);mutex_unlock (&omapdss_devices_lock); } +EXPORT_SYMBOL_GPL (omapdss_device_register);void omapdss_device_unregister (struct omap_dss_device *dssdev) {@@ -70,6 +71,7 @@ void omapdss_device_unregister(struct omap_dss_device *dssdev)list_del (&dssdev->list);mutex_unlock (&omapdss_devices_lock); } +EXPORT_SYMBOL_GPL (omapdss_device_unregister);static bool omapdss_device_is_registered (struct device_node *node) {drivers/gpu/drm/omapdrm/dss/dpi.c +2
-2@@ -718,7 +718,7 @@ static void dpi_init_output_port(struct dpi_data *dpi, struct device_node *port) out->ops = &dpi_ops; out->owner =THIS_MODULE ; -omapdss_register_output (out); +omapdss_device_register (out); }static void dpi_uninit_output_port (struct device_node *port)@@ -726,7 +726,7 @@ static void dpi_uninit_output_port(struct device_node *port)struct dpi_data *dpi = port->data;struct omap_dss_device *out = &dpi->output; -omapdss_unregister_output (out); +omapdss_device_unregister (out); } int dpi_init_port(struct dss_device *dss, struct platform_device *pdev,drivers/gpu/drm/omapdrm/dss/dsi.c +2
-2@@ -4995,14 +4995,14 @@ static void dsi_init_output(struct dsi_data *dsi) out->ops = &dsi_ops; out->owner =THIS_MODULE ; -omapdss_register_output (out); +omapdss_device_register (out); }static void dsi_uninit_output (struct dsi_data *dsi) {struct omap_dss_device *out = &dsi->output; -omapdss_unregister_output (out); +omapdss_device_unregister (out); }static int dsi_probe_of (struct dsi_data *dsi)drivers/gpu/drm/omapdrm/dss/hdmi4.c +2
-2@@ -565,14 +565,14 @@ static void hdmi_init_output(struct omap_hdmi *hdmi) out->ops = &hdmi_ops; out->owner =THIS_MODULE ; -omapdss_register_output (out); +omapdss_device_register (out); }static void hdmi_uninit_output (struct omap_hdmi *hdmi) {struct omap_dss_device *out = &hdmi->output; -omapdss_unregister_output (out); +omapdss_device_unregister (out); }static int hdmi_probe_of (struct omap_hdmi *hdmi)drivers/gpu/drm/omapdrm/dss/hdmi5.c +2
-2@@ -556,14 +556,14 @@ static void hdmi_init_output(struct omap_hdmi *hdmi) out->ops = &hdmi_ops; out->owner =THIS_MODULE ; -omapdss_register_output (out); +omapdss_device_register (out); }static void hdmi_uninit_output (struct omap_hdmi *hdmi) {struct omap_dss_device *out = &hdmi->output; -omapdss_unregister_output (out); +omapdss_device_unregister (out); }static int hdmi_probe_of (struct omap_hdmi *hdmi)drivers/gpu/drm/omapdrm/dss/omapdss.h +0
-5@@ -416,8 +416,6 @@ struct omap_dss_device {/* OMAP DSS output specific fields */ -struct list_head output_list; -/* DISPC channel for this output */ enum omap_channel dispc_channel;bool dispc_channel_connected;@@ -510,9 +508,6 @@ int omap_dss_get_num_overlay_managers(void);int omap_dss_get_num_overlays (void ); -int omapdss_register_output (struct omap_dss_device *output); -void omapdss_unregister_output (struct omap_dss_device *output); -struct omap_dss_device *omap_dss_get_output (enum omap_dss_output_id id);int omapdss_output_set_device (struct omap_dss_device *out,struct omap_dss_device *dssdev);int omapdss_output_unset_device (struct omap_dss_device *out);drivers/gpu/drm/omapdrm/dss/output.c +0
-29@@ -23,7 +23,6 @@#include "omapdss.h" -static LIST_HEAD (output_list);static DEFINE_MUTEX (output_lock); int omapdss_output_set_device(struct omap_dss_device *out,@@ -88,34 +87,6 @@ int omapdss_output_unset_device(struct omap_dss_device *out) }EXPORT_SYMBOL (omapdss_output_unset_device); -int omapdss_register_output (struct omap_dss_device *out) -{ -list_add_tail (&out->output_list, &output_list); -omapdss_device_register (out); -return 0 ; -} -EXPORT_SYMBOL (omapdss_register_output); - -void omapdss_unregister_output (struct omap_dss_device *out) -{ -list_del (&out->output_list); -omapdss_device_unregister (out); -} -EXPORT_SYMBOL (omapdss_unregister_output); - -struct omap_dss_device *omap_dss_get_output (enum omap_dss_output_id id) -{ -struct omap_dss_device *out; - -list_for_each_entry (out, &output_list, output_list) { -if (out->id == id) -return out; - } - -return NULL ; -} -EXPORT_SYMBOL (omap_dss_get_output); -struct omap_dss_device *omapdss_find_output_from_display (struct omap_dss_device *dssdev) {while (dssdev->src)drivers/gpu/drm/omapdrm/dss/sdi.c +2
-2@@ -328,12 +328,12 @@ static void sdi_init_output(struct sdi_device *sdi) out->ops = &sdi_ops; out->owner =THIS_MODULE ; -omapdss_register_output (out); +omapdss_device_register (out); }static void sdi_uninit_output (struct sdi_device *sdi) { -omapdss_unregister_output (&sdi->output); +omapdss_device_unregister (&sdi->output); } int sdi_init_port(struct dss_device *dss, struct platform_device *pdev,drivers/gpu/drm/omapdrm/dss/venc.c +2
-2@@ -768,12 +768,12 @@ static void venc_init_output(struct venc_device *venc) out->ops = &venc_ops; out->owner =THIS_MODULE ; -omapdss_register_output (out); +omapdss_device_register (out); }static void venc_uninit_output (struct venc_device *venc) { -omapdss_unregister_output (&venc->output); +omapdss_device_unregister (&venc->output); }static int venc_probe_of (struct venc_device *venc)Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel