omapdrm: Merge omapdrm and omapdss
Subsystems (3)
cover omapdrm: Merge omapdrm and omapdss
Hello,
This patch series merges the omapdrm and omapdss drivers into a single driver called omapdrm. The split in two drivers was historical, in order to support the FBDEV, V4L2 and DRM/KMS APIs. Now that the driver supports DRM/KMS only there's no need to keep two seperate drivers.
The series starts with a few cleanups (01/48 to 03/48) and quickly proceeds to merging the omapdss and omapdss-base modules (04/48). It then prepares the omapdss code (05/48 to 08/48), perform a few more cleanups (09/48 to 11/48) and prepares the omapdrm code (12/48).
Patches 13/48 to 19/48 prepare the connector, encoder and panel drivers. All those drivers defer probing when their video source can't be found at probe time. This would cause endless probe deferral when merging omapdrm and omapdss as the drivers need omapdss to be fully initialized to probe successfully, but cause omapdrm to defer probing when they're not available.
Patch 20/48 merges the omapdrm and omapdss drivers.
The next patches are added bonuses that start removal of global variables from the driver. The code relies heavily on global variables for objects that are instance-specific, and should thus be dynamically allocated. Most of the patches change internal APIs to pass objects to driver functions (21/48 to 28/48, 36/48, 39/48 to 41/38, 43/48 to 45/48) with a few miscellaneous cleanups (29/48, 35/48, 37/48, 38/48, 42/48). Patches 30/48 to 34/48 and 46/48 then allocate instance objects dynamically to replace global variables, and patches 47/48 and 48/48 move global variables to existing instance objects.
The series has been tested on a Pandaboard with the DVI and HDMI output.
Laurent Pinchart (48):
drm: omapdrm: dpi: Don't treat GPIO probe deferral as an error
drm: omapdrm: Pass drm_device to omap_gem_resume()
drm: omapdrm: Remove unused omap_dss_find_device() function
drm: omapdrm: Merge the omapdss and omapdss-base modules
drm: omapdrm: dss: Set the DMA coherent mask
drm: omapdrm: dss: Make dss_dump_clocks() function static
drm: omapdrm: dpi: Remove dpi_data port_initialized field
drm: omapdrm: venc: Return error code on OF parsing failure
drm: omapdrm: Deconstruct the omap_drv.h header.
drm: omapdrm: Use kernel integer types
drm: omapdrm: Use unsigned int type
drm: omapdrm: Split init and cleanup from probe and remove functions
drm: omapdrm: connector-analog-tv: Remove tvc_of_match forward
declaration
drm: omapdrm: displays: Remove OF node check in connector drivers
drm: omapdrm: displays: Remove OF node check in encoder drivers
drm: omapdrm: displays: Remove OF node check in panel drivers
drm: omapdrm: displays: Get connector source at connect time
drm: omapdrm: displays: Get panel source at connect time
drm: omapdrm: displays: Get encoder source at connect time
drm: omapdrm: Merge the omapdrm and omapdss drivers
drm: omapdrm: dss: Support passing private data to debugfs show
handlers
drm: omapdrm: dss: Pass DSS private structure to runtime PM functions
drm: omapdrm: dss: Pass PLL pointer to dss_ctrl_pll_enable()
drm: omapdrm: sdi: Pass DSS pointer to dss_sdi_*() functions
drm: omapdrm: dss: Pass DSS pointer to dss_ops operations
drm: omapdrm: dss: Pass DSS pointer to dss_get_*_clk_source()
drm: omapdrm: dss: Pass DSS pointer to dss clock functions
drm: omapdrm: dss: Pass DSS pointer to remaining dss functions
drm: omapdrm: dss: Remove dss_get_hdmi_venc_clk_source() function
drm: omapdrm: dss: Allocate the DSS private data structure dynamically
drm: omapdrm: hdmi4: Allocate the omap_hdmi data structure dynamically
drm: omapdrm: hdmi5: Allocate the omap_hdmi data structure dynamically
drm: omapdrm: venc: Allocate the venc private data structure
dynamically
drm: omapdrm: sdi: Allocate the sdi private data structure dynamically
drm: omapdrm: dsi: Make wait_for_bit_change() return a status
drm: omapdrm: dsi: Pass the dsi_data pointer to internal functions
drm: omapdrm: dsi: Combine two commonly used inline functions
drm: omapdrm: dsi: Use dev pointer directly in dsi_bind() function
drm: omapdrm: dsi: Store the struct device pointer in struct dsi_data
drm: omapdrm: dsi: Don't pass channel to dispc init/uninit functions
drm: omapdrm: dss: Pass omap_dss_device pointer to dss_mgr_*()
functions
drm: omapdrm: dss: Remove unused functions prototypes
drm: omapdrm: dss: Pass omap_drm_private pointer to dss_mgr_ops
drm: omapdrm: dispc: Pass DISPC pointer to dispc_ops operations
drm: omapdrm: dispc: Pass DISPC pointer to remaining dispc API
functions
drm: omapdrm: dispc: Allocate the dispc private data structure
dynamically
drm: omapdrm: dss: Store the debugfs root directory in struct
dss_device
drm: omapdrm: dss: Store the registered plls array in struct
dss_device
drivers/gpu/drm/omapdrm/Kconfig | 5 +- drivers/gpu/drm/omapdrm/Makefile | 25 + .../gpu/drm/omapdrm/displays/connector-analog-tv.c | 50 +- drivers/gpu/drm/omapdrm/displays/connector-dvi.c | 34 +- drivers/gpu/drm/omapdrm/displays/connector-hdmi.c | 40 +- drivers/gpu/drm/omapdrm/displays/encoder-opa362.c | 40 +- drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c | 42 +- .../gpu/drm/omapdrm/displays/encoder-tpd12s015.c | 69 +- drivers/gpu/drm/omapdrm/displays/panel-dpi.c | 38 +- drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 38 +- .../omapdrm/displays/panel-lgphilips-lb035q02.c | 38 +- .../drm/omapdrm/displays/panel-nec-nl8048hl11.c | 42 +- .../drm/omapdrm/displays/panel-sharp-ls037v7dw01.c | 38 +- .../drm/omapdrm/displays/panel-sony-acx565akm.c | 35 +- .../drm/omapdrm/displays/panel-tpo-td028ttec1.c | 49 +- .../drm/omapdrm/displays/panel-tpo-td043mtea1.c | 32 +- drivers/gpu/drm/omapdrm/dss/Kconfig | 16 - drivers/gpu/drm/omapdrm/dss/Makefile | 18 - drivers/gpu/drm/omapdrm/dss/base.c | 20 - drivers/gpu/drm/omapdrm/dss/core.c | 14 +- drivers/gpu/drm/omapdrm/dss/dispc.c | 2191 +++++++++++--------- drivers/gpu/drm/omapdrm/dss/display.c | 16 - drivers/gpu/drm/omapdrm/dss/dpi.c | 98 +- drivers/gpu/drm/omapdrm/dss/dsi.c | 1554 +++++++------- drivers/gpu/drm/omapdrm/dss/dss-of.c | 2 - drivers/gpu/drm/omapdrm/dss/dss.c | 722 ++++--- drivers/gpu/drm/omapdrm/dss/dss.h | 248 ++- drivers/gpu/drm/omapdrm/dss/hdmi.h | 11 +- drivers/gpu/drm/omapdrm/dss/hdmi4.c | 375 ++-- drivers/gpu/drm/omapdrm/dss/hdmi4_cec.c | 4 +- drivers/gpu/drm/omapdrm/dss/hdmi4_core.h | 4 +- drivers/gpu/drm/omapdrm/dss/hdmi5.c | 383 ++-- drivers/gpu/drm/omapdrm/dss/hdmi5_core.c | 24 +- drivers/gpu/drm/omapdrm/dss/hdmi_phy.c | 2 +- drivers/gpu/drm/omapdrm/dss/hdmi_pll.c | 15 +- drivers/gpu/drm/omapdrm/dss/hdmi_wp.c | 2 +- drivers/gpu/drm/omapdrm/dss/omapdss.h | 166 +- drivers/gpu/drm/omapdrm/dss/output.c | 61 +- drivers/gpu/drm/omapdrm/dss/pll.c | 44 +- drivers/gpu/drm/omapdrm/dss/sdi.c | 163 +- drivers/gpu/drm/omapdrm/dss/venc.c | 457 ++-- drivers/gpu/drm/omapdrm/dss/video-pll.c | 19 +- drivers/gpu/drm/omapdrm/omap_connector.h | 37 + drivers/gpu/drm/omapdrm/omap_crtc.c | 70 +- drivers/gpu/drm/omapdrm/omap_crtc.h | 43 + drivers/gpu/drm/omapdrm/omap_dmm_priv.h | 10 +- drivers/gpu/drm/omapdrm/omap_dmm_tiler.c | 58 +- drivers/gpu/drm/omapdrm/omap_dmm_tiler.h | 25 +- drivers/gpu/drm/omapdrm/omap_drv.c | 101 +- drivers/gpu/drm/omapdrm/omap_drv.h | 146 +- drivers/gpu/drm/omapdrm/omap_encoder.h | 33 + drivers/gpu/drm/omapdrm/omap_fb.c | 18 +- drivers/gpu/drm/omapdrm/omap_fb.h | 46 + drivers/gpu/drm/omapdrm/omap_fbdev.h | 39 + drivers/gpu/drm/omapdrm/omap_gem.c | 48 +- drivers/gpu/drm/omapdrm/omap_gem.h | 99 + drivers/gpu/drm/omapdrm/omap_irq.c | 38 +- drivers/gpu/drm/omapdrm/omap_irq.h | 39 + drivers/gpu/drm/omapdrm/omap_plane.c | 16 +- drivers/gpu/drm/omapdrm/omap_plane.h | 37 + drivers/gpu/drm/omapdrm/tcm-sita.c | 12 +- drivers/gpu/drm/omapdrm/tcm.h | 4 +- 62 files changed, 4293 insertions(+), 3870 deletions(-) create mode 100644 drivers/gpu/drm/omapdrm/omap_connector.h create mode 100644 drivers/gpu/drm/omapdrm/omap_crtc.h create mode 100644 drivers/gpu/drm/omapdrm/omap_encoder.h create mode 100644 drivers/gpu/drm/omapdrm/omap_fb.h create mode 100644 drivers/gpu/drm/omapdrm/omap_fbdev.h create mode 100644 drivers/gpu/drm/omapdrm/omap_gem.h create mode 100644 drivers/gpu/drm/omapdrm/omap_irq.h create mode 100644 drivers/gpu/drm/omapdrm/omap_plane.h
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 1/48 drm: omapdrm: dpi: Don't treat GPIO probe deferral as an error
There's no need to print an error message on probe deferral, that's a normal situation. Probe deferral debugging can be performed by enabling the related debug messages in the drivers core.
--- drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c +2 -1
@@ -173,7 +173,8 @@ static int tfp410_probe_of(struct platform_device *pdev)if (gpio_is_valid (gpio) || gpio == -ENOENT ) { ddata->pd_gpio = gpio; }else { -dev_err (&pdev->dev,"failed to parse PD gpio\n" ); +if (gpio != -EPROBE_DEFER ) +dev_err (&pdev->dev,"failed to parse PD gpio\n" );return gpio; }
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 01/48] drm: omapdrm: dpi: Don't treat GPIO probe deferral as an error
Hi,
Quoted 14 lines · Laurent Pinchart
There's no need to print an error message on probe deferral, that's a normal situation. Probe deferral debugging can be performed by enabling the related debug messages in the drivers core.
Signed-off-by Laurent Pinchart <[email protected]>--- drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c +0
-0
drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c static int tfp410_probe_of(struct platform_device *pdev) · line 179
Quoted 8 lines
drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c +2
-1@@ -173,7 +173,8 @@ static int tfp410_probe_of(struct platform_device *pdev)if (gpio_is_valid (gpio) || gpio == -ENOENT ) { ddata->pd_gpio = gpio; }else { -dev_err (&pdev->dev,"failed to parse PD gpio\n" ); +if (gpio != -EPROBE_DEFER ) +dev_err (&pdev->dev,"failed to parse PD gpio\n" );return gpio; }
-- Sebastian
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 2/48 drm: omapdrm: Pass drm_device to omap_gem_resume()
In reply to Laurent PinchartThe omap_gem_resume() function is internal to the driver. Pass it a drm_device pointer that the caller already has instead of looking it up from device data.
--- drivers/gpu/drm/omapdrm/omap_drv.c | 2 +- drivers/gpu/drm/omapdrm/omap_drv.h | 2 +- drivers/gpu/drm/omapdrm/omap_gem.c | 7 +++---- 3 files changed, 5 insertions(+), 6 deletions(-)
drivers/gpu/drm/omapdrm/omap_drv.c +1 -1
@@ -740,7 +740,7 @@ static int omap_drm_resume(struct device *dev)drm_kms_helper_poll_enable (drm_dev); - return omap_gem_resume(dev); + return omap_gem_resume(drm_dev); }#endif
drivers/gpu/drm/omapdrm/omap_drv.h +1 -1
@@ -94,7 +94,7 @@ void omap_gem_describe_objects(struct list_head *list, struct seq_file *m);#endif #ifdef CONFIG_PM -int omap_gem_resume (struct device *dev); +int omap_gem_resume (struct drm_device *dev);#endif int omap_irq_enable_vblank (struct drm_crtc *crtc);
drivers/gpu/drm/omapdrm/omap_gem.c +3 -4
@@ -996,10 +996,9 @@ void *omap_gem_vaddr(struct drm_gem_object *obj)#ifdef CONFIG_PM /* re-pin objects in DMM in resume path: */ -int omap_gem_resume (struct device *dev) +int omap_gem_resume (struct drm_device *dev) { -struct drm_device *drm_dev =dev_get_drvdata (dev); -struct omap_drm_private *priv = drm_dev->dev_private; +struct omap_drm_private *priv = dev->dev_private;struct omap_gem_object *omap_obj;int ret =0 ;
@@ -1012,7 +1011,7 @@ int omap_gem_resume(struct device *dev) omap_obj->pages, npages, omap_obj->roll, true);if (ret) { -dev_err (dev,"could not repin: %d\n" , ret); +dev_err (dev->dev,"could not repin: %d\n" , ret);return ret; } }
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 02/48] drm: omapdrm: Pass drm_device to omap_gem_resume()
Hi,
Quoted 5 lines · Laurent Pinchart
The
omap_gem_resume()function is internal to the driver. Pass it adrm_devicepointer that the caller already has instead of looking it up from device data.Signed-off-by Laurent Pinchart <[email protected]>
-- Sebastian
Quoted 67 lines
--- drivers/gpu/drm/omapdrm/omap_drv.c | 2 +- drivers/gpu/drm/omapdrm/omap_drv.h | 2 +- drivers/gpu/drm/omapdrm/omap_gem.c | 7 +++---- 3 files changed, 5 insertions(+), 6 deletions(-)drivers/gpu/drm/omapdrm/omap_drv.c +1
-1@@ -740,7 +740,7 @@ static int omap_drm_resume(struct device *dev)drm_kms_helper_poll_enable (drm_dev); - return omap_gem_resume(dev); + return omap_gem_resume(drm_dev); }#endif drivers/gpu/drm/omapdrm/omap_drv.h +1
-1@@ -94,7 +94,7 @@ void omap_gem_describe_objects(struct list_head *list, struct seq_file *m);#endif #ifdef CONFIG_PM -int omap_gem_resume (struct device *dev); +int omap_gem_resume (struct drm_device *dev);#endif int omap_irq_enable_vblank (struct drm_crtc *crtc);drivers/gpu/drm/omapdrm/omap_gem.c +3
-4@@ -996,10 +996,9 @@ void *omap_gem_vaddr(struct drm_gem_object *obj)#ifdef CONFIG_PM /* re-pin objects in DMM in resume path: */ -int omap_gem_resume (struct device *dev) +int omap_gem_resume (struct drm_device *dev) { -struct drm_device *drm_dev =dev_get_drvdata (dev); -struct omap_drm_private *priv = drm_dev->dev_private; +struct omap_drm_private *priv = dev->dev_private;struct omap_gem_object *omap_obj;int ret =0 ;@@ -1012,7 +1011,7 @@ int omap_gem_resume(struct device *dev) omap_obj->pages, npages, omap_obj->roll, true);if (ret) { -dev_err (dev,"could not repin: %d\n" , ret); +dev_err (dev->dev,"could not repin: %d\n" , ret);return ret; } }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 3/48 drm: omapdrm: Remove unused omap_dss_find_device() function
In reply to Laurent PinchartThe omap_dss_find_device() function is unused. Remove it.
--- drivers/gpu/drm/omapdrm/dss/display.c | 14 -------------- drivers/gpu/drm/omapdrm/dss/omapdss.h | 3 --- 2 files changed, 17 deletions(-)
drivers/gpu/drm/omapdrm/dss/display.c +0 -14
@@ -175,17 +175,3 @@ struct omap_dss_device *omap_dss_get_next_device(struct omap_dss_device *from)return dssdev; }EXPORT_SYMBOL (omap_dss_get_next_device); - -struct omap_dss_device *omap_dss_find_device (void *data, -int (*match)(struct omap_dss_device *dssdev,void *data)) -{ -struct omap_dss_device *dssdev =NULL ; - -while ((dssdev =omap_dss_get_next_device (dssdev)) !=NULL ) { -if (match (dssdev, data)) -return dssdev; - } - -return NULL ; -} -EXPORT_SYMBOL (omap_dss_find_device);
drivers/gpu/drm/omapdrm/dss/omapdss.h +0 -3
@@ -595,9 +595,6 @@ 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)struct omap_dss_device *omap_dss_get_next_device (struct omap_dss_device *from); -struct omap_dss_device *omap_dss_find_device (void *data, -int (*match)(struct omap_dss_device *dssdev,void *data)); -int omap_dss_get_num_overlay_managers (void );
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 03/48] drm: omapdrm: Remove unused omap_dss_find_device() function
Hi,
Quoted 3 lines · Laurent Pinchart
The
omap_dss_find_device()function is unused. Remove it.Signed-off-by Laurent Pinchart <[email protected]>
-- Sebastian
Quoted 50 lines
--- drivers/gpu/drm/omapdrm/dss/display.c | 14 -------------- drivers/gpu/drm/omapdrm/dss/omapdss.h | 3 --- 2 files changed, 17 deletions(-)drivers/gpu/drm/omapdrm/dss/display.c +0
-14@@ -175,17 +175,3 @@ struct omap_dss_device *omap_dss_get_next_device(struct omap_dss_device *from)return dssdev; }EXPORT_SYMBOL (omap_dss_get_next_device); - -struct omap_dss_device *omap_dss_find_device (void *data, -int (*match)(struct omap_dss_device *dssdev,void *data)) -{ -struct omap_dss_device *dssdev =NULL ; - -while ((dssdev =omap_dss_get_next_device (dssdev)) !=NULL ) { -if (match (dssdev, data)) -return dssdev; - } - -return NULL ; -} -EXPORT_SYMBOL (omap_dss_find_device);drivers/gpu/drm/omapdrm/dss/omapdss.h +0
-3@@ -595,9 +595,6 @@ 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)struct omap_dss_device *omap_dss_get_next_device (struct omap_dss_device *from); -struct omap_dss_device *omap_dss_find_device (void *data, -int (*match)(struct omap_dss_device *dssdev,void *data)); -int omap_dss_get_num_overlay_managers (void );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 4/48 drm: omapdrm: Merge the omapdss and omapdss-base modules
In reply to Laurent PinchartThere's no need for the omapdss-base code to be part of a separate module. Merge it with the omapdss module. This allows removing the exports for internal symbols.
--- drivers/gpu/drm/omapdrm/dss/Kconfig | 4 ---- drivers/gpu/drm/omapdrm/dss/Makefile | 19 +++++++++++++------ drivers/gpu/drm/omapdrm/dss/base.c | 7 ------- drivers/gpu/drm/omapdrm/dss/display.c | 2 -- drivers/gpu/drm/omapdrm/dss/dss-of.c | 2 -- drivers/gpu/drm/omapdrm/dss/output.c | 14 -------------- 6 files changed, 13 insertions(+), 35 deletions(-)
drivers/gpu/drm/omapdrm/dss/Kconfig +0 -4
@@ -1,12 +1,8 @@ config OMAP2_DSS_INIT bool -config OMAP_DSS_BASE - tristate - menuconfig OMAP2_DSS tristate "OMAP2+ Display Subsystem support" - select OMAP_DSS_BASE select VIDEOMODE_HELPERS select OMAP2_DSS_INIT select HDMI
drivers/gpu/drm/omapdrm/dss/Makefile +13 -6
@@ -1,12 +1,19 @@ obj-$(CONFIG_OMAP2_DSS_INIT) += omapdss-boot-init.o - -obj-$(CONFIG_OMAP_DSS_BASE) += omapdss-base.o -omapdss-base-y := base.o display.o dss-of.o output.o - obj-$(CONFIG_OMAP2_DSS) += omapdss.o + # Core DSS files -omapdss-y := core.o dss.o dispc.o dispc_coefs.o \ - pll.o video-pll.o +omapdss-y := \ + base.o \ + display.o \ + dss-of.o \ + output.o \ + core.o \ + dss.o \ + dispc.o \ + dispc_coefs.o \ + pll.o \ + video-pll.o + omapdss-$(CONFIG_OMAP2_DSS_DPI) += dpi.o omapdss-$(CONFIG_OMAP2_DSS_VENC) += venc.o omapdss-$(CONFIG_OMAP2_DSS_SDI) += sdi.o
drivers/gpu/drm/omapdrm/dss/base.c +0 -7
@@ -20,7 +20,6 @@ void omapdss_set_is_initialized(bool set) { dss_initialized = set; } -EXPORT_SYMBOL (omapdss_set_is_initialized);bool omapdss_is_initialized (void ) {
@@ -32,7 +31,6 @@ void dispc_set_ops(const struct dispc_ops *o) { ops = o; } -EXPORT_SYMBOL (dispc_set_ops);const struct dispc_ops *dispc_get_ops (void ) {
@@ -108,7 +106,6 @@ void omapdss_gather_components(struct device *dev)omapdss_walk_device (dev, child, true); } } -EXPORT_SYMBOL (omapdss_gather_components);static bool omapdss_component_is_loaded (struct omapdss_comp_node *comp) {
@@ -134,7 +131,3 @@ bool omapdss_stack_is_ready(void)return true; }EXPORT_SYMBOL (omapdss_stack_is_ready); - -MODULE_AUTHOR ("Tomi Valkeinen <[email protected]>" ); -MODULE_DESCRIPTION ("OMAP Display Subsystem Base" ); -MODULE_LICENSE ("GPL v2" );
drivers/gpu/drm/omapdrm/dss/display.c +0 -2
@@ -35,7 +35,6 @@ void omapdss_default_get_timings(struct omap_dss_device *dssdev, { *vm = dssdev->panel.vm; } -EXPORT_SYMBOL (omapdss_default_get_timings);static LIST_HEAD (panel_list);static DEFINE_MUTEX (panel_list_mutex);
@@ -104,7 +103,6 @@ bool omapdss_component_is_display(struct device_node *node)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) {
drivers/gpu/drm/omapdrm/dss/dss-of.c +0 -2
@@ -44,7 +44,6 @@ struct device_node *dss_of_port_get_parent_device(struct device_node *port)return NULL ; } -EXPORT_SYMBOL_GPL (dss_of_port_get_parent_device);u32 dss_of_port_get_port_number (struct device_node *port) {
@@ -57,7 +56,6 @@ u32 dss_of_port_get_port_number(struct device_node *port)return reg; } -EXPORT_SYMBOL_GPL (dss_of_port_get_port_number);struct omap_dss_device *omapdss_of_find_source_for_first_ep (struct device_node *node)
drivers/gpu/drm/omapdrm/dss/output.c +0 -14
@@ -58,7 +58,6 @@ int omapdss_output_set_device(struct omap_dss_device *out,return r; } -EXPORT_SYMBOL (omapdss_output_set_device);int omapdss_output_unset_device (struct omap_dss_device *out) {
@@ -92,7 +91,6 @@ int omapdss_output_unset_device(struct omap_dss_device *out)return r; } -EXPORT_SYMBOL (omapdss_output_unset_device);int omapdss_register_output (struct omap_dss_device *out) {
@@ -118,7 +116,6 @@ bool omapdss_component_is_output(struct device_node *node)return false; } -EXPORT_SYMBOL (omapdss_component_is_output);struct omap_dss_device *omap_dss_get_output (enum omap_dss_output_id id) {
@@ -131,7 +128,6 @@ struct omap_dss_device *omap_dss_get_output(enum omap_dss_output_id id)return NULL ; } -EXPORT_SYMBOL (omap_dss_get_output);struct omap_dss_device *omap_dss_find_output_by_port_node (struct device_node *port) {
@@ -156,7 +152,6 @@ struct omap_dss_device *omap_dss_find_output_by_port_node(struct device_node *poreturn NULL ; } -EXPORT_SYMBOL (omap_dss_find_output_by_port_node);struct omap_dss_device *omapdss_find_output_from_display (struct omap_dss_device *dssdev) {
@@ -194,56 +189,47 @@ int dss_mgr_connect(enum omap_channel channel, {return dss_mgr_ops->connect (channel, dst); } -EXPORT_SYMBOL (dss_mgr_connect);void dss_mgr_disconnect (enum omap_channel channel,struct omap_dss_device *dst) { dss_mgr_ops->disconnect (channel, dst); } -EXPORT_SYMBOL (dss_mgr_disconnect);void dss_mgr_set_timings (enum omap_channel channel,const struct videomode *vm) { dss_mgr_ops->set_timings (channel, vm); } -EXPORT_SYMBOL (dss_mgr_set_timings);void dss_mgr_set_lcd_config (enum omap_channel channel,const struct dss_lcd_mgr_config *config) { dss_mgr_ops->set_lcd_config (channel, config); } -EXPORT_SYMBOL (dss_mgr_set_lcd_config);int dss_mgr_enable (enum omap_channel channel) {return dss_mgr_ops->enable (channel); } -EXPORT_SYMBOL (dss_mgr_enable);void dss_mgr_disable (enum omap_channel channel) { dss_mgr_ops->disable (channel); } -EXPORT_SYMBOL (dss_mgr_disable);void dss_mgr_start_update (enum omap_channel channel) { dss_mgr_ops->start_update (channel); } -EXPORT_SYMBOL (dss_mgr_start_update);int dss_mgr_register_framedone_handler (enum omap_channel channel,void (*handler)(void *),void *data) {return dss_mgr_ops->register_framedone_handler (channel, handler, data); } -EXPORT_SYMBOL (dss_mgr_register_framedone_handler);void dss_mgr_unregister_framedone_handler (enum omap_channel channel,void (*handler)(void *),void *data) { dss_mgr_ops->unregister_framedone_handler (channel, handler, data); } -EXPORT_SYMBOL (dss_mgr_unregister_framedone_handler);
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 04/48] drm: omapdrm: Merge the omapdss and omapdss-base modules
Hi,
Quoted 48 lines · Laurent Pinchart
There's no need for the omapdss-base code to be part of a separate module. Merge it with the omapdss module. This allows removing the exports for internal symbols.
Signed-off-by Laurent Pinchart <[email protected]>--- drivers/gpu/drm/omapdrm/dss/Kconfig | 4 ---- drivers/gpu/drm/omapdrm/dss/Makefile | 19 +++++++++++++------ drivers/gpu/drm/omapdrm/dss/base.c | 7 ------- drivers/gpu/drm/omapdrm/dss/display.c | 2 -- drivers/gpu/drm/omapdrm/dss/dss-of.c | 2 -- drivers/gpu/drm/omapdrm/dss/output.c | 14 -------------- 6 files changed, 13 insertions(+), 35 deletions(-)drivers/gpu/drm/omapdrm/dss/Kconfig +0
-4@@ -1,12 +1,8 @@ config OMAP2_DSS_INIT bool -config OMAP_DSS_BASE - tristate - menuconfig OMAP2_DSS tristate "OMAP2+ Display Subsystem support" - select OMAP_DSS_BASE select VIDEOMODE_HELPERS select OMAP2_DSS_INIT select HDMIdrivers/gpu/drm/omapdrm/dss/Makefile +3
-6@@ -1,12 +1,19 @@ obj-$(CONFIG_OMAP2_DSS_INIT) += omapdss-boot-init.o - -obj-$(CONFIG_OMAP_DSS_BASE) += omapdss-base.o -omapdss-base-y := base.o display.o dss-of.o output.o - obj-$(CONFIG_OMAP2_DSS) += omapdss.o + # Core DSS files -omapdss-y := core.o dss.o dispc.o dispc_coefs.o \ - pll.o video-pll.o +omapdss-y := \ + base.o \
drivers/gpu/drm/omapdrm/dss/Makefile line 16
Quoted 10 lines
drivers/gpu/drm/omapdrm/dss/Makefile +10
-0+ display.o \ + dss-of.o \ + output.o \ + core.o \ + dss.o \ + dispc.o \ + dispc_coefs.o \ + pll.o \ + video-pll.o +
I guess it makes sense to sort this alphabetically, otherwise:
-- Sebastian
Quoted 189 lines
drivers/gpu/drm/omapdrm/dss/Makefile +0
-0omapdss-$(CONFIG_OMAP2_DSS_DPI) += dpi.o omapdss-$(CONFIG_OMAP2_DSS_VENC) += venc.o omapdss-$(CONFIG_OMAP2_DSS_SDI) += sdi.odrivers/gpu/drm/omapdrm/dss/base.c +0
-7@@ -20,7 +20,6 @@ void omapdss_set_is_initialized(bool set) { dss_initialized = set; } -EXPORT_SYMBOL (omapdss_set_is_initialized);bool omapdss_is_initialized (void ) {@@ -32,7 +31,6 @@ void dispc_set_ops(const struct dispc_ops *o) { ops = o; } -EXPORT_SYMBOL (dispc_set_ops);const struct dispc_ops *dispc_get_ops (void ) {@@ -108,7 +106,6 @@ void omapdss_gather_components(struct device *dev)omapdss_walk_device (dev, child, true); } } -EXPORT_SYMBOL (omapdss_gather_components);static bool omapdss_component_is_loaded (struct omapdss_comp_node *comp) {@@ -134,7 +131,3 @@ bool omapdss_stack_is_ready(void)return true; }EXPORT_SYMBOL (omapdss_stack_is_ready); - -MODULE_AUTHOR ("Tomi Valkeinen <[email protected]>" ); -MODULE_DESCRIPTION ("OMAP Display Subsystem Base" ); -MODULE_LICENSE ("GPL v2" );drivers/gpu/drm/omapdrm/dss/display.c +0
-2@@ -35,7 +35,6 @@ void omapdss_default_get_timings(struct omap_dss_device *dssdev, { *vm = dssdev->panel.vm; } -EXPORT_SYMBOL (omapdss_default_get_timings);static LIST_HEAD (panel_list);static DEFINE_MUTEX (panel_list_mutex);@@ -104,7 +103,6 @@ bool omapdss_component_is_display(struct device_node *node)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) {drivers/gpu/drm/omapdrm/dss/dss-of.c +0
-2@@ -44,7 +44,6 @@ struct device_node *dss_of_port_get_parent_device(struct device_node *port)return NULL ; } -EXPORT_SYMBOL_GPL (dss_of_port_get_parent_device);u32 dss_of_port_get_port_number (struct device_node *port) {@@ -57,7 +56,6 @@ u32 dss_of_port_get_port_number(struct device_node *port)return reg; } -EXPORT_SYMBOL_GPL (dss_of_port_get_port_number);struct omap_dss_device *omapdss_of_find_source_for_first_ep (struct device_node *node)drivers/gpu/drm/omapdrm/dss/output.c +0
-14@@ -58,7 +58,6 @@ int omapdss_output_set_device(struct omap_dss_device *out,return r; } -EXPORT_SYMBOL (omapdss_output_set_device);int omapdss_output_unset_device (struct omap_dss_device *out) {@@ -92,7 +91,6 @@ int omapdss_output_unset_device(struct omap_dss_device *out)return r; } -EXPORT_SYMBOL (omapdss_output_unset_device);int omapdss_register_output (struct omap_dss_device *out) {@@ -118,7 +116,6 @@ bool omapdss_component_is_output(struct device_node *node)return false; } -EXPORT_SYMBOL (omapdss_component_is_output);struct omap_dss_device *omap_dss_get_output (enum omap_dss_output_id id) {@@ -131,7 +128,6 @@ struct omap_dss_device *omap_dss_get_output(enum omap_dss_output_id id)return NULL ; } -EXPORT_SYMBOL (omap_dss_get_output);struct omap_dss_device *omap_dss_find_output_by_port_node (struct device_node *port) {@@ -156,7 +152,6 @@ struct omap_dss_device *omap_dss_find_output_by_port_node(struct device_node *poreturn NULL ; } -EXPORT_SYMBOL (omap_dss_find_output_by_port_node);struct omap_dss_device *omapdss_find_output_from_display (struct omap_dss_device *dssdev) {@@ -194,56 +189,47 @@ int dss_mgr_connect(enum omap_channel channel, {return dss_mgr_ops->connect (channel, dst); } -EXPORT_SYMBOL (dss_mgr_connect);void dss_mgr_disconnect (enum omap_channel channel,struct omap_dss_device *dst) { dss_mgr_ops->disconnect (channel, dst); } -EXPORT_SYMBOL (dss_mgr_disconnect);void dss_mgr_set_timings (enum omap_channel channel,const struct videomode *vm) { dss_mgr_ops->set_timings (channel, vm); } -EXPORT_SYMBOL (dss_mgr_set_timings);void dss_mgr_set_lcd_config (enum omap_channel channel,const struct dss_lcd_mgr_config *config) { dss_mgr_ops->set_lcd_config (channel, config); } -EXPORT_SYMBOL (dss_mgr_set_lcd_config);int dss_mgr_enable (enum omap_channel channel) {return dss_mgr_ops->enable (channel); } -EXPORT_SYMBOL (dss_mgr_enable);void dss_mgr_disable (enum omap_channel channel) { dss_mgr_ops->disable (channel); } -EXPORT_SYMBOL (dss_mgr_disable);void dss_mgr_start_update (enum omap_channel channel) { dss_mgr_ops->start_update (channel); } -EXPORT_SYMBOL (dss_mgr_start_update);int dss_mgr_register_framedone_handler (enum omap_channel channel,void (*handler)(void *),void *data) {return dss_mgr_ops->register_framedone_handler (channel, handler, data); } -EXPORT_SYMBOL (dss_mgr_register_framedone_handler);void dss_mgr_unregister_framedone_handler (enum omap_channel channel,void (*handler)(void *),void *data) { dss_mgr_ops->unregister_framedone_handler (channel, handler, data); } -EXPORT_SYMBOL (dss_mgr_unregister_framedone_handler);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
Re: [PATCH 04/48] drm: omapdrm: Merge the omapdss and omapdss-base modules
Hi Sebastian,
Quoted 15 lines · On Saturday, 14 October 2017 15:22:00 EEST Sebastian Reichel wrote:
Quoted 14 lines · Laurent Pinchart
There's no need for the omapdss-base code to be part of a separate module. Merge it with the omapdss module. This allows removing the exports for internal symbols.
Signed-off-by Laurent Pinchart <[email protected]>---
drivers/gpu/drm/omapdrm/dss/Kconfig | 4 ---- drivers/gpu/drm/omapdrm/dss/Makefile | 19 +++++++++++++------ drivers/gpu/drm/omapdrm/dss/base.c | 7 ------- drivers/gpu/drm/omapdrm/dss/display.c | 2 -- drivers/gpu/drm/omapdrm/dss/dss-of.c | 2 -- drivers/gpu/drm/omapdrm/dss/output.c | 14 -------------- 6 files changed, 13 insertions(+), 35 deletions(-)
[snip]
Quoted 22 lines
Quoted 22 lines
(quoted diff) +0
-0b/drivers/gpu/drm/omapdrm/dss/Makefile index
3c5644c3fc38..531b4d8075e5100644drivers/gpu/drm/omapdrm/dss/Makefile +7
-6@@ -1,12 +1,19 @@ obj-$(CONFIG_OMAP2_DSS_INIT) += omapdss-boot-init.o - -obj-$(CONFIG_OMAP_DSS_BASE) += omapdss-base.o -omapdss-base-y := base.o display.o dss-of.o output.o - obj-$(CONFIG_OMAP2_DSS) += omapdss.o + # Core DSS files -omapdss-y := core.o dss.o dispc.o dispc_coefs.o \ - pll.o video-pll.o +omapdss-y := \ + base.o \ + display.o \ + dss-of.o \ + output.o \ + core.o \
Quoted 8 lines
drivers/gpu/drm/omapdrm/dss/Makefile line 16
Quoted 6 lines
drivers/gpu/drm/omapdrm/dss/Makefile +6
-0+ dss.o \ + dispc.o \ + dispc_coefs.o \ + pll.o \ + video-pll.o +I guess it makes sense to sort this alphabetically, otherwise:
Good point. I'll do that in v2, and will also sort the entries below.
Quoted 7 lines
Reviewed-by Sebastian Reichel <[email protected]>-- Sebastian
Quoted 3 lines
drivers/gpu/drm/omapdrm/dss/Makefile +0
-0omapdss-$(CONFIG_OMAP2_DSS_DPI) += dpi.o omapdss-$(CONFIG_OMAP2_DSS_VENC) += venc.o omapdss-$(CONFIG_OMAP2_DSS_SDI) += sdi.o
[snip]
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 04/48] drm: omapdrm: Merge the omapdss and omapdss-base modules
In reply to Laurent Pinchart
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
Quoted 3 lines · Laurent Pinchart
There's no need for the omapdss-base code to be part of a separate module. Merge it with the omapdss module. This allows removing the exports for internal symbols.
The need was to support DSS6 driver, which is built as separate module. That's not in the mainline yet.
If we merge dss6 driver into the same omapdrm.ko, then there should be no issues.
Tomi
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 04/48] drm: omapdrm: Merge the omapdss and omapdss-base modules
Hi Tomi,
Quoted 7 lines · On Wednesday, 18 October 2017 12:19:26 EEST Tomi Valkeinen wrote:
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
Quoted 3 lines · Laurent Pinchart
There's no need for the omapdss-base code to be part of a separate module. Merge it with the omapdss module. This allows removing the exports for internal symbols.
Quoted 5 lines
The need was to support DSS6 driver, which is built as separate module. That's not in the mainline yet.
If we merge dss6 driver into the same omapdrm.ko, then there should be no issues.
As this series merges omapdrm and omapdss I think it would make sense to support DSS[2-5] and DSS6 in the same module (probably with a Kconfig option to select which variant(s) to support).
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 5/48 drm: omapdrm: dss: Set the DMA coherent mask
In reply to Laurent PinchartWhen merging the omapdrm and omapdss drivers the omapdrm virtual platform device will disappear, and the omapdss platform device will be used for DMA memory allocation. To prepare for that, set the DMA coherent mask for the device.
--- drivers/gpu/drm/omapdrm/dss/dss.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/gpu/drm/omapdrm/dss/dss.c +7 -0
@@ -23,6 +23,7 @@#define DSS_SUBSYS_NAME "DSS"#include <linux/debugfs.h> +#include <linux/dma-mapping.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/io.h>
@@ -1441,6 +1442,12 @@ static int dss_probe(struct platform_device *pdev) dss.pdev = pdev; + r =dma_set_coherent_mask (&pdev->dev,DMA_BIT_MASK (32 )); +if (r) { +dev_err (&pdev->dev,"Failed to set the DMA mask\n" ); +return r; + } +/* * The various OMAP3-based SoCs can't be told apart using the compatible * string, use SoC device matching.
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 05/48] drm: omapdrm: dss: Set the DMA coherent mask
Hi,
Quoted 6 lines · Laurent Pinchart
When merging the omapdrm and omapdss drivers the omapdrm virtual platform device will disappear, and the omapdss platform device will be used for DMA memory allocation. To prepare for that, set the DMA coherent mask for the device.
Signed-off-by Laurent Pinchart <[email protected]>
-- Sebastian
Quoted 38 lines
--- drivers/gpu/drm/omapdrm/dss/dss.c | 7 +++++++ 1 file changed, 7 insertions(+)drivers/gpu/drm/omapdrm/dss/dss.c +7
-0@@ -23,6 +23,7 @@#define DSS_SUBSYS_NAME "DSS"#include <linux/debugfs.h> +#include <linux/dma-mapping.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/io.h> @@ -1441,6 +1442,12 @@ static int dss_probe(struct platform_device *pdev) dss.pdev = pdev; + r =dma_set_coherent_mask (&pdev->dev,DMA_BIT_MASK (32 )); +if (r) { +dev_err (&pdev->dev,"Failed to set the DMA mask\n" ); +return r; + } +/* * The various OMAP3-based SoCs can't be told apart using the compatible * string, use SoC device matching. 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 6/48 drm: omapdrm: dss: Make dss_dump_clocks() function static
In reply to Laurent PinchartThe function isn't used outside of its compilation unit, make it static.
--- drivers/gpu/drm/omapdrm/dss/dss.c | 4 +++- drivers/gpu/drm/omapdrm/dss/dss.h | 1 - 2 files changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/omapdrm/dss/dss.c +3 -1
@@ -368,7 +368,8 @@ const char *dss_get_clk_source_name(enum dss_clk_source clk_src)return dss_generic_clk_source_names[clk_src]; } -void dss_dump_clocks (struct seq_file *s) +#if defined(CONFIG_OMAP2_DSS_DEBUGFS ) +static void dss_dump_clocks (struct seq_file *s) {const char *fclk_name;unsigned long fclk_rate;
@@ -387,6 +388,7 @@ void dss_dump_clocks(struct seq_file *s) dss_runtime_put(); } +#endif static void dss_dump_regs (struct seq_file *s) {
drivers/gpu/drm/omapdrm/dss/dss.h +0 -1
@@ -277,7 +277,6 @@ int dss_dpi_select_source(int port, enum omap_channel channel);void dss_select_hdmi_venc_clk_source (enum dss_hdmi_venc_clk_source_select );enum dss_hdmi_venc_clk_source_select dss_get_hdmi_venc_clk_source (void );const char *dss_get_clk_source_name (enum dss_clk_source clk_src); -void dss_dump_clocks (struct seq_file *s);/* DSS VIDEO PLL */ struct dss_pll *dss_video_pll_init(struct platform_device *pdev, int id,
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 06/48] drm: omapdrm: dss: Make dss_dump_clocks() function static
Hi,
Quoted 3 lines · Laurent Pinchart
The function isn't used outside of its compilation unit, make it static.
Signed-off-by Laurent Pinchart <[email protected]>
-- Sebastian
Quoted 48 lines
--- drivers/gpu/drm/omapdrm/dss/dss.c | 4 +++- drivers/gpu/drm/omapdrm/dss/dss.h | 1 - 2 files changed, 3 insertions(+), 2 deletions(-)drivers/gpu/drm/omapdrm/dss/dss.c +3
-1@@ -368,7 +368,8 @@ const char *dss_get_clk_source_name(enum dss_clk_source clk_src)return dss_generic_clk_source_names[clk_src]; } -void dss_dump_clocks (struct seq_file *s) +#if defined(CONFIG_OMAP2_DSS_DEBUGFS ) +static void dss_dump_clocks (struct seq_file *s) {const char *fclk_name;unsigned long fclk_rate;@@ -387,6 +388,7 @@ void dss_dump_clocks(struct seq_file *s) dss_runtime_put(); } +#endif static void dss_dump_regs (struct seq_file *s) {drivers/gpu/drm/omapdrm/dss/dss.h +0
-1@@ -277,7 +277,6 @@ int dss_dpi_select_source(int port, enum omap_channel channel);void dss_select_hdmi_venc_clk_source (enum dss_hdmi_venc_clk_source_select );enum dss_hdmi_venc_clk_source_select dss_get_hdmi_venc_clk_source (void );const char *dss_get_clk_source_name (enum dss_clk_source clk_src); -void dss_dump_clocks (struct seq_file *s);/* DSS VIDEO PLL */ struct dss_pll *dss_video_pll_init(struct platform_device *pdev, int id,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 7/48 drm: omapdrm: dpi: Remove dpi_data port_initialized field
In reply to Laurent PinchartThe dpi_data structure port_initialized field is used to check in the cleanup path whether the DPI has been initialized. This can be performed through the associated device_node data field instead. Remove the port_initialized field.
--- drivers/gpu/drm/omapdrm/dss/dpi.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/omapdrm/dss/dpi.c +1 -5
@@ -52,8 +52,6 @@ struct dpi_data {int data_lines;struct omap_dss_device output; - -bool port_initialized; };static struct dpi_data *dpi_get_data_from_dssdev (struct omap_dss_device *dssdev)
@@ -786,8 +784,6 @@ int dpi_init_port(struct platform_device *pdev, struct device_node *port,dpi_init_output_port (dpi, port); - dpi->port_initialized = true; -return 0 ; err_datalines:
@@ -800,7 +796,7 @@ void dpi_uninit_port(struct device_node *port) {struct dpi_data *dpi = port->data; -if (!dpi->port_initialized) +if (!dpi)return ;dpi_uninit_output_port (port);
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 07/48] drm: omapdrm: dpi: Remove dpi_data port_initialized field
Hi,
Quoted 7 lines · Laurent Pinchart
The
dpi_datastructureport_initializedfield is used to check in the cleanup path whether the DPI has been initialized. This can be performed through the associateddevice_nodedata field instead. Remove theport_initializedfield.Signed-off-by Laurent Pinchart <[email protected]>---
-- Sebastian
Quoted 43 lines
drivers/gpu/drm/omapdrm/dss/dpi.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)drivers/gpu/drm/omapdrm/dss/dpi.c +1
-5@@ -52,8 +52,6 @@ struct dpi_data {int data_lines;struct omap_dss_device output; - -bool port_initialized; };static struct dpi_data *dpi_get_data_from_dssdev (struct omap_dss_device *dssdev)@@ -786,8 +784,6 @@ int dpi_init_port(struct platform_device *pdev, struct device_node *port,dpi_init_output_port (dpi, port); - dpi->port_initialized = true; -return 0 ; err_datalines:@@ -800,7 +796,7 @@ void dpi_uninit_port(struct device_node *port) {struct dpi_data *dpi = port->data; -if (!dpi->port_initialized) +if (!dpi)return ;dpi_uninit_output_port (port);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 8/48 drm: omapdrm: venc: Return error code on OF parsing failure
In reply to Laurent PinchartThe venc_probe_of() function has an error cleanup path that returns success instead of an error code. Fix it.
--- drivers/gpu/drm/omapdrm/dss/venc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/omapdrm/dss/venc.c +2 -2
@@ -857,10 +857,10 @@ static int venc_probe_of(struct platform_device *pdev)of_node_put (ep);return 0 ; + err:of_node_put (ep); - -return 0 ; +return r; }/* VENC HW IP initialisation */
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 08/48] drm: omapdrm: venc: Return error code on OF parsing failure
Hi,
Quoted 5 lines · Laurent Pinchart
The
venc_probe_of()function has an error cleanup path that returns success instead of an error code. Fix it.Signed-off-by Laurent Pinchart <[email protected]>---
Maybe this should be tagged for stable backporting?
-- Sebastian
Quoted 29 lines
drivers/gpu/drm/omapdrm/dss/venc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/omapdrm/dss/venc.c +2
-2@@ -857,10 +857,10 @@ static int venc_probe_of(struct platform_device *pdev)of_node_put (ep);return 0 ; + err:of_node_put (ep); - -return 0 ; +return r; }/* VENC HW IP initialisation */ 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 9/48 drm: omapdrm: Deconstruct the omap_drv.h header.
In reply to Laurent PinchartThe number of function declarations in the omap_drv.h degrades readability. To fix it, create new header files for each part of the driver and move the related functions.
--- drivers/gpu/drm/omapdrm/omap_connector.h | 37 +++++++++ drivers/gpu/drm/omapdrm/omap_crtc.h | 43 ++++++++++ drivers/gpu/drm/omapdrm/omap_drv.h | 133 +++---------------------------- drivers/gpu/drm/omapdrm/omap_encoder.h | 33 ++++++++ drivers/gpu/drm/omapdrm/omap_fb.h | 46 +++++++++++ drivers/gpu/drm/omapdrm/omap_fbdev.h | 39 +++++++++ drivers/gpu/drm/omapdrm/omap_gem.h | 99 +++++++++++++++++++++++ drivers/gpu/drm/omapdrm/omap_irq.h | 39 +++++++++ drivers/gpu/drm/omapdrm/omap_plane.h | 37 +++++++++ 9 files changed, 386 insertions(+), 120 deletions(-) create mode 100644 drivers/gpu/drm/omapdrm/omap_connector.h create mode 100644 drivers/gpu/drm/omapdrm/omap_crtc.h create mode 100644 drivers/gpu/drm/omapdrm/omap_encoder.h create mode 100644 drivers/gpu/drm/omapdrm/omap_fb.h create mode 100644 drivers/gpu/drm/omapdrm/omap_fbdev.h create mode 100644 drivers/gpu/drm/omapdrm/omap_gem.h create mode 100644 drivers/gpu/drm/omapdrm/omap_irq.h create mode 100644 drivers/gpu/drm/omapdrm/omap_plane.h
drivers/gpu/drm/omapdrm/omap_connector.h new file +37 -0
@@ -0,0 +1,37 @@ +/* +* omap_connector.h -- OMAP DRM Connector +* +* Copyright (C) 2011 Texas Instruments +* Author: Rob Clark <[email protected]> +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License version 2 as published by +* the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +* more details. +* +* You should have received a copy of the GNU General Public License along with +* this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#ifndef __OMAPDRM_CONNECTOR_H__ +#define __OMAPDRM_CONNECTOR_H__ + +#include <linux/types.h> + +struct drm_connector ; +struct drm_device ; +struct drm_encoder ; +struct omap_dss_device ; + +struct drm_connector *omap_connector_init (struct drm_device *dev, +int connector_type,struct omap_dss_device *dssdev, +struct drm_encoder *encoder); +struct drm_encoder *omap_connector_attached_encoder ( +struct drm_connector *connector); +bool omap_connector_get_hdmi_mode (struct drm_connector *connector); + +#endif /* __OMAPDRM_CONNECTOR_H__ */
drivers/gpu/drm/omapdrm/omap_crtc.h new file +43 -0
43 lines not on this page · raw message
drivers/gpu/drm/omapdrm/omap_drv.h +13 -120
155 lines not on this page · raw message
drivers/gpu/drm/omapdrm/omap_encoder.h new file +33 -0
@@ -0,0 +1,33 @@ +/* +* omap_encoder.h -- OMAP DRM Encoder +* +* Copyright (C) 2011 Texas Instruments +* Author: Rob Clark <[email protected]> +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License version 2 as published by +* the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +* more details. +* +* You should have received a copy of the GNU General Public License along with +* this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#ifndef __OMAPDRM_ENCODER_H__ +#define __OMAPDRM_ENCODER_H__ + +struct drm_device ; +struct drm_encoder ; +struct omap_dss_device ; + +struct drm_encoder *omap_encoder_init (struct drm_device *dev, +struct omap_dss_device *dssdev); + +/* map crtc to vblank mask */ +struct omap_dss_device *omap_encoder_get_dssdev (struct drm_encoder *encoder); + +#endif /* __OMAPDRM_ENCODER_H__ */
drivers/gpu/drm/omapdrm/omap_fb.h new file +46 -0
46 lines not on this page · raw message
drivers/gpu/drm/omapdrm/omap_fbdev.h new file +39 -0
@@ -0,0 +1,39 @@ +/* +* omap_fbdev.h -- OMAP DRM FBDEV Compatibility +* +* Copyright (C) 2011 Texas Instruments +* Author: Rob Clark <[email protected]> +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License version 2 as published by +* the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +* more details. +* +* You should have received a copy of the GNU General Public License along with +* this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#ifndef __OMAPDRM_FBDEV_H__ +#define __OMAPDRM_FBDEV_H__ + +struct drm_device ; +struct drm_fb_helper ; + +#ifdef CONFIG_DRM_FBDEV_EMULATION +struct drm_fb_helper *omap_fbdev_init (struct drm_device *dev); +void omap_fbdev_free (struct drm_device *dev); +#else +static inline struct drm_fb_helper *omap_fbdev_init (struct drm_device *dev) +{ +return NULL ; +} +static inline void omap_fbdev_free (struct drm_device *dev) +{ +} +#endif + +#endif /* __OMAPDRM_FBDEV_H__ */
drivers/gpu/drm/omapdrm/omap_gem.h new file +99 -0
99 lines not on this page · raw message
drivers/gpu/drm/omapdrm/omap_irq.h new file +39 -0
@@ -0,0 +1,39 @@ +/* +* omap_irq.h -- OMAP DRM IRQ Handling +* +* Copyright (C) 2011 Texas Instruments +* Author: Rob Clark <[email protected]> +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License version 2 as published by +* the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +* more details. +* +* You should have received a copy of the GNU General Public License along with +* this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#ifndef __OMAPDRM_IRQ_H__ +#define __OMAPDRM_IRQ_H__ + +#include <linux/types.h> + +struct drm_crtc ; +struct drm_device ; +struct omap_irq_wait ; + +int omap_irq_enable_vblank (struct drm_crtc *crtc); +void omap_irq_disable_vblank (struct drm_crtc *crtc); +void omap_drm_irq_uninstall (struct drm_device *dev); +int omap_drm_irq_install (struct drm_device *dev); + +struct omap_irq_wait *omap_irq_wait_init (struct drm_device *dev, +uint32_t irqmask,int count); +int omap_irq_wait (struct drm_device *dev,struct omap_irq_wait *wait, +unsigned long timeout); + +#endif /* __OMAPDRM_IRQ_H__ */
drivers/gpu/drm/omapdrm/omap_plane.h new file +37 -0
@@ -0,0 +1,37 @@ +/* +* omap_plane.h -- OMAP DRM Plane +* +* Copyright (C) 2011 Texas Instruments +* Author: Rob Clark <[email protected]> +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License version 2 as published by +* the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +* more details. +* +* You should have received a copy of the GNU General Public License along with +* this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#ifndef __OMAPDRM_PLANE_H__ +#define __OMAPDRM_PLANE_H__ + +#include <linux/types.h> + +enum drm_plane_type ; + +struct drm_device ; +struct drm_mode_object ; +struct drm_plane ; + +struct drm_plane *omap_plane_init (struct drm_device *dev, +int idx,enum drm_plane_type type, +u32 possible_crtcs); +void omap_plane_install_properties (struct drm_plane *plane, +struct drm_mode_object *obj); + +#endif /* __OMAPDRM_PLANE_H__ */
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 09/48] drm: omapdrm: Deconstruct the omap_drv.h header.
Hi,
Quoted 6 lines · Laurent Pinchart
The number of function declarations in the
omap_drv.hdegrades readability. To fix it, create new header files for each part of the driver and move the related functions.Signed-off-by Laurent Pinchart <[email protected]>---
-- Sebastian
Quoted 612 lines
drivers/gpu/drm/omapdrm/omap_connector.h | 37 +++++++++ drivers/gpu/drm/omapdrm/omap_crtc.h | 43 ++++++++++ drivers/gpu/drm/omapdrm/omap_drv.h | 133 +++---------------------------- drivers/gpu/drm/omapdrm/omap_encoder.h | 33 ++++++++ drivers/gpu/drm/omapdrm/omap_fb.h | 46 +++++++++++ drivers/gpu/drm/omapdrm/omap_fbdev.h | 39 +++++++++ drivers/gpu/drm/omapdrm/omap_gem.h | 99 +++++++++++++++++++++++ drivers/gpu/drm/omapdrm/omap_irq.h | 39 +++++++++ drivers/gpu/drm/omapdrm/omap_plane.h | 37 +++++++++ 9 files changed, 386 insertions(+), 120 deletions(-) create mode 100644 drivers/gpu/drm/omapdrm/omap_connector.h create mode 100644 drivers/gpu/drm/omapdrm/omap_crtc.h create mode 100644 drivers/gpu/drm/omapdrm/omap_encoder.h create mode 100644 drivers/gpu/drm/omapdrm/omap_fb.h create mode 100644 drivers/gpu/drm/omapdrm/omap_fbdev.h create mode 100644 drivers/gpu/drm/omapdrm/omap_gem.h create mode 100644 drivers/gpu/drm/omapdrm/omap_irq.h create mode 100644 drivers/gpu/drm/omapdrm/omap_plane.hdrivers/gpu/drm/omapdrm/omap_connector.h new file +37
-0@@ -0,0 +1,37 @@ +/* +* omap_connector.h -- OMAP DRM Connector +* +* Copyright (C) 2011 Texas Instruments +* Author: Rob Clark <[email protected]> +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License version 2 as published by +* the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +* more details. +* +* You should have received a copy of the GNU General Public License along with +* this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#ifndef __OMAPDRM_CONNECTOR_H__ +#define __OMAPDRM_CONNECTOR_H__ + +#include <linux/types.h> + +struct drm_connector ; +struct drm_device ; +struct drm_encoder ; +struct omap_dss_device ; + +struct drm_connector *omap_connector_init (struct drm_device *dev, +int connector_type,struct omap_dss_device *dssdev, +struct drm_encoder *encoder); +struct drm_encoder *omap_connector_attached_encoder ( +struct drm_connector *connector); +bool omap_connector_get_hdmi_mode (struct drm_connector *connector); + +#endif /* __OMAPDRM_CONNECTOR_H__ */ drivers/gpu/drm/omapdrm/omap_crtc.h new file +43
-0@@ -0,0 +1,43 @@ +/* +* omap_crtc.h -- OMAP DRM CRTC +* +* Copyright (C) 2011 Texas Instruments +* Author: Rob Clark <[email protected]> +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License version 2 as published by +* the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +* more details. +* +* You should have received a copy of the GNU General Public License along with +* this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#ifndef __OMAPDRM_CRTC_H__ +#define __OMAPDRM_CRTC_H__ + +#include <linux/types.h> + +enum omap_channel ; + +struct drm_crtc ; +struct drm_device ; +struct drm_plane ; +struct omap_dss_device ; +struct videomode ; + +struct videomode *omap_crtc_timings (struct drm_crtc *crtc); +enum omap_channel omap_crtc_channel (struct drm_crtc *crtc); +void omap_crtc_pre_init (void ); +void omap_crtc_pre_uninit (void ); +struct drm_crtc *omap_crtc_init (struct drm_device *dev, +struct drm_plane *plane,struct omap_dss_device *dssdev); +int omap_crtc_wait_pending (struct drm_crtc *crtc); +void omap_crtc_error_irq (struct drm_crtc *crtc,uint32_t irqstatus); +void omap_crtc_vblank_irq (struct drm_crtc *crtc); + +#endif /* __OMAPDRM_CRTC_H__ */ drivers/gpu/drm/omapdrm/omap_drv.h +13
-120@@ -17,8 +17,8 @@* this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef __OMAP_DRV_H__ -#define __OMAP_DRV_H__ +#ifndef __OMAPDRM_DRV_H__ +#define __OMAPDRM_DRV_H__#include <linux/module.h> #include <linux/types.h> @@ -31,6 +31,15 @@#include "dss/omapdss.h" +#include "omap_connector.h" +#include "omap_crtc.h" +#include "omap_encoder.h" +#include "omap_fb.h" +#include "omap_fbdev.h" +#include "omap_gem.h" +#include "omap_irq.h" +#include "omap_plane.h" +#define DBG (fmt, ...) DRM_DEBUG(fmt"\n", ##__VA_ARGS__)#define VERB (fmt, ...) if (0) DRM_DEBUG(fmt, ##__VA_ARGS__)/* verbose debug */ @@ -38,14 +47,6 @@struct omap_drm_usergart ; -/* For KMS code that needs to wait for a certain # of IRQs: -*/ -struct omap_irq_wait ; -struct omap_irq_wait *omap_irq_wait_init (struct drm_device *dev, -uint32_t irqmask,int count); -int omap_irq_wait (struct drm_device *dev,struct omap_irq_wait *wait, -unsigned long timeout); -struct omap_drm_private {uint32_t omaprev;@@ -86,114 +87,6 @@ struct omap_drm_private { }; -#ifdef CONFIG_DEBUG_FS int omap_debugfs_init (struct drm_minor *minor); -void omap_framebuffer_describe (struct drm_framebuffer *fb,struct seq_file *m); -void omap_gem_describe (struct drm_gem_object *obj,struct seq_file *m); -void omap_gem_describe_objects (struct list_head *list,struct seq_file *m); -#endif - -#ifdef CONFIG_PM -int omap_gem_resume (struct drm_device *dev); -#endif - -int omap_irq_enable_vblank (struct drm_crtc *crtc); -void omap_irq_disable_vblank (struct drm_crtc *crtc); -void omap_drm_irq_uninstall (struct drm_device *dev); -int omap_drm_irq_install (struct drm_device *dev); - -#ifdef CONFIG_DRM_FBDEV_EMULATION -struct drm_fb_helper *omap_fbdev_init (struct drm_device *dev); -void omap_fbdev_free (struct drm_device *dev); -#else -static inline struct drm_fb_helper *omap_fbdev_init (struct drm_device *dev) -{ -return NULL ; -} -static inline void omap_fbdev_free (struct drm_device *dev) -{ -} -#endif - -struct videomode *omap_crtc_timings (struct drm_crtc *crtc); -enum omap_channel omap_crtc_channel (struct drm_crtc *crtc); -void omap_crtc_pre_init (void ); -void omap_crtc_pre_uninit (void ); -struct drm_crtc *omap_crtc_init (struct drm_device *dev, -struct drm_plane *plane,struct omap_dss_device *dssdev); -int omap_crtc_wait_pending (struct drm_crtc *crtc); -void omap_crtc_error_irq (struct drm_crtc *crtc,uint32_t irqstatus); -void omap_crtc_vblank_irq (struct drm_crtc *crtc); - -struct drm_plane *omap_plane_init (struct drm_device *dev, -int idx,enum drm_plane_type type, -u32 possible_crtcs); -void omap_plane_install_properties (struct drm_plane *plane, -struct drm_mode_object *obj); - -struct drm_encoder *omap_encoder_init (struct drm_device *dev, -struct omap_dss_device *dssdev); - -struct drm_connector *omap_connector_init (struct drm_device *dev, -int connector_type,struct omap_dss_device *dssdev, -struct drm_encoder *encoder); -struct drm_encoder *omap_connector_attached_encoder ( -struct drm_connector *connector); -bool omap_connector_get_hdmi_mode (struct drm_connector *connector); - -struct drm_framebuffer *omap_framebuffer_create (struct drm_device *dev, -struct drm_file *file,const struct drm_mode_fb_cmd2 *mode_cmd); -struct drm_framebuffer *omap_framebuffer_init (struct drm_device *dev, -const struct drm_mode_fb_cmd2 *mode_cmd,struct drm_gem_object **bos); -int omap_framebuffer_pin (struct drm_framebuffer *fb); -void omap_framebuffer_unpin (struct drm_framebuffer *fb); -void omap_framebuffer_update_scanout (struct drm_framebuffer *fb, -struct drm_plane_state *state,struct omap_overlay_info *info); -struct drm_connector *omap_framebuffer_get_next_connector ( -struct drm_framebuffer *fb,struct drm_connector *from); -bool omap_framebuffer_supports_rotation (struct drm_framebuffer *fb); - -void omap_gem_init (struct drm_device *dev); -void omap_gem_deinit (struct drm_device *dev); - -struct drm_gem_object *omap_gem_new (struct drm_device *dev, -union omap_gem_size gsize,uint32_t flags); -struct drm_gem_object *omap_gem_new_dmabuf (struct drm_device *dev,size_t size, -struct sg_table *sgt); -int omap_gem_new_handle (struct drm_device *dev,struct drm_file *file, -union omap_gem_size gsize,uint32_t flags,uint32_t *handle); -void omap_gem_free_object (struct drm_gem_object *obj); -void *omap_gem_vaddr (struct drm_gem_object *obj); -int omap_gem_dumb_map_offset (struct drm_file *file,struct drm_device *dev, -uint32_t handle,uint64_t *offset); -int omap_gem_dumb_create (struct drm_file *file,struct drm_device *dev, -struct drm_mode_create_dumb *args); -int omap_gem_mmap (struct file *filp,struct vm_area_struct *vma); -int omap_gem_mmap_obj (struct drm_gem_object *obj, -struct vm_area_struct *vma); -int omap_gem_fault (struct vm_fault *vmf); -int omap_gem_roll (struct drm_gem_object *obj,uint32_t roll); -void omap_gem_cpu_sync_page (struct drm_gem_object *obj,int pgoff); -void omap_gem_dma_sync_buffer (struct drm_gem_object *obj, -enum dma_data_direction dir); -int omap_gem_pin (struct drm_gem_object *obj,dma_addr_t *dma_addr); -void omap_gem_unpin (struct drm_gem_object *obj); -int omap_gem_get_pages (struct drm_gem_object *obj,struct page ***pages, -bool remap); -int omap_gem_put_pages (struct drm_gem_object *obj); -uint32_t omap_gem_flags (struct drm_gem_object *obj); -int omap_gem_rotated_dma_addr (struct drm_gem_object *obj,uint32_t orient, -int x,int y,dma_addr_t *dma_addr); -uint64_t omap_gem_mmap_offset (struct drm_gem_object *obj); -size_t omap_gem_mmap_size (struct drm_gem_object *obj); -int omap_gem_tiled_stride (struct drm_gem_object *obj,uint32_t orient); - -struct dma_buf *omap_gem_prime_export (struct drm_device *dev, -struct drm_gem_object *obj,int flags); -struct drm_gem_object *omap_gem_prime_import (struct drm_device *dev, -struct dma_buf *buffer); - -/* map crtc to vblank mask */ -struct omap_dss_device *omap_encoder_get_dssdev (struct drm_encoder *encoder); - -#endif /* __OMAP_DRV_H__ */ + +#endif /* __OMAPDRM_DRV_H__ */ drivers/gpu/drm/omapdrm/omap_encoder.h new file +33
-0@@ -0,0 +1,33 @@ +/* +* omap_encoder.h -- OMAP DRM Encoder +* +* Copyright (C) 2011 Texas Instruments +* Author: Rob Clark <[email protected]> +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License version 2 as published by +* the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +* more details. +* +* You should have received a copy of the GNU General Public License along with +* this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#ifndef __OMAPDRM_ENCODER_H__ +#define __OMAPDRM_ENCODER_H__ + +struct drm_device ; +struct drm_encoder ; +struct omap_dss_device ; + +struct drm_encoder *omap_encoder_init (struct drm_device *dev, +struct omap_dss_device *dssdev); + +/* map crtc to vblank mask */ +struct omap_dss_device *omap_encoder_get_dssdev (struct drm_encoder *encoder); + +#endif /* __OMAPDRM_ENCODER_H__ */ drivers/gpu/drm/omapdrm/omap_fb.h new file +46
-0@@ -0,0 +1,46 @@ +/* +* omap_fb.h -- OMAP DRM Framebuffer +* +* Copyright (C) 2011 Texas Instruments +* Author: Rob Clark <[email protected]> +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License version 2 as published by +* the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +* more details. +* +* You should have received a copy of the GNU General Public License along with +* this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#ifndef __OMAPDRM_FB_H__ +#define __OMAPDRM_FB_H__ + +struct drm_connector ; +struct drm_device ; +struct drm_file ; +struct drm_framebuffer ; +struct drm_gem_object ; +struct drm_mode_fb_cmd2 ; +struct drm_plane_state ; +struct omap_overlay_info ; +struct seq_file ; + +struct drm_framebuffer *omap_framebuffer_create (struct drm_device *dev, +struct drm_file *file,const struct drm_mode_fb_cmd2 *mode_cmd); +struct drm_framebuffer *omap_framebuffer_init (struct drm_device *dev, +const struct drm_mode_fb_cmd2 *mode_cmd,struct drm_gem_object **bos); +int omap_framebuffer_pin (struct drm_framebuffer *fb); +void omap_framebuffer_unpin (struct drm_framebuffer *fb); +void omap_framebuffer_update_scanout (struct drm_framebuffer *fb, +struct drm_plane_state *state,struct omap_overlay_info *info); +struct drm_connector *omap_framebuffer_get_next_connector ( +struct drm_framebuffer *fb,struct drm_connector *from); +bool omap_framebuffer_supports_rotation (struct drm_framebuffer *fb); +void omap_framebuffer_describe (struct drm_framebuffer *fb,struct seq_file *m); + +#endif /* __OMAPDRM_FB_H__ */ drivers/gpu/drm/omapdrm/omap_fbdev.h new file +39
-0@@ -0,0 +1,39 @@ +/* +* omap_fbdev.h -- OMAP DRM FBDEV Compatibility +* +* Copyright (C) 2011 Texas Instruments +* Author: Rob Clark <[email protected]> +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License version 2 as published by +* the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +* more details. +* +* You should have received a copy of the GNU General Public License along with +* this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#ifndef __OMAPDRM_FBDEV_H__ +#define __OMAPDRM_FBDEV_H__ + +struct drm_device ; +struct drm_fb_helper ; + +#ifdef CONFIG_DRM_FBDEV_EMULATION +struct drm_fb_helper *omap_fbdev_init (struct drm_device *dev); +void omap_fbdev_free (struct drm_device *dev); +#else +static inline struct drm_fb_helper *omap_fbdev_init (struct drm_device *dev) +{ +return NULL ; +} +static inline void omap_fbdev_free (struct drm_device *dev) +{ +} +#endif + +#endif /* __OMAPDRM_FBDEV_H__ */ drivers/gpu/drm/omapdrm/omap_gem.h new file +99
-0@@ -0,0 +1,99 @@ +/* +* omap_gem.h -- OMAP DRM GEM Object Management +* +* Copyright (C) 2011 Texas Instruments +* Author: Rob Clark <[email protected]> +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License version 2 as published by +* the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +* more details. +* +* You should have received a copy of the GNU General Public License along with +* this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#ifndef __OMAPDRM_GEM_H__ +#define __OMAPDRM_GEM_H__ + +#include <linux/types.h> + +enum dma_data_direction ; + +struct dma_buf ; +struct drm_device ; +struct drm_file ; +struct drm_gem_object ; +struct drm_mode_create_dumb ; +struct file ; +struct list_head ; +struct page ; +struct seq_file ; +struct vm_area_struct ; +struct vm_fault ; + +union omap_gem_size ; + +/* Initialization and Cleanup */ +void omap_gem_init (struct drm_device *dev); +void omap_gem_deinit (struct drm_device *dev); + +#ifdef CONFIG_PM +int omap_gem_resume (struct drm_device *dev); +#endif + +#ifdef CONFIG_DEBUG_FS +void omap_gem_describe (struct drm_gem_object *obj,struct seq_file *m); +void omap_gem_describe_objects (struct list_head *list,struct seq_file *m); +#endif + +/* GEM Object Creation and Deletion */ +struct drm_gem_object *omap_gem_new (struct drm_device *dev, +union omap_gem_size gsize,uint32_t flags); +struct drm_gem_object *omap_gem_new_dmabuf (struct drm_device *dev,size_t size, +struct sg_table *sgt); +int omap_gem_new_handle (struct drm_device *dev,struct drm_file *file, +union omap_gem_size gsize,uint32_t flags,uint32_t *handle); +void omap_gem_free_object (struct drm_gem_object *obj); +void *omap_gem_vaddr (struct drm_gem_object *obj); + +/* Dumb Buffers Interface */ +int omap_gem_dumb_map_offset (struct drm_file *file,struct drm_device *dev, +uint32_t handle,uint64_t *offset); +int omap_gem_dumb_create (struct drm_file *file,struct drm_device *dev, +struct drm_mode_create_dumb *args); + +/* mmap() Interface */ +int omap_gem_mmap (struct file *filp,struct vm_area_struct *vma); +int omap_gem_mmap_obj (struct drm_gem_object *obj, +struct vm_area_struct *vma); +uint64_t omap_gem_mmap_offset (struct drm_gem_object *obj); +size_t omap_gem_mmap_size (struct drm_gem_object *obj); + +/* PRIME Interface */ +struct dma_buf *omap_gem_prime_export (struct drm_device *dev, +struct drm_gem_object *obj,int flags); +struct drm_gem_object *omap_gem_prime_import (struct drm_device *dev, +struct dma_buf *buffer); + +int omap_gem_fault (struct vm_fault *vmf); +int omap_gem_roll (struct drm_gem_object *obj,uint32_t roll); +void omap_gem_cpu_sync_page (struct drm_gem_object *obj,int pgoff); +void omap_gem_dma_sync_buffer (struct drm_gem_object *obj, +enum dma_data_direction dir); +int omap_gem_pin (struct drm_gem_object *obj,dma_addr_t *dma_addr); +void omap_gem_unpin (struct drm_gem_object *obj); +int omap_gem_get_pages (struct drm_gem_object *obj,struct page ***pages, +bool remap); +int omap_gem_put_pages (struct drm_gem_object *obj); + +uint32_t omap_gem_flags (struct drm_gem_object *obj); +int omap_gem_rotated_dma_addr (struct drm_gem_object *obj,uint32_t orient, +int x,int y,dma_addr_t *dma_addr); +int omap_gem_tiled_stride (struct drm_gem_object *obj,uint32_t orient); + +#endif /* __OMAPDRM_GEM_H__ */ drivers/gpu/drm/omapdrm/omap_irq.h new file +39
-0@@ -0,0 +1,39 @@ +/* +* omap_irq.h -- OMAP DRM IRQ Handling +* +* Copyright (C) 2011 Texas Instruments +* Author: Rob Clark <[email protected]> +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License version 2 as published by +* the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +* more details. +* +* You should have received a copy of the GNU General Public License along with +* this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#ifndef __OMAPDRM_IRQ_H__ +#define __OMAPDRM_IRQ_H__ + +#include <linux/types.h> + +struct drm_crtc ; +struct drm_device ; +struct omap_irq_wait ; + +int omap_irq_enable_vblank (struct drm_crtc *crtc); +void omap_irq_disable_vblank (struct drm_crtc *crtc); +void omap_drm_irq_uninstall (struct drm_device *dev); +int omap_drm_irq_install (struct drm_device *dev); + +struct omap_irq_wait *omap_irq_wait_init (struct drm_device *dev, +uint32_t irqmask,int count); +int omap_irq_wait (struct drm_device *dev,struct omap_irq_wait *wait, +unsigned long timeout); + +#endif /* __OMAPDRM_IRQ_H__ */ drivers/gpu/drm/omapdrm/omap_plane.h new file +37
-0@@ -0,0 +1,37 @@ +/* +* omap_plane.h -- OMAP DRM Plane +* +* Copyright (C) 2011 Texas Instruments +* Author: Rob Clark <[email protected]> +* +* This program is free software; you can redistribute it and/or modify it +* under the terms of the GNU General Public License version 2 as published by +* the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, but WITHOUT +* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for +* more details. +* +* You should have received a copy of the GNU General Public License along with +* this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#ifndef __OMAPDRM_PLANE_H__ +#define __OMAPDRM_PLANE_H__ + +#include <linux/types.h> + +enum drm_plane_type ; + +struct drm_device ; +struct drm_mode_object ; +struct drm_plane ; + +struct drm_plane *omap_plane_init (struct drm_device *dev, +int idx,enum drm_plane_type type, +u32 possible_crtcs); +void omap_plane_install_properties (struct drm_plane *plane, +struct drm_mode_object *obj); + +#endif /* __OMAPDRM_PLANE_H__ */ 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 10/48 drm: omapdrm: Use kernel integer types
In reply to Laurent PinchartThe standard kernel integer types are [us]{8,16,32}. Use them instead of the u?int{8,16,32}_t types.
--- drivers/gpu/drm/omapdrm/omap_crtc.c | 12 ++++----- drivers/gpu/drm/omapdrm/omap_crtc.h | 2 +- drivers/gpu/drm/omapdrm/omap_dmm_priv.h | 10 +++---- drivers/gpu/drm/omapdrm/omap_dmm_tiler.c | 46 ++++++++++++++++---------------- drivers/gpu/drm/omapdrm/omap_dmm_tiler.h | 22 +++++++-------- drivers/gpu/drm/omapdrm/omap_drv.h | 4 +-- drivers/gpu/drm/omapdrm/omap_fb.c | 18 ++++++------- drivers/gpu/drm/omapdrm/omap_gem.c | 41 +++++++++++++++------------- drivers/gpu/drm/omapdrm/omap_gem.h | 16 +++++------ drivers/gpu/drm/omapdrm/omap_irq.c | 6 ++--- drivers/gpu/drm/omapdrm/omap_irq.h | 2 +- drivers/gpu/drm/omapdrm/omap_plane.c | 4 +-- drivers/gpu/drm/omapdrm/tcm-sita.c | 12 ++++----- drivers/gpu/drm/omapdrm/tcm.h | 4 +-- 14 files changed, 101 insertions(+), 98 deletions(-)
drivers/gpu/drm/omapdrm/omap_crtc.c +6 -6
@@ -273,7 +273,7 @@ static const struct dss_mgr_ops mgr_ops = {* Setup, Flush and Page Flip */ -void omap_crtc_error_irq (struct drm_crtc *crtc,uint32_t irqstatus) +void omap_crtc_error_irq (struct drm_crtc *crtc,u32 irqstatus) {struct omap_crtc *omap_crtc =to_omap_crtc (crtc);
@@ -458,7 +458,7 @@ static int omap_crtc_atomic_check(struct drm_crtc *crtc,struct drm_plane_state *pri_state;if (state->color_mgmt_changed && state->gamma_lut) { -uint length = state->gamma_lut->length / +unsigned int length = state->gamma_lut->length /sizeof (struct drm_color_lut );if (length <2 )
@@ -492,7 +492,7 @@ static void omap_crtc_atomic_flush(struct drm_crtc *crtc,if (crtc->state->color_mgmt_changed) {struct drm_color_lut *lut =NULL ; -uint length =0 ; +unsigned int length =0 ;if (crtc->state->gamma_lut) { lut = (struct drm_color_lut *)
@@ -523,7 +523,7 @@ static void omap_crtc_atomic_flush(struct drm_crtc *crtc,static int omap_crtc_atomic_set_property (struct drm_crtc *crtc,struct drm_crtc_state *state,struct drm_property *property, -uint64_t val) +u64 val) {struct omap_drm_private *priv = crtc->dev->dev_private;struct drm_plane_state *plane_state;
@@ -551,7 +551,7 @@ static int omap_crtc_atomic_set_property(struct drm_crtc *crtc,static int omap_crtc_atomic_get_property (struct drm_crtc *crtc,const struct drm_crtc_state *state,struct drm_property *property, -uint64_t *val) +u64 *val) {struct omap_drm_private *priv = crtc->dev->dev_private;struct omap_crtc_state *omap_state =to_omap_crtc_state (state);
@@ -697,7 +697,7 @@ struct drm_crtc *omap_crtc_init(struct drm_device *dev,* gamma table is not supprted. */ if (priv->dispc_ops->mgr_gamma_size (channel)) { -uint gamma_lut_size =256 ; +unsigned int gamma_lut_size =256 ;drm_crtc_enable_color_mgmt (crtc,0 , false, gamma_lut_size);drm_mode_crtc_set_gamma_size (crtc, gamma_lut_size);
drivers/gpu/drm/omapdrm/omap_crtc.h +1 -1
@@ -37,7 +37,7 @@ void omap_crtc_pre_uninit(void);struct drm_crtc *omap_crtc_init (struct drm_device *dev,struct drm_plane *plane,struct omap_dss_device *dssdev);int omap_crtc_wait_pending (struct drm_crtc *crtc); -void omap_crtc_error_irq (struct drm_crtc *crtc,uint32_t irqstatus); +void omap_crtc_error_irq (struct drm_crtc *crtc,u32 irqstatus);void omap_crtc_vblank_irq (struct drm_crtc *crtc);#endif /* __OMAPDRM_CRTC_H__ */
drivers/gpu/drm/omapdrm/omap_dmm_priv.h +5 -5
@@ -102,10 +102,10 @@ struct pat_ctrl { };struct pat { -uint32_t next_pa; +u32 next_pa;struct pat_area area;struct pat_ctrl ctrl; -uint32_t data_pa; +u32 data_pa; };#define DMM_FIXED_RETRY_COUNT 1000
@@ -129,7 +129,7 @@ struct dmm_txn {void *engine_handle;struct tcm *tcm; -uint8_t *current_va; +u8 *current_va;dma_addr_t current_pa;struct pat *last_pat;
@@ -140,7 +140,7 @@ struct refill_engine {struct dmm *dmm;struct tcm *tcm; -uint8_t *refill_va; +u8 *refill_va;dma_addr_t refill_pa;/* only one trans per engine for now */
@@ -154,7 +154,7 @@ struct refill_engine { };struct dmm_platform_data { -uint32_t cpu_cache_flags; +u32 cpu_cache_flags; };struct dmm {
drivers/gpu/drm/omapdrm/omap_dmm_tiler.c +23 -23
138 lines not on this page · raw message
drivers/gpu/drm/omapdrm/omap_dmm_tiler.h +11 -11
@@ -89,30 +89,30 @@ int tiler_map_show(struct seq_file *s, void *arg);/* pin/unpin */ int tiler_pin (struct tiler_block *block,struct page **pages, -uint32_t npages,uint32_t roll,bool wait); +u32 npages,u32 roll,bool wait);int tiler_unpin (struct tiler_block *block);/* reserve/release */ -struct tiler_block *tiler_reserve_2d (enum tiler_fmt fmt,uint16_t w,uint16_t h, -uint16_t align); +struct tiler_block *tiler_reserve_2d (enum tiler_fmt fmt,u16 w,u16 h, +u16 align);struct tiler_block *tiler_reserve_1d (size_t size);int tiler_release (struct tiler_block *block);/* utilities */ dma_addr_t tiler_ssptr (struct tiler_block *block); -dma_addr_t tiler_tsptr (struct tiler_block *block,uint32_t orient, -uint32_t x,uint32_t y); -uint32_t tiler_stride (enum tiler_fmt fmt,uint32_t orient); -size_t tiler_size (enum tiler_fmt fmt,uint16_t w,uint16_t h); -size_t tiler_vsize (enum tiler_fmt fmt,uint16_t w,uint16_t h); -void tiler_align (enum tiler_fmt fmt,uint16_t *w,uint16_t *h); -uint32_t tiler_get_cpu_cache_flags (void ); +dma_addr_t tiler_tsptr (struct tiler_block *block,u32 orient, +u32 x,u32 y); +u32 tiler_stride (enum tiler_fmt fmt,u32 orient); +size_t tiler_size (enum tiler_fmt fmt,u16 w,u16 h); +size_t tiler_vsize (enum tiler_fmt fmt,u16 w,u16 h); +void tiler_align (enum tiler_fmt fmt,u16 *w,u16 *h); +u32 tiler_get_cpu_cache_flags (void );bool dmm_is_available (void );extern struct platform_driver omap_dmm_driver;/* GEM bo flags -> tiler fmt */ -static inline enum tiler_fmt gem2fmt (uint32_t flags) +static inline enum tiler_fmt gem2fmt (u32 flags) {switch (flags &OMAP_BO_TILED ) {case OMAP_BO_TILED_8 :
drivers/gpu/drm/omapdrm/omap_drv.h +2 -2
@@ -48,7 +48,7 @@struct omap_drm_usergart ;struct omap_drm_private { -uint32_t omaprev; +u32 omaprev;const struct dispc_ops *dispc_ops;
@@ -83,7 +83,7 @@ struct omap_drm_private {/* irq handling: */ spinlock_t wait_lock;/* protects the wait_list */ struct list_head wait_list;/* list of omap_irq_wait */ -uint32_t irq_mask;/* enabled irqs in addition to wait_list */ +u32 irq_mask;/* enabled irqs in addition to wait_list */ };
drivers/gpu/drm/omapdrm/omap_fb.c +9 -9
@@ -54,8 +54,8 @@ static const u32 formats[] = {/* per-plane info for the fb: */ struct plane {struct drm_gem_object *bo; -uint32_t pitch; -uint32_t offset; +u32 pitch; +u32 offset;dma_addr_t dma_addr; };
@@ -102,10 +102,10 @@ static const struct drm_framebuffer_funcs omap_framebuffer_funcs = { .destroy = omap_framebuffer_destroy, }; -static uint32_t get_linear_addr (struct plane *plane, +static u32 get_linear_addr (struct plane *plane,const struct drm_format_info *format,int n,int x,int y) { -uint32_t offset; +u32 offset; offset = plane->offset + (x * format->cpp[n] / (n ==0 ?1 : format->hsub))
@@ -123,9 +123,9 @@ bool omap_framebuffer_supports_rotation(struct drm_framebuffer *fb) }/* Note: DRM rotates counter-clockwise, TILER & DSS rotates clockwise */ -static uint32_t drm_rotation_to_tiler (unsigned int drm_rot) +static u32 drm_rotation_to_tiler (unsigned int drm_rot) { -uint32_t orient; +u32 orient;switch (drm_rot &DRM_MODE_ROTATE_MASK ) {default :
@@ -160,7 +160,7 @@ void omap_framebuffer_update_scanout(struct drm_framebuffer *fb,struct omap_framebuffer *omap_fb =to_omap_framebuffer (fb);const struct drm_format_info *format = omap_fb->format;struct plane *plane = &omap_fb->planes[0 ]; -uint32_t x, y, orient =0 ; +u32 x, y, orient =0 ; info->fourcc = fb->format->format;
@@ -179,8 +179,8 @@ void omap_framebuffer_update_scanout(struct drm_framebuffer *fb, y = state->src_y >>16 ;if (omap_gem_flags (plane->bo) &OMAP_BO_TILED ) { -uint32_t w = state->src_w >>16 ; -uint32_t h = state->src_h >>16 ; +u32 w = state->src_w >>16 ; +u32 h = state->src_h >>16 ; orient =drm_rotation_to_tiler (state->rotation);
drivers/gpu/drm/omapdrm/omap_gem.c +22 -19
136 lines not on this page · raw message
drivers/gpu/drm/omapdrm/omap_gem.h +8 -8
@@ -53,17 +53,17 @@ void omap_gem_describe_objects(struct list_head *list, struct seq_file *m);/* GEM Object Creation and Deletion */ struct drm_gem_object *omap_gem_new (struct drm_device *dev, -union omap_gem_size gsize,uint32_t flags); +union omap_gem_size gsize,u32 flags);struct drm_gem_object *omap_gem_new_dmabuf (struct drm_device *dev,size_t size,struct sg_table *sgt);int omap_gem_new_handle (struct drm_device *dev,struct drm_file *file, -union omap_gem_size gsize,uint32_t flags,uint32_t *handle); +union omap_gem_size gsize,u32 flags,u32 *handle);void omap_gem_free_object (struct drm_gem_object *obj);void *omap_gem_vaddr (struct drm_gem_object *obj);/* Dumb Buffers Interface */ int omap_gem_dumb_map_offset (struct drm_file *file,struct drm_device *dev, -uint32_t handle,uint64_t *offset); +u32 handle,u64 *offset);int omap_gem_dumb_create (struct drm_file *file,struct drm_device *dev,struct drm_mode_create_dumb *args);
@@ -71,7 +71,7 @@ int omap_gem_dumb_create(struct drm_file *file, struct drm_device *dev,int omap_gem_mmap (struct file *filp,struct vm_area_struct *vma);int omap_gem_mmap_obj (struct drm_gem_object *obj,struct vm_area_struct *vma); -uint64_t omap_gem_mmap_offset (struct drm_gem_object *obj); +u64 omap_gem_mmap_offset (struct drm_gem_object *obj);size_t omap_gem_mmap_size (struct drm_gem_object *obj);/* PRIME Interface */
@@ -81,7 +81,7 @@ struct drm_gem_object *omap_gem_prime_import(struct drm_device *dev, struct dma_buf *buffer);int omap_gem_fault (struct vm_fault *vmf); -int omap_gem_roll (struct drm_gem_object *obj,uint32_t roll); +int omap_gem_roll (struct drm_gem_object *obj,u32 roll);void omap_gem_cpu_sync_page (struct drm_gem_object *obj,int pgoff);void omap_gem_dma_sync_buffer (struct drm_gem_object *obj,enum dma_data_direction dir);
@@ -91,9 +91,9 @@ int omap_gem_get_pages(struct drm_gem_object *obj, struct page ***pages, bool remap);int omap_gem_put_pages (struct drm_gem_object *obj); -uint32_t omap_gem_flags (struct drm_gem_object *obj); -int omap_gem_rotated_dma_addr (struct drm_gem_object *obj,uint32_t orient, +u32 omap_gem_flags (struct drm_gem_object *obj); +int omap_gem_rotated_dma_addr (struct drm_gem_object *obj,u32 orient,int x,int y,dma_addr_t *dma_addr); -int omap_gem_tiled_stride (struct drm_gem_object *obj,uint32_t orient); +int omap_gem_tiled_stride (struct drm_gem_object *obj,u32 orient);#endif /* __OMAPDRM_GEM_H__ */
drivers/gpu/drm/omapdrm/omap_irq.c +3 -3
@@ -22,7 +22,7 @@struct omap_irq_wait {struct list_head node;wait_queue_head_t wq; -uint32_t irqmask; +u32 irqmask;int count; };
@@ -31,7 +31,7 @@ static void omap_irq_update(struct drm_device *dev) {struct omap_drm_private *priv = dev->dev_private;struct omap_irq_wait *wait; -uint32_t irqmask = priv->irq_mask; +u32 irqmask = priv->irq_mask;assert_spin_locked (&priv->wait_lock);
@@ -50,7 +50,7 @@ static void omap_irq_wait_handler(struct omap_irq_wait *wait) }struct omap_irq_wait *omap_irq_wait_init (struct drm_device *dev, -uint32_t irqmask,int count) +u32 irqmask,int count) {struct omap_drm_private *priv = dev->dev_private;struct omap_irq_wait *wait =kzalloc (sizeof (*wait),GFP_KERNEL );
drivers/gpu/drm/omapdrm/omap_irq.h +1 -1
@@ -32,7 +32,7 @@ void omap_drm_irq_uninstall(struct drm_device *dev);int omap_drm_irq_install (struct drm_device *dev);struct omap_irq_wait *omap_irq_wait_init (struct drm_device *dev, -uint32_t irqmask,int count); +u32 irqmask,int count);int omap_irq_wait (struct drm_device *dev,struct omap_irq_wait *wait,unsigned long timeout);
drivers/gpu/drm/omapdrm/omap_plane.c +2 -2
@@ -203,7 +203,7 @@ static void omap_plane_reset(struct drm_plane *plane)static int omap_plane_atomic_set_property (struct drm_plane *plane,struct drm_plane_state *state,struct drm_property *property, -uint64_t val) +u64 val) {struct omap_drm_private *priv = plane->dev->dev_private;
@@ -218,7 +218,7 @@ static int omap_plane_atomic_set_property(struct drm_plane *plane,static int omap_plane_atomic_get_property (struct drm_plane *plane,const struct drm_plane_state *state,struct drm_property *property, -uint64_t *val) +u64 *val) {struct omap_drm_private *priv = plane->dev->dev_private;
drivers/gpu/drm/omapdrm/tcm-sita.c +6 -6
@@ -35,8 +35,8 @@ static unsigned long mask[8];* map ptr to bitmap * stride slots in a row */ -static void free_slots (unsigned long pos,uint16_t w,uint16_t h, -unsigned long *map,uint16_t stride) +static void free_slots (unsigned long pos,u16 w,u16 h, +unsigned long *map,u16 stride) {int i;
@@ -50,7 +50,7 @@ static void free_slots(unsigned long pos, uint16_t w, uint16_t h,* map ptr to bitmap * num_bits number of bits in bitmap */ -static int r2l_b2t_1d (uint16_t w,unsigned long *pos,unsigned long *map, +static int r2l_b2t_1d (u16 w,unsigned long *pos,unsigned long *map,size_t num_bits) {unsigned long search_count =0 ;
@@ -86,7 +86,7 @@ static int r2l_b2t_1d(uint16_t w, unsigned long *pos, unsigned long *map,* num_bits = size of bitmap * stride = bits in one row of container */ -static int l2r_t2b (uint16_t w,uint16_t h,uint16_t a,int16_t offset, +static int l2r_t2b (u16 w,u16 h,u16 a,s16 offset,unsigned long *pos,unsigned long slot_bytes,unsigned long *map,size_t num_bits,size_t slot_stride) {
@@ -181,7 +181,7 @@ static s32 sita_reserve_1d(struct tcm *tcm, u32 num_slots, }static s32 sita_reserve_2d (struct tcm *tcm,u16 h,u16 w,u16 align, -int16_t offset,uint16_t slot_bytes, +s16 offset,u16 slot_bytes,struct tcm_area *area) {unsigned long pos;
@@ -210,7 +210,7 @@ static void sita_deinit(struct tcm *tcm)static s32 sita_free (struct tcm *tcm,struct tcm_area *area) {unsigned long pos; -uint16_t w, h; +u16 w, h; pos = area->p0.x + area->p0.y * tcm->width;if (area->is2d) {
drivers/gpu/drm/omapdrm/tcm.h +2 -2
@@ -67,7 +67,7 @@ struct tcm {/* function table */ s32 (*reserve_2d)(struct tcm *tcm,u16 height,u16 width,u16 align, -int16_t offset,uint16_t slot_bytes, +s16 offset,u16 slot_bytes,struct tcm_area *area);s32 (*reserve_1d)(struct tcm *tcm,u32 slots,struct tcm_area *area);s32 (*free)(struct tcm *tcm,struct tcm_area *area);
@@ -131,7 +131,7 @@ static inline void tcm_deinit(struct tcm *tcm)* allocation. */ static inline s32 tcm_reserve_2d (struct tcm *tcm,u16 width,u16 height, -u16 align,int16_t offset,uint16_t slot_bytes, +u16 align,s16 offset,u16 slot_bytes,struct tcm_area *area) {/* perform rudimentary error checking */
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 10/48] drm: omapdrm: Use kernel integer types
Hi,
Quoted 5 lines · Laurent Pinchart
The standard kernel integer types are [us]{8,16,32}. Use them instead of the u?int{8,16,32}_t types.
Signed-off-by Laurent Pinchart <[email protected]>---
-- Sebastian
Quoted 771 lines
drivers/gpu/drm/omapdrm/omap_crtc.c | 12 ++++----- drivers/gpu/drm/omapdrm/omap_crtc.h | 2 +- drivers/gpu/drm/omapdrm/omap_dmm_priv.h | 10 +++---- drivers/gpu/drm/omapdrm/omap_dmm_tiler.c | 46 ++++++++++++++++---------------- drivers/gpu/drm/omapdrm/omap_dmm_tiler.h | 22 +++++++-------- drivers/gpu/drm/omapdrm/omap_drv.h | 4 +-- drivers/gpu/drm/omapdrm/omap_fb.c | 18 ++++++------- drivers/gpu/drm/omapdrm/omap_gem.c | 41 +++++++++++++++------------- drivers/gpu/drm/omapdrm/omap_gem.h | 16 +++++------ drivers/gpu/drm/omapdrm/omap_irq.c | 6 ++--- drivers/gpu/drm/omapdrm/omap_irq.h | 2 +- drivers/gpu/drm/omapdrm/omap_plane.c | 4 +-- drivers/gpu/drm/omapdrm/tcm-sita.c | 12 ++++----- drivers/gpu/drm/omapdrm/tcm.h | 4 +-- 14 files changed, 101 insertions(+), 98 deletions(-)drivers/gpu/drm/omapdrm/omap_crtc.c +6
-6@@ -273,7 +273,7 @@ static const struct dss_mgr_ops mgr_ops = {* Setup, Flush and Page Flip */ -void omap_crtc_error_irq (struct drm_crtc *crtc,uint32_t irqstatus) +void omap_crtc_error_irq (struct drm_crtc *crtc,u32 irqstatus) {struct omap_crtc *omap_crtc =to_omap_crtc (crtc);@@ -458,7 +458,7 @@ static int omap_crtc_atomic_check(struct drm_crtc *crtc,struct drm_plane_state *pri_state;if (state->color_mgmt_changed && state->gamma_lut) { -uint length = state->gamma_lut->length / +unsigned int length = state->gamma_lut->length /sizeof (struct drm_color_lut );if (length <2 )@@ -492,7 +492,7 @@ static void omap_crtc_atomic_flush(struct drm_crtc *crtc,if (crtc->state->color_mgmt_changed) {struct drm_color_lut *lut =NULL ; -uint length =0 ; +unsigned int length =0 ;if (crtc->state->gamma_lut) { lut = (struct drm_color_lut *)@@ -523,7 +523,7 @@ static void omap_crtc_atomic_flush(struct drm_crtc *crtc,static int omap_crtc_atomic_set_property (struct drm_crtc *crtc,struct drm_crtc_state *state,struct drm_property *property, -uint64_t val) +u64 val) {struct omap_drm_private *priv = crtc->dev->dev_private;struct drm_plane_state *plane_state;@@ -551,7 +551,7 @@ static int omap_crtc_atomic_set_property(struct drm_crtc *crtc,static int omap_crtc_atomic_get_property (struct drm_crtc *crtc,const struct drm_crtc_state *state,struct drm_property *property, -uint64_t *val) +u64 *val) {struct omap_drm_private *priv = crtc->dev->dev_private;struct omap_crtc_state *omap_state =to_omap_crtc_state (state);@@ -697,7 +697,7 @@ struct drm_crtc *omap_crtc_init(struct drm_device *dev,* gamma table is not supprted. */ if (priv->dispc_ops->mgr_gamma_size (channel)) { -uint gamma_lut_size =256 ; +unsigned int gamma_lut_size =256 ;drm_crtc_enable_color_mgmt (crtc,0 , false, gamma_lut_size);drm_mode_crtc_set_gamma_size (crtc, gamma_lut_size);drivers/gpu/drm/omapdrm/omap_crtc.h +1
-1@@ -37,7 +37,7 @@ void omap_crtc_pre_uninit(void);struct drm_crtc *omap_crtc_init (struct drm_device *dev,struct drm_plane *plane,struct omap_dss_device *dssdev);int omap_crtc_wait_pending (struct drm_crtc *crtc); -void omap_crtc_error_irq (struct drm_crtc *crtc,uint32_t irqstatus); +void omap_crtc_error_irq (struct drm_crtc *crtc,u32 irqstatus);void omap_crtc_vblank_irq (struct drm_crtc *crtc);#endif /* __OMAPDRM_CRTC_H__ */ drivers/gpu/drm/omapdrm/omap_dmm_priv.h +5
-5@@ -102,10 +102,10 @@ struct pat_ctrl { };struct pat { -uint32_t next_pa; +u32 next_pa;struct pat_area area;struct pat_ctrl ctrl; -uint32_t data_pa; +u32 data_pa; };#define DMM_FIXED_RETRY_COUNT 1000@@ -129,7 +129,7 @@ struct dmm_txn {void *engine_handle;struct tcm *tcm; -uint8_t *current_va; +u8 *current_va;dma_addr_t current_pa;struct pat *last_pat;@@ -140,7 +140,7 @@ struct refill_engine {struct dmm *dmm;struct tcm *tcm; -uint8_t *refill_va; +u8 *refill_va;dma_addr_t refill_pa;/* only one trans per engine for now */ @@ -154,7 +154,7 @@ struct refill_engine { };struct dmm_platform_data { -uint32_t cpu_cache_flags; +u32 cpu_cache_flags; };struct dmm {drivers/gpu/drm/omapdrm/omap_dmm_tiler.c +23
-23@@ -59,11 +59,11 @@ static DEFINE_SPINLOCK(list_lock); }static const struct { -uint32_t x_shft;/* unused X-bits (as part of bpp) */ -uint32_t y_shft;/* unused Y-bits (as part of bpp) */ -uint32_t cpp;/* bytes/chars per pixel */ -uint32_t slot_w;/* width of each slot (in pixels) */ -uint32_t slot_h;/* height of each slot (in pixels) */ +u32 x_shft;/* unused X-bits (as part of bpp) */ +u32 y_shft;/* unused Y-bits (as part of bpp) */ +u32 cpp;/* bytes/chars per pixel */ +u32 slot_w;/* width of each slot (in pixels) */ +u32 slot_h;/* height of each slot (in pixels) */ } geom[TILFMT_NFORMATS ] = { [TILFMT_8BIT ] =GEOM (0 ,0 ,1 ), [TILFMT_16BIT ] =GEOM (0 ,1 ,2 ),@@ -73,7 +73,7 @@ static const struct {/* lookup table for registers w/ per-engine instances */ -static const uint32_t reg[][4 ] = { +static const u32 reg[][4 ] = { [PAT_STATUS ] = {DMM_PAT_STATUS__0 ,DMM_PAT_STATUS__1 ,DMM_PAT_STATUS__2 ,DMM_PAT_STATUS__3 }, [PAT_DESCR ] = {DMM_PAT_DESCR__0 ,DMM_PAT_DESCR__1 ,@@ -112,10 +112,10 @@ static void *alloc_dma(struct dmm_txn *txn, size_t sz, dma_addr_t *pa) }/* check status and spin until wait_mask comes true */ -static int wait_status (struct refill_engine *engine,uint32_t wait_mask) +static int wait_status (struct refill_engine *engine,u32 wait_mask) {struct dmm *dmm = engine->dmm; -uint32_t r =0 , err, i; +u32 r =0 , err, i; i =DMM_FIXED_RETRY_COUNT ;while (true) {@@ -151,7 +151,7 @@ static void release_engine(struct refill_engine *engine)static irqreturn_t omap_dmm_irq_handler (int irq,void *arg) {struct dmm *dmm = arg; -uint32_t status =dmm_read (dmm,DMM_PAT_IRQSTATUS ); +u32 status =dmm_read (dmm,DMM_PAT_IRQSTATUS );int i;/* ack IRQ */ @@ -214,10 +214,10 @@ static struct dmm_txn *dmm_txn_init(struct dmm *dmm, struct tcm *tcm)* corresponding slot is cleared (ie. dummy_pa is programmed) */ static void dmm_txn_append (struct dmm_txn *txn,struct pat_area *area, -struct page **pages,uint32_t npages,uint32_t roll) +struct page **pages,u32 npages,u32 roll) {dma_addr_t pat_pa =0 , data_pa =0 ; -uint32_t *data; +u32 *data;struct pat *pat;struct refill_engine *engine = txn->engine_handle;int columns = (1 + area->x1 - area->x0);@@ -227,7 +227,7 @@ static void dmm_txn_append(struct dmm_txn *txn, struct pat_area *area, pat =alloc_dma (txn,sizeof (*pat), &pat_pa);if (txn->last_pat) - txn->last_pat->next_pa = (uint32_t )pat_pa; + txn->last_pat->next_pa = (u32 )pat_pa; pat->area = *area;@@ -313,7 +313,7 @@ static int dmm_txn_commit(struct dmm_txn *txn, bool wait)* DMM programming */ static int fill (struct tcm_area *area,struct page **pages, -uint32_t npages,uint32_t roll,bool wait) +u32 npages,u32 roll,bool wait) {int ret =0 ;struct tcm_area slice, area_s;@@ -361,7 +361,7 @@ static int fill(struct tcm_area *area, struct page **pages,/* note: slots for which pages[i] == NULL are filled w/ dummy page */ int tiler_pin (struct tiler_block *block,struct page **pages, -uint32_t npages,uint32_t roll,bool wait) +u32 npages,u32 roll,bool wait) {int ret;@@ -381,8 +381,8 @@ int tiler_unpin(struct tiler_block *block)/* * Reserve/release */ -struct tiler_block *tiler_reserve_2d (enum tiler_fmt fmt,uint16_t w, -uint16_t h,uint16_t align) +struct tiler_block *tiler_reserve_2d (enum tiler_fmt fmt,u16 w, +u16 h,u16 align) {struct tiler_block *block =kzalloc (sizeof (*block),GFP_KERNEL );u32 min_align =128 ;@@ -525,8 +525,8 @@ dma_addr_t tiler_ssptr(struct tiler_block *block) block->area.p0.y * geom[block->fmt].slot_h); } -dma_addr_t tiler_tsptr (struct tiler_block *block,uint32_t orient, -uint32_t x,uint32_t y) +dma_addr_t tiler_tsptr (struct tiler_block *block,u32 orient, +u32 x,u32 y) {struct tcm_pt *p = &block->area.p0;BUG_ON (!validfmt (block->fmt));@@ -536,14 +536,14 @@ dma_addr_t tiler_tsptr(struct tiler_block *block, uint32_t orient, (p->y * geom[block->fmt].slot_h) + y); } -void tiler_align (enum tiler_fmt fmt,uint16_t *w,uint16_t *h) +void tiler_align (enum tiler_fmt fmt,u16 *w,u16 *h) {BUG_ON (!validfmt (fmt)); *w =round_up (*w, geom[fmt].slot_w); *h =round_up (*h, geom[fmt].slot_h); } -uint32_t tiler_stride (enum tiler_fmt fmt,uint32_t orient) +u32 tiler_stride (enum tiler_fmt fmt,u32 orient) {BUG_ON (!validfmt (fmt));@@ -553,19 +553,19 @@ uint32_t tiler_stride(enum tiler_fmt fmt, uint32_t orient)return 1 << (CONT_WIDTH_BITS + geom[fmt].y_shft); } -size_t tiler_size (enum tiler_fmt fmt,uint16_t w,uint16_t h) +size_t tiler_size (enum tiler_fmt fmt,u16 w,u16 h) {tiler_align (fmt, &w, &h);return geom[fmt].cpp * w * h; } -size_t tiler_vsize (enum tiler_fmt fmt,uint16_t w,uint16_t h) +size_t tiler_vsize (enum tiler_fmt fmt,u16 w,u16 h) {BUG_ON (!validfmt (fmt));return round_up (geom[fmt].cpp * w,PAGE_SIZE ) * h; } -uint32_t tiler_get_cpu_cache_flags (void ) +u32 tiler_get_cpu_cache_flags (void ) {return omap_dmm->plat_data->cpu_cache_flags; }drivers/gpu/drm/omapdrm/omap_dmm_tiler.h +11
-11@@ -89,30 +89,30 @@ int tiler_map_show(struct seq_file *s, void *arg);/* pin/unpin */ int tiler_pin (struct tiler_block *block,struct page **pages, -uint32_t npages,uint32_t roll,bool wait); +u32 npages,u32 roll,bool wait);int tiler_unpin (struct tiler_block *block);/* reserve/release */ -struct tiler_block *tiler_reserve_2d (enum tiler_fmt fmt,uint16_t w,uint16_t h, -uint16_t align); +struct tiler_block *tiler_reserve_2d (enum tiler_fmt fmt,u16 w,u16 h, +u16 align);struct tiler_block *tiler_reserve_1d (size_t size);int tiler_release (struct tiler_block *block);/* utilities */ dma_addr_t tiler_ssptr (struct tiler_block *block); -dma_addr_t tiler_tsptr (struct tiler_block *block,uint32_t orient, -uint32_t x,uint32_t y); -uint32_t tiler_stride (enum tiler_fmt fmt,uint32_t orient); -size_t tiler_size (enum tiler_fmt fmt,uint16_t w,uint16_t h); -size_t tiler_vsize (enum tiler_fmt fmt,uint16_t w,uint16_t h); -void tiler_align (enum tiler_fmt fmt,uint16_t *w,uint16_t *h); -uint32_t tiler_get_cpu_cache_flags (void ); +dma_addr_t tiler_tsptr (struct tiler_block *block,u32 orient, +u32 x,u32 y); +u32 tiler_stride (enum tiler_fmt fmt,u32 orient); +size_t tiler_size (enum tiler_fmt fmt,u16 w,u16 h); +size_t tiler_vsize (enum tiler_fmt fmt,u16 w,u16 h); +void tiler_align (enum tiler_fmt fmt,u16 *w,u16 *h); +u32 tiler_get_cpu_cache_flags (void );bool dmm_is_available (void );extern struct platform_driver omap_dmm_driver;/* GEM bo flags -> tiler fmt */ -static inline enum tiler_fmt gem2fmt (uint32_t flags) +static inline enum tiler_fmt gem2fmt (u32 flags) {switch (flags &OMAP_BO_TILED ) {case OMAP_BO_TILED_8 :drivers/gpu/drm/omapdrm/omap_drv.h +2
-2@@ -48,7 +48,7 @@struct omap_drm_usergart ;struct omap_drm_private { -uint32_t omaprev; +u32 omaprev;const struct dispc_ops *dispc_ops;@@ -83,7 +83,7 @@ struct omap_drm_private {/* irq handling: */ spinlock_t wait_lock;/* protects the wait_list */ struct list_head wait_list;/* list of omap_irq_wait */ -uint32_t irq_mask;/* enabled irqs in addition to wait_list */ +u32 irq_mask;/* enabled irqs in addition to wait_list */ };drivers/gpu/drm/omapdrm/omap_fb.c +9
-9@@ -54,8 +54,8 @@ static const u32 formats[] = {/* per-plane info for the fb: */ struct plane {struct drm_gem_object *bo; -uint32_t pitch; -uint32_t offset; +u32 pitch; +u32 offset;dma_addr_t dma_addr; };@@ -102,10 +102,10 @@ static const struct drm_framebuffer_funcs omap_framebuffer_funcs = { .destroy = omap_framebuffer_destroy, }; -static uint32_t get_linear_addr (struct plane *plane, +static u32 get_linear_addr (struct plane *plane,const struct drm_format_info *format,int n,int x,int y) { -uint32_t offset; +u32 offset; offset = plane->offset + (x * format->cpp[n] / (n ==0 ?1 : format->hsub))@@ -123,9 +123,9 @@ bool omap_framebuffer_supports_rotation(struct drm_framebuffer *fb) }/* Note: DRM rotates counter-clockwise, TILER & DSS rotates clockwise */ -static uint32_t drm_rotation_to_tiler (unsigned int drm_rot) +static u32 drm_rotation_to_tiler (unsigned int drm_rot) { -uint32_t orient; +u32 orient;switch (drm_rot &DRM_MODE_ROTATE_MASK ) {default :@@ -160,7 +160,7 @@ void omap_framebuffer_update_scanout(struct drm_framebuffer *fb,struct omap_framebuffer *omap_fb =to_omap_framebuffer (fb);const struct drm_format_info *format = omap_fb->format;struct plane *plane = &omap_fb->planes[0 ]; -uint32_t x, y, orient =0 ; +u32 x, y, orient =0 ; info->fourcc = fb->format->format;@@ -179,8 +179,8 @@ void omap_framebuffer_update_scanout(struct drm_framebuffer *fb, y = state->src_y >>16 ;if (omap_gem_flags (plane->bo) &OMAP_BO_TILED ) { -uint32_t w = state->src_w >>16 ; -uint32_t h = state->src_h >>16 ; +u32 w = state->src_w >>16 ; +u32 h = state->src_h >>16 ; orient =drm_rotation_to_tiler (state->rotation);drivers/gpu/drm/omapdrm/omap_gem.c +22
-19@@ -41,13 +41,13 @@ struct omap_gem_object {struct list_head mm_list; -uint32_t flags; +u32 flags;/** width/height for tiled formats (rounded up to slot boundaries) */ -uint16_t width, height; +u16 width, height;/** roll applied when mapping to DMM */ -uint32_t roll; +u32 roll;/** * dma_addr contains the buffer DMA address. It is valid for @@ -75,7 +75,7 @@ struct omap_gem_object {/** * # of users of dma_addr */ -uint32_t dma_addr_cnt; +u32 dma_addr_cnt;/** * If the buffer has been imported from a dmabuf the OMAP_DB_DMABUF flag @@ -139,7 +139,7 @@ struct omap_drm_usergart {*/ /** get mmap offset */ -static uint64_t mmap_offset (struct drm_gem_object *obj) +static u64 mmap_offset (struct drm_gem_object *obj) {struct drm_device *dev = obj->dev;int ret;@@ -333,14 +333,15 @@ static void omap_gem_detach_pages(struct drm_gem_object *obj) }/* get buffer flags */ -uint32_t omap_gem_flags (struct drm_gem_object *obj) +u32 omap_gem_flags (struct drm_gem_object *obj) {return to_omap_bo (obj)->flags; } -uint64_t omap_gem_mmap_offset (struct drm_gem_object *obj) +u64 omap_gem_mmap_offset (struct drm_gem_object *obj) { -uint64_t offset; +u64 offset; +mutex_lock (&obj->dev->struct_mutex); offset =mmap_offset (obj);mutex_unlock (&obj->dev->struct_mutex);@@ -651,7 +652,7 @@ int omap_gem_dumb_create(struct drm_file *file, struct drm_device *dev,* into user memory. We don't have to do much here at the moment. */ int omap_gem_dumb_map_offset (struct drm_file *file,struct drm_device *dev, -uint32_t handle,uint64_t *offset) +u32 handle,u64 *offset) {struct drm_gem_object *obj;int ret =0 ;@@ -677,10 +678,10 @@ int omap_gem_dumb_map_offset(struct drm_file *file, struct drm_device *dev,* * Call only from non-atomic contexts. */ -int omap_gem_roll (struct drm_gem_object *obj,uint32_t roll) +int omap_gem_roll (struct drm_gem_object *obj,u32 roll) {struct omap_gem_object *omap_obj =to_omap_bo (obj); -uint32_t npages = obj->size >>PAGE_SHIFT ; +u32 npages = obj->size >>PAGE_SHIFT ;int ret =0 ;if (roll > npages) {@@ -810,7 +811,7 @@ int omap_gem_pin(struct drm_gem_object *obj, dma_addr_t *dma_addr)if (!is_contiguous (omap_obj) && priv->has_dmm) {if (omap_obj->dma_addr_cnt ==0 ) {struct page **pages; -uint32_t npages = obj->size >>PAGE_SHIFT ; +u32 npages = obj->size >>PAGE_SHIFT ;enum tiler_fmt fmt =gem2fmt (omap_obj->flags);struct tiler_block *block;@@ -906,7 +907,7 @@ void omap_gem_unpin(struct drm_gem_object *obj)* specified orientation and x,y offset from top-left corner of buffer * (only valid for tiled 2d buffers) */ -int omap_gem_rotated_dma_addr (struct drm_gem_object *obj,uint32_t orient, +int omap_gem_rotated_dma_addr (struct drm_gem_object *obj,u32 orient,int x,int y,dma_addr_t *dma_addr) {struct omap_gem_object *omap_obj =to_omap_bo (obj);@@ -923,7 +924,7 @@ int omap_gem_rotated_dma_addr(struct drm_gem_object *obj, uint32_t orient, }/* Get tiler stride for the buffer (only valid for 2d tiled buffers) */ -int omap_gem_tiled_stride (struct drm_gem_object *obj,uint32_t orient) +int omap_gem_tiled_stride (struct drm_gem_object *obj,u32 orient) {struct omap_gem_object *omap_obj =to_omap_bo (obj);int ret = -EINVAL ;@@ -1005,7 +1006,8 @@ int omap_gem_resume(struct drm_device *dev)list_for_each_entry (omap_obj, &priv->obj_list, mm_list) {if (omap_obj->block) {struct drm_gem_object *obj = &omap_obj->base; -uint32_t npages = obj->size >>PAGE_SHIFT ; +u32 npages = obj->size >>PAGE_SHIFT ; +WARN_ON (!omap_obj->pages);/* this can't happen */ ret = tiler_pin(omap_obj->block, omap_obj->pages, npages,@@ -1029,7 +1031,7 @@ int omap_gem_resume(struct drm_device *dev)void omap_gem_describe (struct drm_gem_object *obj,struct seq_file *m) {struct omap_gem_object *omap_obj =to_omap_bo (obj); -uint64_t off; +u64 off; off =drm_vma_node_start (&obj->vma_node);@@ -1117,7 +1119,7 @@ void omap_gem_free_object(struct drm_gem_object *obj)/* GEM buffer object constructor */ struct drm_gem_object *omap_gem_new (struct drm_device *dev, -union omap_gem_size gsize,uint32_t flags) +union omap_gem_size gsize,u32 flags) {struct omap_drm_private *priv = dev->dev_private;struct omap_gem_object *omap_obj;@@ -1282,7 +1284,7 @@ struct drm_gem_object *omap_gem_new_dmabuf(struct drm_device *dev, size_t size,/* convenience method to construct a GEM buffer object, and userspace handle */ int omap_gem_new_handle (struct drm_device *dev,struct drm_file *file, -union omap_gem_size gsize,uint32_t flags,uint32_t *handle) +union omap_gem_size gsize,u32 flags,u32 *handle) {struct drm_gem_object *obj;int ret;@@ -1329,7 +1331,8 @@ void omap_gem_init(struct drm_device *dev)/* reserve 4k aligned/wide regions for userspace mappings: */ for (i =0 ; i <ARRAY_SIZE (fmts); i++) { -uint16_t h =1 , w =PAGE_SIZE >> i; +u16 h =1 , w =PAGE_SIZE >> i; +tiler_align (fmts[i], &w, &h);/* note: since each region is 1 4kb page wide, and minimum * number of rows, the height ends up being the same as the drivers/gpu/drm/omapdrm/omap_gem.h +8
-8@@ -53,17 +53,17 @@ void omap_gem_describe_objects(struct list_head *list, struct seq_file *m);/* GEM Object Creation and Deletion */ struct drm_gem_object *omap_gem_new (struct drm_device *dev, -union omap_gem_size gsize,uint32_t flags); +union omap_gem_size gsize,u32 flags);struct drm_gem_object *omap_gem_new_dmabuf (struct drm_device *dev,size_t size,struct sg_table *sgt);int omap_gem_new_handle (struct drm_device *dev,struct drm_file *file, -union omap_gem_size gsize,uint32_t flags,uint32_t *handle); +union omap_gem_size gsize,u32 flags,u32 *handle);void omap_gem_free_object (struct drm_gem_object *obj);void *omap_gem_vaddr (struct drm_gem_object *obj);/* Dumb Buffers Interface */ int omap_gem_dumb_map_offset (struct drm_file *file,struct drm_device *dev, -uint32_t handle,uint64_t *offset); +u32 handle,u64 *offset);int omap_gem_dumb_create (struct drm_file *file,struct drm_device *dev,struct drm_mode_create_dumb *args);@@ -71,7 +71,7 @@ int omap_gem_dumb_create(struct drm_file *file, struct drm_device *dev,int omap_gem_mmap (struct file *filp,struct vm_area_struct *vma);int omap_gem_mmap_obj (struct drm_gem_object *obj,struct vm_area_struct *vma); -uint64_t omap_gem_mmap_offset (struct drm_gem_object *obj); +u64 omap_gem_mmap_offset (struct drm_gem_object *obj);size_t omap_gem_mmap_size (struct drm_gem_object *obj);/* PRIME Interface */ @@ -81,7 +81,7 @@ struct drm_gem_object *omap_gem_prime_import(struct drm_device *dev, struct dma_buf *buffer);int omap_gem_fault (struct vm_fault *vmf); -int omap_gem_roll (struct drm_gem_object *obj,uint32_t roll); +int omap_gem_roll (struct drm_gem_object *obj,u32 roll);void omap_gem_cpu_sync_page (struct drm_gem_object *obj,int pgoff);void omap_gem_dma_sync_buffer (struct drm_gem_object *obj,enum dma_data_direction dir);@@ -91,9 +91,9 @@ int omap_gem_get_pages(struct drm_gem_object *obj, struct page ***pages, bool remap);int omap_gem_put_pages (struct drm_gem_object *obj); -uint32_t omap_gem_flags (struct drm_gem_object *obj); -int omap_gem_rotated_dma_addr (struct drm_gem_object *obj,uint32_t orient, +u32 omap_gem_flags (struct drm_gem_object *obj); +int omap_gem_rotated_dma_addr (struct drm_gem_object *obj,u32 orient,int x,int y,dma_addr_t *dma_addr); -int omap_gem_tiled_stride (struct drm_gem_object *obj,uint32_t orient); +int omap_gem_tiled_stride (struct drm_gem_object *obj,u32 orient);#endif /* __OMAPDRM_GEM_H__ */ drivers/gpu/drm/omapdrm/omap_irq.c +3
-3@@ -22,7 +22,7 @@struct omap_irq_wait {struct list_head node;wait_queue_head_t wq; -uint32_t irqmask; +u32 irqmask;int count; };@@ -31,7 +31,7 @@ static void omap_irq_update(struct drm_device *dev) {struct omap_drm_private *priv = dev->dev_private;struct omap_irq_wait *wait; -uint32_t irqmask = priv->irq_mask; +u32 irqmask = priv->irq_mask;assert_spin_locked (&priv->wait_lock);@@ -50,7 +50,7 @@ static void omap_irq_wait_handler(struct omap_irq_wait *wait) }struct omap_irq_wait *omap_irq_wait_init (struct drm_device *dev, -uint32_t irqmask,int count) +u32 irqmask,int count) {struct omap_drm_private *priv = dev->dev_private;struct omap_irq_wait *wait =kzalloc (sizeof (*wait),GFP_KERNEL );drivers/gpu/drm/omapdrm/omap_irq.h +1
-1@@ -32,7 +32,7 @@ void omap_drm_irq_uninstall(struct drm_device *dev);int omap_drm_irq_install (struct drm_device *dev);struct omap_irq_wait *omap_irq_wait_init (struct drm_device *dev, -uint32_t irqmask,int count); +u32 irqmask,int count);int omap_irq_wait (struct drm_device *dev,struct omap_irq_wait *wait,unsigned long timeout);drivers/gpu/drm/omapdrm/omap_plane.c +2
-2@@ -203,7 +203,7 @@ static void omap_plane_reset(struct drm_plane *plane)static int omap_plane_atomic_set_property (struct drm_plane *plane,struct drm_plane_state *state,struct drm_property *property, -uint64_t val) +u64 val) {struct omap_drm_private *priv = plane->dev->dev_private;@@ -218,7 +218,7 @@ static int omap_plane_atomic_set_property(struct drm_plane *plane,static int omap_plane_atomic_get_property (struct drm_plane *plane,const struct drm_plane_state *state,struct drm_property *property, -uint64_t *val) +u64 *val) {struct omap_drm_private *priv = plane->dev->dev_private;drivers/gpu/drm/omapdrm/tcm-sita.c +6
-6@@ -35,8 +35,8 @@ static unsigned long mask[8];* map ptr to bitmap * stride slots in a row */ -static void free_slots (unsigned long pos,uint16_t w,uint16_t h, -unsigned long *map,uint16_t stride) +static void free_slots (unsigned long pos,u16 w,u16 h, +unsigned long *map,u16 stride) {int i;@@ -50,7 +50,7 @@ static void free_slots(unsigned long pos, uint16_t w, uint16_t h,* map ptr to bitmap * num_bits number of bits in bitmap */ -static int r2l_b2t_1d (uint16_t w,unsigned long *pos,unsigned long *map, +static int r2l_b2t_1d (u16 w,unsigned long *pos,unsigned long *map,size_t num_bits) {unsigned long search_count =0 ;@@ -86,7 +86,7 @@ static int r2l_b2t_1d(uint16_t w, unsigned long *pos, unsigned long *map,* num_bits = size of bitmap * stride = bits in one row of container */ -static int l2r_t2b (uint16_t w,uint16_t h,uint16_t a,int16_t offset, +static int l2r_t2b (u16 w,u16 h,u16 a,s16 offset,unsigned long *pos,unsigned long slot_bytes,unsigned long *map,size_t num_bits,size_t slot_stride) {@@ -181,7 +181,7 @@ static s32 sita_reserve_1d(struct tcm *tcm, u32 num_slots, }static s32 sita_reserve_2d (struct tcm *tcm,u16 h,u16 w,u16 align, -int16_t offset,uint16_t slot_bytes, +s16 offset,u16 slot_bytes,struct tcm_area *area) {unsigned long pos;@@ -210,7 +210,7 @@ static void sita_deinit(struct tcm *tcm)static s32 sita_free (struct tcm *tcm,struct tcm_area *area) {unsigned long pos; -uint16_t w, h; +u16 w, h; pos = area->p0.x + area->p0.y * tcm->width;if (area->is2d) {drivers/gpu/drm/omapdrm/tcm.h +2
-2@@ -67,7 +67,7 @@ struct tcm {/* function table */ s32 (*reserve_2d)(struct tcm *tcm,u16 height,u16 width,u16 align, -int16_t offset,uint16_t slot_bytes, +s16 offset,u16 slot_bytes,struct tcm_area *area);s32 (*reserve_1d)(struct tcm *tcm,u32 slots,struct tcm_area *area);s32 (*free)(struct tcm *tcm,struct tcm_area *area);@@ -131,7 +131,7 @@ static inline void tcm_deinit(struct tcm *tcm)* allocation. */ static inline s32 tcm_reserve_2d (struct tcm *tcm,u16 width,u16 height, -u16 align,int16_t offset,uint16_t slot_bytes, +u16 align,s16 offset,u16 slot_bytes,struct tcm_area *area) {/* perform rudimentary error checking */ 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 11/48 drm: omapdrm: Use unsigned int type
In reply to Laurent PinchartThe kernel favours 'unsigned int' over plain 'unsigned'. Replace all occurences of the latter by the former. This avoid lots of checkpatch complaints in patches that touch lines where a plain 'unsigned' is used.
--- drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 8 +- .../drm/omapdrm/displays/panel-sony-acx565akm.c | 6 +- drivers/gpu/drm/omapdrm/dss/dispc.c | 25 +++--- drivers/gpu/drm/omapdrm/dss/dpi.c | 2 +- drivers/gpu/drm/omapdrm/dss/dsi.c | 98 +++++++++++----------- drivers/gpu/drm/omapdrm/dss/dss.c | 12 +-- drivers/gpu/drm/omapdrm/dss/dss.h | 12 +-- drivers/gpu/drm/omapdrm/dss/hdmi4.c | 2 +- drivers/gpu/drm/omapdrm/dss/hdmi5.c | 2 +- drivers/gpu/drm/omapdrm/dss/hdmi5_core.c | 24 +++--- drivers/gpu/drm/omapdrm/dss/hdmi_phy.c | 2 +- drivers/gpu/drm/omapdrm/dss/hdmi_wp.c | 2 +- drivers/gpu/drm/omapdrm/dss/omapdss.h | 4 +- drivers/gpu/drm/omapdrm/dss/pll.c | 4 +- 14 files changed, 102 insertions(+), 101 deletions(-)
drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +4 -4
@@ -78,7 +78,7 @@ struct panel_drv_data {struct workqueue_struct *workqueue;bool ulps_enabled; -unsigned ulps_timeout; +unsigned int ulps_timeout;struct delayed_work ulps_work; };
@@ -483,7 +483,7 @@ static ssize_t dsicm_show_ulps(struct device *dev, {struct platform_device *pdev =to_platform_device (dev);struct panel_drv_data *ddata =platform_get_drvdata (pdev); -unsigned t; +unsigned int t;mutex_lock (&ddata->lock); t = ddata->ulps_enabled;
@@ -530,7 +530,7 @@ static ssize_t dsicm_show_ulps_timeout(struct device *dev, {struct platform_device *pdev =to_platform_device (dev);struct panel_drv_data *ddata =platform_get_drvdata (pdev); -unsigned t; +unsigned int t;mutex_lock (&ddata->lock); t = ddata->ulps_timeout;
@@ -1004,7 +1004,7 @@ static int dsicm_memory_read(struct omap_dss_device *dssdev,int r;int first =1 ;int plen; -unsigned buf_used =0 ; +unsigned int buf_used =0 ;if (size < w * h *3 )return -ENOMEM ;
drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c +3 -3
@@ -289,7 +289,7 @@ static void enable_backlight_ctrl(struct panel_drv_data *ddata, int enable)acx565akm_write (ddata,MIPID_CMD_WRITE_CTRL_DISP , (u8 *)&ctrl,2 ); } -static void set_cabc_mode (struct panel_drv_data *ddata,unsigned mode) +static void set_cabc_mode (struct panel_drv_data *ddata,unsigned int mode) {u16 cabc_ctrl;
@@ -303,12 +303,12 @@ static void set_cabc_mode(struct panel_drv_data *ddata, unsigned mode)acx565akm_write (ddata,MIPID_CMD_WRITE_CABC , (u8 *)&cabc_ctrl,2 ); } -static unsigned get_cabc_mode (struct panel_drv_data *ddata) +static unsigned int get_cabc_mode (struct panel_drv_data *ddata) {return ddata->cabc_mode; } -static unsigned get_hw_cabc_mode (struct panel_drv_data *ddata) +static unsigned int get_hw_cabc_mode (struct panel_drv_data *ddata) {u8 cabc_ctrl;
drivers/gpu/drm/omapdrm/dss/dispc.c +12 -13
@@ -971,7 +971,7 @@ static void dispc_ovl_set_pre_mult_alpha(enum omap_plane_id plane,static void dispc_ovl_setup_global_alpha (enum omap_plane_id plane,enum omap_overlay_caps caps,u8 global_alpha) { -static const unsigned shifts[] = {0 ,8 ,16 ,24 , }; +static const unsigned int shifts[] = {0 ,8 ,16 ,24 , };int shift;if ((caps &OMAP_DSS_OVL_CAP_GLOBAL_ALPHA ) ==0 )
@@ -1199,7 +1199,7 @@ void dispc_wb_set_channel_in(enum dss_writeback_channel channel)static void dispc_ovl_set_burst_size (enum omap_plane_id plane,enum omap_burst_size burst_size) { -static const unsigned shifts[] = {6 ,14 ,14 ,14 ,14 , }; +static const unsigned int shifts[] = {6 ,14 ,14 ,14 ,14 , };int shift; shift = shifts[plane];
@@ -1287,7 +1287,7 @@ static void dispc_ovl_set_vid_color_conv(enum omap_plane_id plane,static void dispc_ovl_enable_replication (enum omap_plane_id plane,enum omap_overlay_caps caps,bool enable) { -static const unsigned shifts[] = {5 ,10 ,10 ,10 }; +static const unsigned int shifts[] = {5 ,10 ,10 ,10 };int shift;if ((caps &OMAP_DSS_OVL_CAP_REPLICATION ) ==0 )
@@ -1452,9 +1452,8 @@ void dispc_ovl_compute_fifo_thresholds(enum omap_plane_id plane,* All sizes are in bytes. Both the buffer and burst are made of * buffer_units, and the fifo thresholds must be buffer_unit aligned. */ - -unsigned buf_unit = dispc.feat->buffer_size_unit; -unsigned ovl_fifo_size, total_fifo_size, burst_size; +unsigned int buf_unit = dispc.feat->buffer_size_unit; +unsigned int ovl_fifo_size, total_fifo_size, burst_size;int i; burst_size =dispc_ovl_get_burst_size (plane);
@@ -2008,8 +2007,8 @@ static s32 pixinc(int pixels, u8 ps) }static void calc_offset (u16 screen_width,u16 width, -u32 fourcc,bool fieldmode, -unsigned int field_offset,unsigned *offset0,unsigned *offset1, +u32 fourcc,bool fieldmode,unsigned int field_offset, +unsigned int *offset0,unsigned int *offset1,s32 *row_inc,s32 *pix_inc,int x_predecim,int y_predecim,enum omap_dss_rotation_type rotation_type,u8 rotation) {
@@ -2479,7 +2478,7 @@ static int dispc_ovl_setup_common(enum omap_plane_id plane,bool five_taps = true;bool fieldmode = false;int r, cconv =0 ; -unsigned offset0, offset1; +unsigned int offset0, offset1;s32 row_inc;s32 pix_inc;u16 frame_width, frame_height;
@@ -3042,7 +3041,7 @@ static int vm_flag_to_int(enum display_flags flags, enum display_flags high,static void dispc_mgr_set_timings (enum omap_channel channel,const struct videomode *vm) { -unsigned xtot, ytot; +unsigned int xtot, ytot;unsigned long ht, vt;struct videomode t = *vm;
@@ -3121,7 +3120,7 @@ static unsigned long dispc_fclk_rate(void) r =dss_get_dispc_clk_rate (); }else {struct dss_pll *pll; -unsigned clkout_idx; +unsigned int clkout_idx; pll =dss_pll_find_by_src (src); clkout_idx =dss_pll_get_clkout_idx_for_src (src);
@@ -3148,7 +3147,7 @@ static unsigned long dispc_mgr_lclk_rate(enum omap_channel channel) r =dss_get_dispc_clk_rate (); }else {struct dss_pll *pll; -unsigned clkout_idx; +unsigned int clkout_idx; pll =dss_pll_find_by_src (src); clkout_idx =dss_pll_get_clkout_idx_for_src (src);
@@ -3489,7 +3488,7 @@ bool dispc_div_calc(unsigned long dispc_freq,unsigned long pck, lck;unsigned long lck_max;unsigned long pckd_hw_min, pckd_hw_max; -unsigned min_fck_per_pck; +unsigned int min_fck_per_pck;unsigned long fck;#ifdef CONFIG_OMAP2_DSS_MIN_FCK_PER_PCK
drivers/gpu/drm/omapdrm/dss/dpi.c +1 -1
@@ -143,7 +143,7 @@ static enum dss_clk_source dpi_get_clk_src(struct dpi_data *dpi)struct dpi_clk_calc_ctx {struct dss_pll *pll; -unsigned clkout_idx; +unsigned int clkout_idx;/* inputs */
drivers/gpu/drm/omapdrm/dss/dsi.c +50 -48
257 lines not on this page · raw message
drivers/gpu/drm/omapdrm/dss/dss.c +6 -6
@@ -183,8 +183,8 @@ static void dss_restore_context(void)void dss_ctrl_pll_enable (enum dss_pll_id pll_id,bool enable) { -unsigned shift; -unsigned val; +unsigned int shift; +unsigned int val;if (!dss.syscon_pll_ctrl)return ;
@@ -213,7 +213,7 @@ void dss_ctrl_pll_enable(enum dss_pll_id pll_id, bool enable)static int dss_ctrl_pll_set_control_mux (enum dss_clk_source clk_src,enum omap_channel channel) { -unsigned shift, val; +unsigned int shift, val;if (!dss.syscon_pll_ctrl)return -EINVAL ;
@@ -622,12 +622,12 @@ bool dss_div_calc(unsigned long pck, unsigned long fck_min,unsigned long fck_hw_max;unsigned long fckd_hw_max;unsigned long prate; -unsigned m; +unsigned int m; fck_hw_max = dss.feat->fck_freq_max;if (dss.parent_clk ==NULL ) { -unsigned pckd; +unsigned int pckd; pckd = fck_hw_max / pck;
@@ -696,7 +696,7 @@ static int dss_setup_default_clock(void) {unsigned long max_dss_fck, prate;unsigned long fck; -unsigned fck_div; +unsigned int fck_div;int r; max_dss_fck = dss.feat->fck_freq_max;
drivers/gpu/drm/omapdrm/dss/dss.h +6 -6
@@ -169,10 +169,10 @@ struct dss_pll_ops {struct dss_pll_hw {enum dss_pll_type type; -unsigned n_max; -unsigned m_min; -unsigned m_max; -unsigned mX_max; +unsigned int n_max; +unsigned int m_min; +unsigned int m_max; +unsigned int mX_max;unsigned long fint_min, fint_max;unsigned long clkdco_min, clkdco_low, clkdco_max;
@@ -412,7 +412,7 @@ void hdmi5_uninit_platform_driver(void);#ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS -static inline void dss_collect_irq_stats (u32 irqstatus,unsigned *irq_arr) +static inline void dss_collect_irq_stats (u32 irqstatus,unsigned int *irq_arr) {int b;for (b =0 ; b <32 ; ++b) {
@@ -432,7 +432,7 @@ int dss_pll_register(struct dss_pll *pll);void dss_pll_unregister (struct dss_pll *pll);struct dss_pll *dss_pll_find (const char *name);struct dss_pll *dss_pll_find_by_src (enum dss_clk_source src); -unsigned dss_pll_get_clkout_idx_for_src (enum dss_clk_source src); +unsigned int dss_pll_get_clkout_idx_for_src (enum dss_clk_source src);int dss_pll_enable (struct dss_pll *pll);void dss_pll_disable (struct dss_pll *pll); int dss_pll_set_config(struct dss_pll *pll,
drivers/gpu/drm/omapdrm/dss/hdmi4.c +1 -1
@@ -179,7 +179,7 @@ static int hdmi_power_on_full(struct omap_dss_device *dssdev)enum omap_channel channel = dssdev->dispc_channel;struct hdmi_wp_data *wp = &hdmi.wp;struct dss_pll_clock_info hdmi_cinfo = {0 }; -unsigned pc; +unsigned int pc; r =hdmi_power_on_core (dssdev);if (r)
drivers/gpu/drm/omapdrm/dss/hdmi5.c +1 -1
@@ -175,7 +175,7 @@ static int hdmi_power_on_full(struct omap_dss_device *dssdev)struct videomode *vm;enum omap_channel channel = dssdev->dispc_channel;struct dss_pll_clock_info hdmi_cinfo = {0 }; -unsigned pc; +unsigned int pc; r =hdmi_power_on_core (dssdev);if (r)
drivers/gpu/drm/omapdrm/dss/hdmi5_core.c +12 -12
@@ -51,14 +51,14 @@ static void hdmi_core_ddc_init(struct hdmi_core_data *core) {void __iomem *base = core->base;const unsigned long long iclk =266000000 ;/* DSS L3 ICLK */ -const unsigned ss_scl_high =4600 ;/* ns */ -const unsigned ss_scl_low =5400 ;/* ns */ -const unsigned fs_scl_high =600 ;/* ns */ -const unsigned fs_scl_low =1300 ;/* ns */ -const unsigned sda_hold =1000 ;/* ns */ -const unsigned sfr_div =10 ; +const unsigned int ss_scl_high =4600 ;/* ns */ +const unsigned int ss_scl_low =5400 ;/* ns */ +const unsigned int fs_scl_high =600 ;/* ns */ +const unsigned int fs_scl_low =1300 ;/* ns */ +const unsigned int sda_hold =1000 ;/* ns */ +const unsigned int sfr_div =10 ;unsigned long long sfr; -unsigned v; +unsigned int v; sfr = iclk / sfr_div;/* SFR_DIV */ sfr /=1000 ;/* SFR clock in kHz */
@@ -431,11 +431,11 @@ static void hdmi_core_write_avi_infoframe(struct hdmi_core_data *core,void __iomem *base = core->base;u8 data[HDMI_INFOFRAME_SIZE (AVI )];u8 *ptr; -unsigned y, a, b, s; -unsigned c, m, r; -unsigned itc, ec, q, sc; -unsigned vic; -unsigned yq, cn, pr; +unsigned int y, a, b, s; +unsigned int c, m, r; +unsigned int itc, ec, q, sc; +unsigned int vic; +unsigned int yq, cn, pr;hdmi_avi_infoframe_pack (frame, data,sizeof (data));
drivers/gpu/drm/omapdrm/dss/hdmi_phy.c +1 -1
@@ -99,7 +99,7 @@ static void hdmi_phy_configure_lanes(struct hdmi_phy_data *phy)u16 lane_cfg =0 ;int i; -unsigned lane_cfg_val; +unsigned int lane_cfg_val;u16 pol_val =0 ;for (i =0 ; i <4 ; ++i)
drivers/gpu/drm/omapdrm/dss/hdmi_wp.c +1 -1
@@ -168,7 +168,7 @@ void hdmi_wp_video_config_timing(struct hdmi_wp_data *wp, {u32 timing_h =0 ;u32 timing_v =0 ; -unsigned hsync_len_offset =1 ; +unsigned int hsync_len_offset =1 ;DSSDBG ("Enter hdmi_wp_video_config_timing\n" );
drivers/gpu/drm/omapdrm/dss/omapdss.h +2 -2
@@ -198,8 +198,8 @@ enum omap_dss_dsi_trans_mode {struct omap_dss_dsi_videomode_timings {unsigned long hsclk; -unsigned ndl; -unsigned bitspp; +unsigned int ndl; +unsigned int bitspp;/* pixels */ u16 hact;
drivers/gpu/drm/omapdrm/dss/pll.c +2 -2
@@ -105,7 +105,7 @@ struct dss_pll *dss_pll_find_by_src(enum dss_clk_source src) } } -unsigned dss_pll_get_clkout_idx_for_src (enum dss_clk_source src) +unsigned int dss_pll_get_clkout_idx_for_src (enum dss_clk_source src) {switch (src) {case DSS_CLK_SRC_HDMI_PLL :
@@ -277,7 +277,7 @@ bool dss_pll_calc_b(const struct dss_pll *pll, unsigned long clkin,unsigned long fint, clkdco, clkout;unsigned long target_clkdco;unsigned long min_dco; -unsigned n, m, mf, m2, sd; +unsigned int n, m, mf, m2, sd;const struct dss_pll_hw *hw = pll->hw;DSSDBG ("clkin %lu, target clkout %lu\n" , clkin, target_clkout);
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 11/48] drm: omapdrm: Use unsigned int type
Hi,
Quoted 6 lines · Laurent Pinchart
The kernel favours 'unsigned int' over plain 'unsigned'. Replace all occurences of the latter by the former. This avoid lots of checkpatch complaints in patches that touch lines where a plain 'unsigned' is used.
Signed-off-by Laurent Pinchart <[email protected]>---
-- Sebastian
Quoted 708 lines
drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 8 +- .../drm/omapdrm/displays/panel-sony-acx565akm.c | 6 +- drivers/gpu/drm/omapdrm/dss/dispc.c | 25 +++--- drivers/gpu/drm/omapdrm/dss/dpi.c | 2 +- drivers/gpu/drm/omapdrm/dss/dsi.c | 98 +++++++++++----------- drivers/gpu/drm/omapdrm/dss/dss.c | 12 +-- drivers/gpu/drm/omapdrm/dss/dss.h | 12 +-- drivers/gpu/drm/omapdrm/dss/hdmi4.c | 2 +- drivers/gpu/drm/omapdrm/dss/hdmi5.c | 2 +- drivers/gpu/drm/omapdrm/dss/hdmi5_core.c | 24 +++--- drivers/gpu/drm/omapdrm/dss/hdmi_phy.c | 2 +- drivers/gpu/drm/omapdrm/dss/hdmi_wp.c | 2 +- drivers/gpu/drm/omapdrm/dss/omapdss.h | 4 +- drivers/gpu/drm/omapdrm/dss/pll.c | 4 +- 14 files changed, 102 insertions(+), 101 deletions(-)drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +4
-4@@ -78,7 +78,7 @@ struct panel_drv_data {struct workqueue_struct *workqueue;bool ulps_enabled; -unsigned ulps_timeout; +unsigned int ulps_timeout;struct delayed_work ulps_work; };@@ -483,7 +483,7 @@ static ssize_t dsicm_show_ulps(struct device *dev, {struct platform_device *pdev =to_platform_device (dev);struct panel_drv_data *ddata =platform_get_drvdata (pdev); -unsigned t; +unsigned int t;mutex_lock (&ddata->lock); t = ddata->ulps_enabled;@@ -530,7 +530,7 @@ static ssize_t dsicm_show_ulps_timeout(struct device *dev, {struct platform_device *pdev =to_platform_device (dev);struct panel_drv_data *ddata =platform_get_drvdata (pdev); -unsigned t; +unsigned int t;mutex_lock (&ddata->lock); t = ddata->ulps_timeout;@@ -1004,7 +1004,7 @@ static int dsicm_memory_read(struct omap_dss_device *dssdev,int r;int first =1 ;int plen; -unsigned buf_used =0 ; +unsigned int buf_used =0 ;if (size < w * h *3 )return -ENOMEM ;drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c +3
-3@@ -289,7 +289,7 @@ static void enable_backlight_ctrl(struct panel_drv_data *ddata, int enable)acx565akm_write (ddata,MIPID_CMD_WRITE_CTRL_DISP , (u8 *)&ctrl,2 ); } -static void set_cabc_mode (struct panel_drv_data *ddata,unsigned mode) +static void set_cabc_mode (struct panel_drv_data *ddata,unsigned int mode) {u16 cabc_ctrl;@@ -303,12 +303,12 @@ static void set_cabc_mode(struct panel_drv_data *ddata, unsigned mode)acx565akm_write (ddata,MIPID_CMD_WRITE_CABC , (u8 *)&cabc_ctrl,2 ); } -static unsigned get_cabc_mode (struct panel_drv_data *ddata) +static unsigned int get_cabc_mode (struct panel_drv_data *ddata) {return ddata->cabc_mode; } -static unsigned get_hw_cabc_mode (struct panel_drv_data *ddata) +static unsigned int get_hw_cabc_mode (struct panel_drv_data *ddata) {u8 cabc_ctrl;drivers/gpu/drm/omapdrm/dss/dispc.c +12
-13@@ -971,7 +971,7 @@ static void dispc_ovl_set_pre_mult_alpha(enum omap_plane_id plane,static void dispc_ovl_setup_global_alpha (enum omap_plane_id plane,enum omap_overlay_caps caps,u8 global_alpha) { -static const unsigned shifts[] = {0 ,8 ,16 ,24 , }; +static const unsigned int shifts[] = {0 ,8 ,16 ,24 , };int shift;if ((caps &OMAP_DSS_OVL_CAP_GLOBAL_ALPHA ) ==0 )@@ -1199,7 +1199,7 @@ void dispc_wb_set_channel_in(enum dss_writeback_channel channel)static void dispc_ovl_set_burst_size (enum omap_plane_id plane,enum omap_burst_size burst_size) { -static const unsigned shifts[] = {6 ,14 ,14 ,14 ,14 , }; +static const unsigned int shifts[] = {6 ,14 ,14 ,14 ,14 , };int shift; shift = shifts[plane];@@ -1287,7 +1287,7 @@ static void dispc_ovl_set_vid_color_conv(enum omap_plane_id plane,static void dispc_ovl_enable_replication (enum omap_plane_id plane,enum omap_overlay_caps caps,bool enable) { -static const unsigned shifts[] = {5 ,10 ,10 ,10 }; +static const unsigned int shifts[] = {5 ,10 ,10 ,10 };int shift;if ((caps &OMAP_DSS_OVL_CAP_REPLICATION ) ==0 )@@ -1452,9 +1452,8 @@ void dispc_ovl_compute_fifo_thresholds(enum omap_plane_id plane,* All sizes are in bytes. Both the buffer and burst are made of * buffer_units, and the fifo thresholds must be buffer_unit aligned. */ - -unsigned buf_unit = dispc.feat->buffer_size_unit; -unsigned ovl_fifo_size, total_fifo_size, burst_size; +unsigned int buf_unit = dispc.feat->buffer_size_unit; +unsigned int ovl_fifo_size, total_fifo_size, burst_size;int i; burst_size =dispc_ovl_get_burst_size (plane);@@ -2008,8 +2007,8 @@ static s32 pixinc(int pixels, u8 ps) }static void calc_offset (u16 screen_width,u16 width, -u32 fourcc,bool fieldmode, -unsigned int field_offset,unsigned *offset0,unsigned *offset1, +u32 fourcc,bool fieldmode,unsigned int field_offset, +unsigned int *offset0,unsigned int *offset1,s32 *row_inc,s32 *pix_inc,int x_predecim,int y_predecim,enum omap_dss_rotation_type rotation_type,u8 rotation) {@@ -2479,7 +2478,7 @@ static int dispc_ovl_setup_common(enum omap_plane_id plane,bool five_taps = true;bool fieldmode = false;int r, cconv =0 ; -unsigned offset0, offset1; +unsigned int offset0, offset1;s32 row_inc;s32 pix_inc;u16 frame_width, frame_height;@@ -3042,7 +3041,7 @@ static int vm_flag_to_int(enum display_flags flags, enum display_flags high,static void dispc_mgr_set_timings (enum omap_channel channel,const struct videomode *vm) { -unsigned xtot, ytot; +unsigned int xtot, ytot;unsigned long ht, vt;struct videomode t = *vm;@@ -3121,7 +3120,7 @@ static unsigned long dispc_fclk_rate(void) r =dss_get_dispc_clk_rate (); }else {struct dss_pll *pll; -unsigned clkout_idx; +unsigned int clkout_idx; pll =dss_pll_find_by_src (src); clkout_idx =dss_pll_get_clkout_idx_for_src (src);@@ -3148,7 +3147,7 @@ static unsigned long dispc_mgr_lclk_rate(enum omap_channel channel) r =dss_get_dispc_clk_rate (); }else {struct dss_pll *pll; -unsigned clkout_idx; +unsigned int clkout_idx; pll =dss_pll_find_by_src (src); clkout_idx =dss_pll_get_clkout_idx_for_src (src);@@ -3489,7 +3488,7 @@ bool dispc_div_calc(unsigned long dispc_freq,unsigned long pck, lck;unsigned long lck_max;unsigned long pckd_hw_min, pckd_hw_max; -unsigned min_fck_per_pck; +unsigned int min_fck_per_pck;unsigned long fck;#ifdef CONFIG_OMAP2_DSS_MIN_FCK_PER_PCK drivers/gpu/drm/omapdrm/dss/dpi.c +1
-1@@ -143,7 +143,7 @@ static enum dss_clk_source dpi_get_clk_src(struct dpi_data *dpi)struct dpi_clk_calc_ctx {struct dss_pll *pll; -unsigned clkout_idx; +unsigned int clkout_idx;/* inputs */ drivers/gpu/drm/omapdrm/dss/dsi.c +50
-48@@ -271,10 +271,10 @@ enum dsi_vc_source {struct dsi_irq_stats {unsigned long last_reset; -unsigned irq_count; -unsigned dsi_irqs[32 ]; -unsigned vc_irqs[4 ][32 ]; -unsigned cio_irqs[32 ]; +unsigned int irq_count; +unsigned int dsi_irqs[32 ]; +unsigned int vc_irqs[4 ][32 ]; +unsigned int cio_irqs[32 ]; };struct dsi_isr_tables {@@ -375,7 +375,7 @@ struct dsi_data {int update_channel;#ifdef DSI_PERF_MEASURE -unsigned update_bytes; +unsigned int update_bytes;#endif bool te_enabled;@@ -408,13 +408,13 @@ struct dsi_data {struct dsi_irq_stats irq_stats;#endif -unsigned num_lanes_supported; -unsigned line_buffer_size; +unsigned int num_lanes_supported; +unsigned int line_buffer_size;struct dsi_lane_config lanes[DSI_MAX_NR_LANES ]; -unsigned num_lanes_used; +unsigned int num_lanes_used; -unsigned scp_clk_refcount; +unsigned int scp_clk_refcount;struct dss_lcd_mgr_config mgr_config;struct videomode vm;@@ -784,7 +784,7 @@ static void dsi_handle_irq_errors(struct platform_device *dsidev, u32 irqstatus, }static void dsi_call_isrs (struct dsi_isr_data *isr_array, -unsigned isr_array_size,u32 irqstatus) +unsigned int isr_array_size,u32 irqstatus) {struct dsi_isr_data *isr_data;int i;@@ -893,7 +893,7 @@ static irqreturn_t omap_dsi_irq_handler(int irq, void *arg)/* dsi->irq_lock has to be locked by the caller */ static void _omap_dsi_configure_irqs (struct platform_device *dsidev,struct dsi_isr_data *isr_array, -unsigned isr_array_size,u32 default_mask, +unsigned int isr_array_size,u32 default_mask,const struct dsi_reg enable_reg,const struct dsi_reg status_reg) {@@ -977,7 +977,7 @@ static void _dsi_initialize_irq(struct platform_device *dsidev) }static int _dsi_register_isr (omap_dsi_isr_t isr,void *arg,u32 mask, -struct dsi_isr_data *isr_array,unsigned isr_array_size) +struct dsi_isr_data *isr_array,unsigned int isr_array_size) {struct dsi_isr_data *isr_data;int free_idx;@@ -1011,7 +1011,7 @@ static int _dsi_register_isr(omap_dsi_isr_t isr, void *arg, u32 mask, }static int _dsi_unregister_isr (omap_dsi_isr_t isr,void *arg,u32 mask, -struct dsi_isr_data *isr_array,unsigned isr_array_size) +struct dsi_isr_data *isr_array,unsigned int isr_array_size) {struct dsi_isr_data *isr_data;int i;@@ -1303,7 +1303,7 @@ static int dsi_lp_clock_calc(unsigned long dsi_fclk, unsigned long lp_clk_min, unsigned long lp_clk_max, struct dsi_lp_clock_info *lp_cinfo) { - unsigned lp_clk_div; + unsigned int lp_clk_div;unsigned long lp_clk; lp_clk_div =DIV_ROUND_UP (dsi_fclk, lp_clk_max *2 );@@ -1322,9 +1322,9 @@ static int dsi_set_lp_clk_divisor(struct platform_device *dsidev) {struct dsi_data *dsi =dsi_get_dsidrv_data (dsidev);unsigned long dsi_fclk; -unsigned lp_clk_div; +unsigned int lp_clk_div;unsigned long lp_clk; -unsigned lpdiv_max = dsi->data->max_pll_lpdiv; +unsigned int lpdiv_max = dsi->data->max_pll_lpdiv; lp_clk_div = dsi->user_lp_cinfo.lp_clk_div;@@ -1800,7 +1800,7 @@ static int dsi_cio_power(struct platform_device *dsidev,return 0 ; } -static unsigned dsi_get_line_buf_size (struct platform_device *dsidev) +static unsigned int dsi_get_line_buf_size (struct platform_device *dsidev) {struct dsi_data *dsi =dsi_get_dsidrv_data (dsidev);int val;@@ -1852,9 +1852,9 @@ static int dsi_set_lane_config(struct platform_device *dsidev) r =dsi_read_reg (dsidev,DSI_COMPLEXIO_CFG1 );for (i =0 ; i < dsi->num_lanes_used; ++i) { -unsigned offset = offsets[i]; -unsigned polarity, lane_number; -unsigned t; +unsigned int offset = offsets[i]; +unsigned int polarity, lane_number; +unsigned int t;for (t =0 ; t < dsi->num_lanes_supported; ++t)if (dsi->lanes[t].function == functions[i])@@ -1872,7 +1872,7 @@ static int dsi_set_lane_config(struct platform_device *dsidev)/* clear the unused lanes */ for (; i < dsi->num_lanes_supported; ++i) { -unsigned offset = offsets[i]; +unsigned int offset = offsets[i]; r =FLD_MOD (r,0 , offset +2 , offset); r =FLD_MOD (r,0 , offset +3 , offset +3 );@@ -1883,7 +1883,8 @@ static int dsi_set_lane_config(struct platform_device *dsidev)return 0 ; } -static inline unsigned ns2ddr (struct platform_device *dsidev,unsigned ns) +static inline unsigned int ns2ddr (struct platform_device *dsidev, +unsigned int ns) {struct dsi_data *dsi =dsi_get_dsidrv_data (dsidev);@@ -1892,7 +1893,8 @@ static inline unsigned ns2ddr(struct platform_device *dsidev, unsigned ns)return (ns * (ddr_clk /1000 /1000 ) +999 ) /1000 ; } -static inline unsigned ddr2ns (struct platform_device *dsidev,unsigned ddr) +static inline unsigned int ddr2ns (struct platform_device *dsidev, +unsigned int ddr) {struct dsi_data *dsi =dsi_get_dsidrv_data (dsidev);@@ -1980,7 +1982,7 @@ static void dsi_cio_timings(struct platform_device *dsidev)/* lane masks have lane 0 at lsb. mask_p for positive lines, n for negative */ static void dsi_cio_enable_lane_override (struct platform_device *dsidev, -unsigned mask_p,unsigned mask_n) +unsigned int mask_p,unsigned int mask_n) {struct dsi_data *dsi =dsi_get_dsidrv_data (dsidev);int i;@@ -1990,7 +1992,7 @@ static void dsi_cio_enable_lane_override(struct platform_device *dsidev, l =0 ;for (i =0 ; i < dsi->num_lanes_supported; ++i) { -unsigned p = dsi->lanes[i].polarity; +unsigned int p = dsi->lanes[i].polarity;if (mask_p & (1 << i)) l |=1 << (i *2 + (p ?0 :1 ));@@ -2077,10 +2079,10 @@ static int dsi_cio_wait_tx_clk_esc_reset(struct platform_device *dsidev) }/* return bitmask of enabled lanes, lane0 being the lsb */ -static unsigned dsi_get_lane_mask (struct platform_device *dsidev) +static unsigned int dsi_get_lane_mask (struct platform_device *dsidev) {struct dsi_data *dsi =dsi_get_dsidrv_data (dsidev); -unsigned mask =0 ; +unsigned int mask =0 ;int i;for (i =0 ; i < dsi->num_lanes_supported; ++i) {@@ -2206,7 +2208,7 @@ static int dsi_cio_init(struct platform_device *dsidev)dsi_write_reg (dsidev,DSI_TIMING1 , l);if (dsi->ulps_enabled) { -unsigned mask_p; +unsigned int mask_p;int i;DSSDBG ("manual ulps exit\n" );@@ -3225,7 +3227,7 @@ static int dsi_enter_ulps(struct platform_device *dsidev)struct dsi_data *dsi =dsi_get_dsidrv_data (dsidev);DECLARE_COMPLETION_ONSTACK (completion);int r, i; -unsigned mask; +unsigned int mask;DSSDBG ("Entering ULPS" );@@ -3315,7 +3317,7 @@ static int dsi_enter_ulps(struct platform_device *dsidev) }static void dsi_set_lp_rx_timeout (struct platform_device *dsidev, -unsigned ticks,bool x4,bool x16) +unsigned int ticks,bool x4,bool x16) {unsigned long fck;unsigned long total_ticks;@@ -3341,8 +3343,8 @@ static void dsi_set_lp_rx_timeout(struct platform_device *dsidev, (total_ticks * 1000) / (fck / 1000 / 1000)); } -static void dsi_set_ta_timeout (struct platform_device *dsidev,unsigned ticks, -bool x8,bool x16) +static void dsi_set_ta_timeout (struct platform_device *dsidev, +unsigned int ticks,bool x8,bool x16) {unsigned long fck;unsigned long total_ticks;@@ -3369,7 +3371,7 @@ static void dsi_set_ta_timeout(struct platform_device *dsidev, unsigned ticks, }static void dsi_set_stop_state_counter (struct platform_device *dsidev, -unsigned ticks,bool x4,bool x16) +unsigned int ticks,bool x4,bool x16) {unsigned long fck;unsigned long total_ticks;@@ -3396,7 +3398,7 @@ static void dsi_set_stop_state_counter(struct platform_device *dsidev, }static void dsi_set_hs_tx_timeout (struct platform_device *dsidev, -unsigned ticks,bool x4,bool x16) +unsigned int ticks,bool x4,bool x16) {unsigned long fck;unsigned long total_ticks;@@ -3742,13 +3744,13 @@ static int dsi_proto_config(struct platform_device *dsidev)static void dsi_proto_timings (struct platform_device *dsidev) {struct dsi_data *dsi =dsi_get_dsidrv_data (dsidev); -unsigned tlpx, tclk_zero, tclk_prepare, tclk_trail; -unsigned tclk_pre, tclk_post; -unsigned ths_prepare, ths_prepare_ths_zero, ths_zero; -unsigned ths_trail, ths_exit; -unsigned ddr_clk_pre, ddr_clk_post; -unsigned enter_hs_mode_lat, exit_hs_mode_lat; -unsigned ths_eot; +unsigned int tlpx, tclk_zero, tclk_prepare, tclk_trail; +unsigned int tclk_pre, tclk_post; +unsigned int ths_prepare, ths_prepare_ths_zero, ths_zero; +unsigned int ths_trail, ths_exit; +unsigned int ddr_clk_pre, ddr_clk_post; +unsigned int enter_hs_mode_lat, exit_hs_mode_lat; +unsigned int ths_eot;int ndl = dsi->num_lanes_used -1 ;u32 r;@@ -4016,16 +4018,16 @@ static void dsi_update_screen_dispc(struct platform_device *dsidev) {struct dsi_data *dsi =dsi_get_dsidrv_data (dsidev);enum omap_channel dispc_channel = dsi->output.dispc_channel; -unsigned bytespp; -unsigned bytespl; -unsigned bytespf; -unsigned total_len; -unsigned packet_payload; -unsigned packet_len; +unsigned int bytespp; +unsigned int bytespl; +unsigned int bytespf; +unsigned int total_len; +unsigned int packet_payload; +unsigned int packet_len;u32 l;int r;const unsigned channel = dsi->update_channel; -const unsigned line_buf_size = dsi->line_buffer_size; +const unsigned int line_buf_size = dsi->line_buffer_size;u16 w = dsi->vm.hactive;u16 h = dsi->vm.vactive;drivers/gpu/drm/omapdrm/dss/dss.c +6
-6@@ -183,8 +183,8 @@ static void dss_restore_context(void)void dss_ctrl_pll_enable (enum dss_pll_id pll_id,bool enable) { -unsigned shift; -unsigned val; +unsigned int shift; +unsigned int val;if (!dss.syscon_pll_ctrl)return ;@@ -213,7 +213,7 @@ void dss_ctrl_pll_enable(enum dss_pll_id pll_id, bool enable)static int dss_ctrl_pll_set_control_mux (enum dss_clk_source clk_src,enum omap_channel channel) { -unsigned shift, val; +unsigned int shift, val;if (!dss.syscon_pll_ctrl)return -EINVAL ;@@ -622,12 +622,12 @@ bool dss_div_calc(unsigned long pck, unsigned long fck_min,unsigned long fck_hw_max;unsigned long fckd_hw_max;unsigned long prate; -unsigned m; +unsigned int m; fck_hw_max = dss.feat->fck_freq_max;if (dss.parent_clk ==NULL ) { -unsigned pckd; +unsigned int pckd; pckd = fck_hw_max / pck;@@ -696,7 +696,7 @@ static int dss_setup_default_clock(void) {unsigned long max_dss_fck, prate;unsigned long fck; -unsigned fck_div; +unsigned int fck_div;int r; max_dss_fck = dss.feat->fck_freq_max;drivers/gpu/drm/omapdrm/dss/dss.h +6
-6@@ -169,10 +169,10 @@ struct dss_pll_ops {struct dss_pll_hw {enum dss_pll_type type; -unsigned n_max; -unsigned m_min; -unsigned m_max; -unsigned mX_max; +unsigned int n_max; +unsigned int m_min; +unsigned int m_max; +unsigned int mX_max;unsigned long fint_min, fint_max;unsigned long clkdco_min, clkdco_low, clkdco_max;@@ -412,7 +412,7 @@ void hdmi5_uninit_platform_driver(void);#ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS -static inline void dss_collect_irq_stats (u32 irqstatus,unsigned *irq_arr) +static inline void dss_collect_irq_stats (u32 irqstatus,unsigned int *irq_arr) {int b;for (b =0 ; b <32 ; ++b) {@@ -432,7 +432,7 @@ int dss_pll_register(struct dss_pll *pll);void dss_pll_unregister (struct dss_pll *pll);struct dss_pll *dss_pll_find (const char *name);struct dss_pll *dss_pll_find_by_src (enum dss_clk_source src); -unsigned dss_pll_get_clkout_idx_for_src (enum dss_clk_source src); +unsigned int dss_pll_get_clkout_idx_for_src (enum dss_clk_source src);int dss_pll_enable (struct dss_pll *pll);void dss_pll_disable (struct dss_pll *pll); int dss_pll_set_config(struct dss_pll *pll,drivers/gpu/drm/omapdrm/dss/hdmi4.c +1
-1@@ -179,7 +179,7 @@ static int hdmi_power_on_full(struct omap_dss_device *dssdev)enum omap_channel channel = dssdev->dispc_channel;struct hdmi_wp_data *wp = &hdmi.wp;struct dss_pll_clock_info hdmi_cinfo = {0 }; -unsigned pc; +unsigned int pc; r =hdmi_power_on_core (dssdev);if (r)drivers/gpu/drm/omapdrm/dss/hdmi5.c +1
-1@@ -175,7 +175,7 @@ static int hdmi_power_on_full(struct omap_dss_device *dssdev)struct videomode *vm;enum omap_channel channel = dssdev->dispc_channel;struct dss_pll_clock_info hdmi_cinfo = {0 }; -unsigned pc; +unsigned int pc; r =hdmi_power_on_core (dssdev);if (r)drivers/gpu/drm/omapdrm/dss/hdmi5_core.c +12
-12@@ -51,14 +51,14 @@ static void hdmi_core_ddc_init(struct hdmi_core_data *core) {void __iomem *base = core->base;const unsigned long long iclk =266000000 ;/* DSS L3 ICLK */ -const unsigned ss_scl_high =4600 ;/* ns */ -const unsigned ss_scl_low =5400 ;/* ns */ -const unsigned fs_scl_high =600 ;/* ns */ -const unsigned fs_scl_low =1300 ;/* ns */ -const unsigned sda_hold =1000 ;/* ns */ -const unsigned sfr_div =10 ; +const unsigned int ss_scl_high =4600 ;/* ns */ +const unsigned int ss_scl_low =5400 ;/* ns */ +const unsigned int fs_scl_high =600 ;/* ns */ +const unsigned int fs_scl_low =1300 ;/* ns */ +const unsigned int sda_hold =1000 ;/* ns */ +const unsigned int sfr_div =10 ;unsigned long long sfr; -unsigned v; +unsigned int v; sfr = iclk / sfr_div;/* SFR_DIV */ sfr /=1000 ;/* SFR clock in kHz */ @@ -431,11 +431,11 @@ static void hdmi_core_write_avi_infoframe(struct hdmi_core_data *core,void __iomem *base = core->base;u8 data[HDMI_INFOFRAME_SIZE (AVI )];u8 *ptr; -unsigned y, a, b, s; -unsigned c, m, r; -unsigned itc, ec, q, sc; -unsigned vic; -unsigned yq, cn, pr; +unsigned int y, a, b, s; +unsigned int c, m, r; +unsigned int itc, ec, q, sc; +unsigned int vic; +unsigned int yq, cn, pr;hdmi_avi_infoframe_pack (frame, data,sizeof (data));drivers/gpu/drm/omapdrm/dss/hdmi_phy.c +1
-1@@ -99,7 +99,7 @@ static void hdmi_phy_configure_lanes(struct hdmi_phy_data *phy)u16 lane_cfg =0 ;int i; -unsigned lane_cfg_val; +unsigned int lane_cfg_val;u16 pol_val =0 ;for (i =0 ; i <4 ; ++i)drivers/gpu/drm/omapdrm/dss/hdmi_wp.c +1
-1@@ -168,7 +168,7 @@ void hdmi_wp_video_config_timing(struct hdmi_wp_data *wp, {u32 timing_h =0 ;u32 timing_v =0 ; -unsigned hsync_len_offset =1 ; +unsigned int hsync_len_offset =1 ;DSSDBG ("Enter hdmi_wp_video_config_timing\n" );drivers/gpu/drm/omapdrm/dss/omapdss.h +2
-2@@ -198,8 +198,8 @@ enum omap_dss_dsi_trans_mode {struct omap_dss_dsi_videomode_timings {unsigned long hsclk; -unsigned ndl; -unsigned bitspp; +unsigned int ndl; +unsigned int bitspp;/* pixels */ u16 hact;drivers/gpu/drm/omapdrm/dss/pll.c +2
-2@@ -105,7 +105,7 @@ struct dss_pll *dss_pll_find_by_src(enum dss_clk_source src) } } -unsigned dss_pll_get_clkout_idx_for_src (enum dss_clk_source src) +unsigned int dss_pll_get_clkout_idx_for_src (enum dss_clk_source src) {switch (src) {case DSS_CLK_SRC_HDMI_PLL :@@ -277,7 +277,7 @@ bool dss_pll_calc_b(const struct dss_pll *pll, unsigned long clkin,unsigned long fint, clkdco, clkout;unsigned long target_clkdco;unsigned long min_dco; -unsigned n, m, mf, m2, sd; +unsigned int n, m, mf, m2, sd;const struct dss_pll_hw *hw = pll->hw;DSSDBG ("clkin %lu, target clkout %lu\n" , clkin, target_clkout);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 12/48 drm: omapdrm: Split init and cleanup from probe and remove functions
In reply to Laurent PinchartWhen merging the omapdrm and omapdss drivers there will be not omapdrm platform device anymore, and thus no associated probe and remove functions. To prepare for that, split all the initialization code from the probe function to make it usable without a platform device. Similarly, split the cleanup code from the remove function.
--- drivers/gpu/drm/omapdrm/omap_drv.c | 83 +++++++++++++++++++++++--------------- drivers/gpu/drm/omapdrm/omap_drv.h | 2 + 2 files changed, 53 insertions(+), 32 deletions(-)
drivers/gpu/drm/omapdrm/omap_drv.c +51 -32
@@ -542,24 +542,16 @@ static const struct soc_device_attribute omapdrm_soc_devices[] = { {/* sentinel */ } }; -static int pdev_probe (struct platform_device *pdev) +static int omapdrm_init (struct omap_drm_private *priv,struct device *dev) {const struct soc_device_attribute *soc; -struct omap_drm_private *priv;struct drm_device *ddev;unsigned int i;int ret; -DBG ("%s" , pdev->name); - -if (omapdss_is_initialized () == false) -return -EPROBE_DEFER ; +DBG ("%s" ,dev_name (dev)); - ret =dma_set_coherent_mask (&pdev->dev,DMA_BIT_MASK (32 )); -if (ret) { -dev_err (&pdev->dev,"Failed to set the DMA mask\n" ); -return ret; - } + priv->dev = dev;omap_crtc_pre_init ();
@@ -567,13 +559,6 @@ static int pdev_probe(struct platform_device *pdev)if (ret) goto err_crtc_uninit; -/* Allocate and initialize the driver private structure. */ - priv =kzalloc (sizeof (*priv),GFP_KERNEL ); -if (!priv) { - ret = -ENOMEM ; - goto err_disconnect_dssdevs; - } - priv->dispc_ops =dispc_get_ops (); soc =soc_device_match (omapdrm_soc_devices);
@@ -584,27 +569,27 @@ static int pdev_probe(struct platform_device *pdev)INIT_LIST_HEAD (&priv->obj_list);/* Allocate and initialize the DRM device. */ - ddev =drm_dev_alloc (&omap_drm_driver, &pdev->dev); + ddev =drm_dev_alloc (&omap_drm_driver, priv->dev);if (IS_ERR (ddev)) { ret =PTR_ERR (ddev); - goto err_free_priv; + goto err_destroy_wq; } + priv->ddev = ddev; ddev->dev_private = priv; -platform_set_drvdata (pdev, ddev);omap_gem_init (ddev); ret =omap_modeset_init (ddev);if (ret) { -dev_err (&pdev->dev,"omap_modeset_init failed: ret=%d\n" , ret); +dev_err (priv->dev,"omap_modeset_init failed: ret=%d\n" , ret); goto err_free_drm_dev; }/* Initialize vblank handling, start with all CRTCs disabled. */ ret =drm_vblank_init (ddev, priv->num_crtcs);if (ret) { -dev_err (&pdev->dev,"could not init vblank\n" ); +dev_err (priv->dev,"could not init vblank\n" ); goto err_cleanup_modeset; }
@@ -637,20 +622,17 @@ static int pdev_probe(struct platform_device *pdev) err_free_drm_dev:omap_gem_deinit (ddev);drm_dev_unref (ddev); -err_free_priv: +err_destroy_wq:destroy_workqueue (priv->wq); -kfree (priv); -err_disconnect_dssdevs:omap_disconnect_dssdevs (); err_crtc_uninit:omap_crtc_pre_uninit ();return ret; } -static int pdev_remove (struct platform_device *pdev) +static void omapdrm_cleanup (struct omap_drm_private *priv) { -struct drm_device *ddev =platform_get_drvdata (pdev); -struct omap_drm_private *priv = ddev->dev_private; +struct drm_device *ddev = priv->ddev;DBG ("" );
@@ -672,10 +654,45 @@ static int pdev_remove(struct platform_device *pdev)drm_dev_unref (ddev);destroy_workqueue (priv->wq); -kfree (priv);omap_disconnect_dssdevs ();omap_crtc_pre_uninit (); +} + +static int pdev_probe (struct platform_device *pdev) +{ +struct omap_drm_private *priv; +int ret; + +if (omapdss_is_initialized () == false) +return -EPROBE_DEFER ; + + ret =dma_set_coherent_mask (&pdev->dev,DMA_BIT_MASK (32 )); +if (ret) { +dev_err (&pdev->dev,"Failed to set the DMA mask\n" ); +return ret; + } + +/* Allocate and initialize the driver private structure. */ + priv =kzalloc (sizeof (*priv),GFP_KERNEL ); +if (!priv) +return -ENOMEM ; + +platform_set_drvdata (pdev, priv); + + ret =omapdrm_init (priv, &pdev->dev); +if (ret <0 ) +kfree (priv); + +return ret; +} + +static int pdev_remove (struct platform_device *pdev) +{ +struct omap_drm_private *priv =platform_get_drvdata (pdev); + +omapdrm_cleanup (priv); +kfree (priv);return 0 ; }
@@ -719,7 +736,8 @@ static int omap_drm_resume_all_displays(void)static int omap_drm_suspend (struct device *dev) { -struct drm_device *drm_dev =dev_get_drvdata (dev); +struct omap_drm_private *priv =dev_get_drvdata (dev); +struct drm_device *drm_dev = priv->ddev;drm_kms_helper_poll_disable (drm_dev);
@@ -732,7 +750,8 @@ static int omap_drm_suspend(struct device *dev)static int omap_drm_resume (struct device *dev) { -struct drm_device *drm_dev =dev_get_drvdata (dev); +struct omap_drm_private *priv =dev_get_drvdata (dev); +struct drm_device *drm_dev = priv->ddev;drm_modeset_lock_all (drm_dev);omap_drm_resume_all_displays ();
drivers/gpu/drm/omapdrm/omap_drv.h +2 -0
@@ -48,6 +48,8 @@struct omap_drm_usergart ;struct omap_drm_private { +struct drm_device *ddev; +struct device *dev;u32 omaprev;const struct dispc_ops *dispc_ops;
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 12/48] drm: omapdrm: Split init and cleanup from probe and remove functions
Hi,
Quoted 8 lines · Laurent Pinchart
When merging the omapdrm and omapdss drivers there will be not omapdrm platform device anymore, and thus no associated probe and remove functions. To prepare for that, split all the initialization code from the probe function to make it usable without a platform device. Similarly, split the cleanup code from the remove function.
Signed-off-by Laurent Pinchart <[email protected]>---
-- Sebastian
Quoted 196 lines
drivers/gpu/drm/omapdrm/omap_drv.c | 83 +++++++++++++++++++++++--------------- drivers/gpu/drm/omapdrm/omap_drv.h | 2 + 2 files changed, 53 insertions(+), 32 deletions(-)drivers/gpu/drm/omapdrm/omap_drv.c +51
-32@@ -542,24 +542,16 @@ static const struct soc_device_attribute omapdrm_soc_devices[] = { {/* sentinel */ } }; -static int pdev_probe (struct platform_device *pdev) +static int omapdrm_init (struct omap_drm_private *priv,struct device *dev) {const struct soc_device_attribute *soc; -struct omap_drm_private *priv;struct drm_device *ddev;unsigned int i;int ret; -DBG ("%s" , pdev->name); - -if (omapdss_is_initialized () == false) -return -EPROBE_DEFER ; +DBG ("%s" ,dev_name (dev)); - ret =dma_set_coherent_mask (&pdev->dev,DMA_BIT_MASK (32 )); -if (ret) { -dev_err (&pdev->dev,"Failed to set the DMA mask\n" ); -return ret; - } + priv->dev = dev;omap_crtc_pre_init ();@@ -567,13 +559,6 @@ static int pdev_probe(struct platform_device *pdev)if (ret) goto err_crtc_uninit; -/* Allocate and initialize the driver private structure. */ - priv =kzalloc (sizeof (*priv),GFP_KERNEL ); -if (!priv) { - ret = -ENOMEM ; - goto err_disconnect_dssdevs; - } - priv->dispc_ops =dispc_get_ops (); soc =soc_device_match (omapdrm_soc_devices);@@ -584,27 +569,27 @@ static int pdev_probe(struct platform_device *pdev)INIT_LIST_HEAD (&priv->obj_list);/* Allocate and initialize the DRM device. */ - ddev =drm_dev_alloc (&omap_drm_driver, &pdev->dev); + ddev =drm_dev_alloc (&omap_drm_driver, priv->dev);if (IS_ERR (ddev)) { ret =PTR_ERR (ddev); - goto err_free_priv; + goto err_destroy_wq; } + priv->ddev = ddev; ddev->dev_private = priv; -platform_set_drvdata (pdev, ddev);omap_gem_init (ddev); ret =omap_modeset_init (ddev);if (ret) { -dev_err (&pdev->dev,"omap_modeset_init failed: ret=%d\n" , ret); +dev_err (priv->dev,"omap_modeset_init failed: ret=%d\n" , ret); goto err_free_drm_dev; }/* Initialize vblank handling, start with all CRTCs disabled. */ ret =drm_vblank_init (ddev, priv->num_crtcs);if (ret) { -dev_err (&pdev->dev,"could not init vblank\n" ); +dev_err (priv->dev,"could not init vblank\n" ); goto err_cleanup_modeset; }@@ -637,20 +622,17 @@ static int pdev_probe(struct platform_device *pdev) err_free_drm_dev:omap_gem_deinit (ddev);drm_dev_unref (ddev); -err_free_priv: +err_destroy_wq:destroy_workqueue (priv->wq); -kfree (priv); -err_disconnect_dssdevs:omap_disconnect_dssdevs (); err_crtc_uninit:omap_crtc_pre_uninit ();return ret; } -static int pdev_remove (struct platform_device *pdev) +static void omapdrm_cleanup (struct omap_drm_private *priv) { -struct drm_device *ddev =platform_get_drvdata (pdev); -struct omap_drm_private *priv = ddev->dev_private; +struct drm_device *ddev = priv->ddev;DBG ("" );@@ -672,10 +654,45 @@ static int pdev_remove(struct platform_device *pdev)drm_dev_unref (ddev);destroy_workqueue (priv->wq); -kfree (priv);omap_disconnect_dssdevs ();omap_crtc_pre_uninit (); +} + +static int pdev_probe (struct platform_device *pdev) +{ +struct omap_drm_private *priv; +int ret; + +if (omapdss_is_initialized () == false) +return -EPROBE_DEFER ; + + ret =dma_set_coherent_mask (&pdev->dev,DMA_BIT_MASK (32 )); +if (ret) { +dev_err (&pdev->dev,"Failed to set the DMA mask\n" ); +return ret; + } + +/* Allocate and initialize the driver private structure. */ + priv =kzalloc (sizeof (*priv),GFP_KERNEL ); +if (!priv) +return -ENOMEM ; + +platform_set_drvdata (pdev, priv); + + ret =omapdrm_init (priv, &pdev->dev); +if (ret <0 ) +kfree (priv); + +return ret; +} + +static int pdev_remove (struct platform_device *pdev) +{ +struct omap_drm_private *priv =platform_get_drvdata (pdev); + +omapdrm_cleanup (priv); +kfree (priv);return 0 ; }@@ -719,7 +736,8 @@ static int omap_drm_resume_all_displays(void)static int omap_drm_suspend (struct device *dev) { -struct drm_device *drm_dev =dev_get_drvdata (dev); +struct omap_drm_private *priv =dev_get_drvdata (dev); +struct drm_device *drm_dev = priv->ddev;drm_kms_helper_poll_disable (drm_dev);@@ -732,7 +750,8 @@ static int omap_drm_suspend(struct device *dev)static int omap_drm_resume (struct device *dev) { -struct drm_device *drm_dev =dev_get_drvdata (dev); +struct omap_drm_private *priv =dev_get_drvdata (dev); +struct drm_device *drm_dev = priv->ddev;drm_modeset_lock_all (drm_dev);omap_drm_resume_all_displays ();drivers/gpu/drm/omapdrm/omap_drv.h +2
-0@@ -48,6 +48,8 @@struct omap_drm_usergart ;struct omap_drm_private { +struct drm_device *ddev; +struct device *dev;u32 omaprev;const struct dispc_ops *dispc_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 13/48 drm: omapdrm: connector-analog-tv: Remove tvc_of_match forward declaration
In reply to Laurent PinchartThe tvc_of_match variable is never referenced before its definition. Remove the forward declaration.
--- drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c | 2 -- 1 file changed, 2 deletions(-)
drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c +0 -2
@@ -40,8 +40,6 @@ static const struct videomode tvc_pal_vm = { DISPLAY_FLAGS_VSYNC_LOW, }; -static const struct of_device_id tvc_of_match[]; -#define to_panel_data (x) container_of(x, struct panel_drv_data, dssdev)static int tvc_connect (struct omap_dss_device *dssdev)
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 13/48] drm: omapdrm: connector-analog-tv: Remove tvc_of_match forward declaration
Hi,
Quoted 5 lines · Laurent Pinchart
The
tvc_of_matchvariable is never referenced before its definition. Remove the forward declaration.Signed-off-by Laurent Pinchart <[email protected]>---
-- Sebastian
Quoted 25 lines
drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c | 2 -- 1 file changed, 2 deletions(-)drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c +0
-2@@ -40,8 +40,6 @@ static const struct videomode tvc_pal_vm = { DISPLAY_FLAGS_VSYNC_LOW, }; -static const struct of_device_id tvc_of_match[]; -#define to_panel_data (x) container_of(x, struct panel_drv_data, dssdev)static int tvc_connect (struct omap_dss_device *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 14/48 drm: omapdrm: displays: Remove OF node check in connector drivers
In reply to Laurent PinchartNo connector is instantiated through platform data anymore, there is no need to check for OF node presence.
--- drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c | 3 --- drivers/gpu/drm/omapdrm/displays/connector-dvi.c | 3 --- drivers/gpu/drm/omapdrm/displays/connector-hdmi.c | 3 --- 3 files changed, 9 deletions(-)
drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c +0 -3
@@ -196,9 +196,6 @@ static int tvc_probe(struct platform_device *pdev)struct omap_dss_device *dssdev;int r; -if (!pdev->dev.of_node) -return -ENODEV ; - ddata =devm_kzalloc (&pdev->dev,sizeof (*ddata),GFP_KERNEL );if (!ddata)return -ENOMEM ;
drivers/gpu/drm/omapdrm/displays/connector-dvi.c +0 -3
@@ -275,9 +275,6 @@ static int dvic_probe(struct platform_device *pdev)platform_set_drvdata (pdev, ddata); -if (!pdev->dev.of_node) -return -ENODEV ; - r =dvic_probe_of (pdev);if (r)return r;
drivers/gpu/drm/omapdrm/displays/connector-hdmi.c +0 -3
@@ -336,9 +336,6 @@ static int hdmic_probe(struct platform_device *pdev)platform_set_drvdata (pdev, ddata); ddata->dev = &pdev->dev; -if (!pdev->dev.of_node) -return -ENODEV ; - r =hdmic_probe_of (pdev);if (r)return r;
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 14/48] drm: omapdrm: displays: Remove OF node check in connector drivers
Hi,
Quoted 5 lines · Laurent Pinchart
No connector is instantiated through platform data anymore, there is no need to check for OF node presence.
Signed-off-by Laurent Pinchart <[email protected]>---
-- Sebastian
Quoted 56 lines
drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c | 3 --- drivers/gpu/drm/omapdrm/displays/connector-dvi.c | 3 --- drivers/gpu/drm/omapdrm/displays/connector-hdmi.c | 3 --- 3 files changed, 9 deletions(-)drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c +0
-3@@ -196,9 +196,6 @@ static int tvc_probe(struct platform_device *pdev)struct omap_dss_device *dssdev;int r; -if (!pdev->dev.of_node) -return -ENODEV ; - ddata =devm_kzalloc (&pdev->dev,sizeof (*ddata),GFP_KERNEL );if (!ddata)return -ENOMEM ;drivers/gpu/drm/omapdrm/displays/connector-dvi.c +0
-3@@ -275,9 +275,6 @@ static int dvic_probe(struct platform_device *pdev)platform_set_drvdata (pdev, ddata); -if (!pdev->dev.of_node) -return -ENODEV ; - r =dvic_probe_of (pdev);if (r)return r;drivers/gpu/drm/omapdrm/displays/connector-hdmi.c +0
-3@@ -336,9 +336,6 @@ static int hdmic_probe(struct platform_device *pdev)platform_set_drvdata (pdev, ddata); ddata->dev = &pdev->dev; -if (!pdev->dev.of_node) -return -ENODEV ; - r =hdmic_probe_of (pdev);if (r)return r;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 15/48 drm: omapdrm: displays: Remove OF node check in encoder drivers
In reply to Laurent PinchartNo encoder is instantiated through platform data anymore, there is no need to check for OF node presence.
--- drivers/gpu/drm/omapdrm/displays/encoder-opa362.c | 5 ----- drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c | 3 --- drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c | 3 --- 3 files changed, 11 deletions(-)
drivers/gpu/drm/omapdrm/displays/encoder-opa362.c +0 -5
@@ -179,11 +179,6 @@ static int opa362_probe(struct platform_device *pdev)dev_dbg (&pdev->dev,"probe\n" ); -if (node ==NULL ) { -dev_err (&pdev->dev,"Unable to find device tree\n" ); -return -EINVAL ; - } - ddata =devm_kzalloc (&pdev->dev,sizeof (*ddata),GFP_KERNEL );if (!ddata)return -ENOMEM ;
drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c +0 -3
@@ -201,9 +201,6 @@ static int tfp410_probe(struct platform_device *pdev)platform_set_drvdata (pdev, ddata); -if (!pdev->dev.of_node) -return -ENODEV ; - r =tfp410_probe_of (pdev);if (r)return r;
drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c +0 -3
@@ -299,9 +299,6 @@ static int tpd_probe(struct platform_device *pdev)platform_set_drvdata (pdev, ddata); -if (!pdev->dev.of_node) -return -ENODEV ; - r =tpd_probe_of (pdev);if (r)return r;
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 15/48] drm: omapdrm: displays: Remove OF node check in encoder drivers
Hi,
Quoted 5 lines · Laurent Pinchart
No encoder is instantiated through platform data anymore, there is no need to check for OF node presence.
Signed-off-by Laurent Pinchart <[email protected]>---
-- Sebastian
Quoted 58 lines
drivers/gpu/drm/omapdrm/displays/encoder-opa362.c | 5 ----- drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c | 3 --- drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c | 3 --- 3 files changed, 11 deletions(-)drivers/gpu/drm/omapdrm/displays/encoder-opa362.c +0
-5@@ -179,11 +179,6 @@ static int opa362_probe(struct platform_device *pdev)dev_dbg (&pdev->dev,"probe\n" ); -if (node ==NULL ) { -dev_err (&pdev->dev,"Unable to find device tree\n" ); -return -EINVAL ; - } - ddata =devm_kzalloc (&pdev->dev,sizeof (*ddata),GFP_KERNEL );if (!ddata)return -ENOMEM ;drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c +0
-3@@ -201,9 +201,6 @@ static int tfp410_probe(struct platform_device *pdev)platform_set_drvdata (pdev, ddata); -if (!pdev->dev.of_node) -return -ENODEV ; - r =tfp410_probe_of (pdev);if (r)return r;drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c +0
-3@@ -299,9 +299,6 @@ static int tpd_probe(struct platform_device *pdev)platform_set_drvdata (pdev, ddata); -if (!pdev->dev.of_node) -return -ENODEV ; - r =tpd_probe_of (pdev);if (r)return r;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 16/48 drm: omapdrm: displays: Remove OF node check in panel drivers
In reply to Laurent PinchartNo panel is instantiated through platform data anymore, there is no need to check for OF node presence.
--- drivers/gpu/drm/omapdrm/displays/panel-dpi.c | 3 --- drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 3 --- drivers/gpu/drm/omapdrm/displays/panel-lgphilips-lb035q02.c | 3 --- drivers/gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c | 3 --- drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c | 3 --- drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c | 3 --- drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c | 3 --- drivers/gpu/drm/omapdrm/displays/panel-tpo-td043mtea1.c | 3 --- 8 files changed, 24 deletions(-)
drivers/gpu/drm/omapdrm/displays/panel-dpi.c +0 -3
@@ -231,9 +231,6 @@ static int panel_dpi_probe(struct platform_device *pdev)struct omap_dss_device *dssdev;int r; -if (!pdev->dev.of_node) -return -ENODEV ; - ddata =devm_kzalloc (&pdev->dev,sizeof (*ddata),GFP_KERNEL );if (ddata ==NULL )return -ENOMEM ;
drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +0 -3
@@ -1168,9 +1168,6 @@ static int dsicm_probe(struct platform_device *pdev)platform_set_drvdata (pdev, ddata); ddata->pdev = pdev; -if (!pdev->dev.of_node) -return -ENODEV ; - r =dsicm_probe_of (pdev);if (r)return r;
drivers/gpu/drm/omapdrm/displays/panel-lgphilips-lb035q02.c +0 -3
@@ -268,9 +268,6 @@ static int lb035q02_panel_spi_probe(struct spi_device *spi) ddata->spi = spi; -if (!spi->dev.of_node) -return -ENODEV ; - r =lb035q02_probe_of (spi);if (r)return r;
drivers/gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c +0 -3
@@ -277,9 +277,6 @@ static int nec_8048_probe(struct spi_device *spi) ddata->spi = spi; -if (!spi->dev.of_node) -return -ENODEV ; - r =nec_8048_probe_of (spi);if (r)return r;
drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c +0 -3
@@ -268,9 +268,6 @@ static int sharp_ls_probe(struct platform_device *pdev)platform_set_drvdata (pdev, ddata); -if (!pdev->dev.of_node) -return -ENODEV ; - r =sharp_ls_probe_of (pdev);if (r)return r;
drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c +0 -3
@@ -720,9 +720,6 @@ static int acx565akm_probe(struct spi_device *spi)dev_dbg (&spi->dev,"%s\n" , __func__); -if (!spi->dev.of_node) -return -ENODEV ; - spi->mode =SPI_MODE_3 ; ddata =devm_kzalloc (&spi->dev,sizeof (*ddata),GFP_KERNEL );
drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c +0 -3
@@ -404,9 +404,6 @@ static int td028ttec1_panel_probe(struct spi_device *spi) ddata->spi_dev = spi; -if (!spi->dev.of_node) -return -ENODEV ; - r =td028ttec1_probe_of (spi);if (r)return r;
drivers/gpu/drm/omapdrm/displays/panel-tpo-td043mtea1.c +0 -3
@@ -509,9 +509,6 @@ static int tpo_td043_probe(struct spi_device *spi) ddata->spi = spi; -if (!spi->dev.of_node) -return -ENODEV ; - r =tpo_td043_probe_of (spi);if (r)return r;
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 16/48] drm: omapdrm: displays: Remove OF node check in panel drivers
Hi,
Quoted 5 lines · Laurent Pinchart
No panel is instantiated through platform data anymore, there is no need to check for OF node presence.
Signed-off-by Laurent Pinchart <[email protected]>---
-- Sebastian
Quoted 131 lines
drivers/gpu/drm/omapdrm/displays/panel-dpi.c | 3 --- drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 3 --- drivers/gpu/drm/omapdrm/displays/panel-lgphilips-lb035q02.c | 3 --- drivers/gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c | 3 --- drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c | 3 --- drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c | 3 --- drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c | 3 --- drivers/gpu/drm/omapdrm/displays/panel-tpo-td043mtea1.c | 3 --- 8 files changed, 24 deletions(-)drivers/gpu/drm/omapdrm/displays/panel-dpi.c +0
-3@@ -231,9 +231,6 @@ static int panel_dpi_probe(struct platform_device *pdev)struct omap_dss_device *dssdev;int r; -if (!pdev->dev.of_node) -return -ENODEV ; - ddata =devm_kzalloc (&pdev->dev,sizeof (*ddata),GFP_KERNEL );if (ddata ==NULL )return -ENOMEM ;drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +0
-3@@ -1168,9 +1168,6 @@ static int dsicm_probe(struct platform_device *pdev)platform_set_drvdata (pdev, ddata); ddata->pdev = pdev; -if (!pdev->dev.of_node) -return -ENODEV ; - r =dsicm_probe_of (pdev);if (r)return r;drivers/gpu/drm/omapdrm/displays/panel-lgphilips-lb035q02.c +0
-3@@ -268,9 +268,6 @@ static int lb035q02_panel_spi_probe(struct spi_device *spi) ddata->spi = spi; -if (!spi->dev.of_node) -return -ENODEV ; - r =lb035q02_probe_of (spi);if (r)return r;drivers/gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c +0
-3@@ -277,9 +277,6 @@ static int nec_8048_probe(struct spi_device *spi) ddata->spi = spi; -if (!spi->dev.of_node) -return -ENODEV ; - r =nec_8048_probe_of (spi);if (r)return r;drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c +0
-3@@ -268,9 +268,6 @@ static int sharp_ls_probe(struct platform_device *pdev)platform_set_drvdata (pdev, ddata); -if (!pdev->dev.of_node) -return -ENODEV ; - r =sharp_ls_probe_of (pdev);if (r)return r;drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c +0
-3@@ -720,9 +720,6 @@ static int acx565akm_probe(struct spi_device *spi)dev_dbg (&spi->dev,"%s\n" , __func__); -if (!spi->dev.of_node) -return -ENODEV ; - spi->mode =SPI_MODE_3 ; ddata =devm_kzalloc (&spi->dev,sizeof (*ddata),GFP_KERNEL );drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c +0
-3@@ -404,9 +404,6 @@ static int td028ttec1_panel_probe(struct spi_device *spi) ddata->spi_dev = spi; -if (!spi->dev.of_node) -return -ENODEV ; - r =td028ttec1_probe_of (spi);if (r)return r;drivers/gpu/drm/omapdrm/displays/panel-tpo-td043mtea1.c +0
-3@@ -509,9 +509,6 @@ static int tpo_td043_probe(struct spi_device *spi) ddata->spi = spi; -if (!spi->dev.of_node) -return -ENODEV ; - r =tpo_td043_probe_of (spi);if (r)return r;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 17/48 drm: omapdrm: displays: Get connector source at connect time
In reply to Laurent PinchartThe connector drivers need a handle to the source they are connected to in order to control the source.
All drivers get that handle at probe time, resulting in probe deferral when the source hasn't been probed yet. However they don't need the handle until their connect handler is called.
Move retrieval of the source handle to the connect handler to avoid probe deferrals.
--- .../gpu/drm/omapdrm/displays/connector-analog-tv.c | 45 ++++++++-------------- drivers/gpu/drm/omapdrm/displays/connector-dvi.c | 31 +++++++-------- drivers/gpu/drm/omapdrm/displays/connector-hdmi.c | 37 ++++++++---------- 3 files changed, 46 insertions(+), 67 deletions(-)
drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c +15 -30
@@ -45,7 +45,7 @@ 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 = ddata->in; +struct omap_dss_device *in;int r;dev_dbg (ddata->dev,"connect\n" );
@@ -53,10 +53,19 @@ static int tvc_connect(struct omap_dss_device *dssdev)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" ); +return PTR_ERR (in); + } + r = in->ops.atv->connect (in, dssdev); -if (r) +if (r) { +omap_dss_put_device (in);return r; + } + ddata->in = in;return 0 ; }
@@ -71,6 +80,9 @@ static void tvc_disconnect(struct omap_dss_device *dssdev)return ; in->ops.atv->disconnect (in, dssdev); + +omap_dss_put_device (in); + ddata->in =NULL ; }static int tvc_enable (struct omap_dss_device *dssdev)
@@ -173,23 +185,6 @@ static struct omap_dss_driver tvc_driver = { .set_wss = tvc_set_wss, }; -static int tvc_probe_of (struct platform_device *pdev) -{ -struct panel_drv_data *ddata =platform_get_drvdata (pdev); -struct device_node *node = pdev->dev.of_node; -struct omap_dss_device *in; - - in =omapdss_of_find_source_for_first_ep (node); -if (IS_ERR (in)) { -dev_err (&pdev->dev,"failed to find video source\n" ); -return PTR_ERR (in); - } - - ddata->in = in; - -return 0 ; -} -static int tvc_probe (struct platform_device *pdev) {struct panel_drv_data *ddata;
@@ -203,10 +198,6 @@ static int tvc_probe(struct platform_device *pdev)platform_set_drvdata (pdev, ddata); ddata->dev = &pdev->dev; - r =tvc_probe_of (pdev); -if (r) -return r; - ddata->vm = tvc_pal_vm; dssdev = &ddata->dssdev;
@@ -219,28 +210,22 @@ static int tvc_probe(struct platform_device *pdev) r =omapdss_register_display (dssdev);if (r) {dev_err (&pdev->dev,"Failed to register panel\n" ); - goto err_reg; +return r; }return 0 ; -err_reg: -omap_dss_put_device (ddata->in); -return r; } static int __exit tvc_remove(struct platform_device *pdev) {struct panel_drv_data *ddata =platform_get_drvdata (pdev);struct omap_dss_device *dssdev = &ddata->dssdev; -struct omap_dss_device *in = ddata->in;omapdss_unregister_display (&ddata->dssdev);tvc_disable (dssdev);tvc_disconnect (dssdev); -omap_dss_put_device (in); -return 0 ; }
drivers/gpu/drm/omapdrm/displays/connector-dvi.c +14 -17
@@ -51,16 +51,25 @@ 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 = ddata->in; +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" ); +return PTR_ERR (in); + } + r = in->ops.dvi->connect (in, dssdev); -if (r) +if (r) { +omap_dss_put_device (in);return r; + } + ddata->in = in;return 0 ; }
@@ -73,6 +82,9 @@ static void dvic_disconnect(struct omap_dss_device *dssdev)return ; in->ops.dvi->disconnect (in, dssdev); + +omap_dss_put_device (in); + ddata->in =NULL ; }static int dvic_enable (struct omap_dss_device *dssdev)
@@ -235,25 +247,15 @@ static int dvic_probe_of(struct platform_device *pdev) {struct panel_drv_data *ddata =platform_get_drvdata (pdev);struct device_node *node = pdev->dev.of_node; -struct omap_dss_device *in;struct device_node *adapter_node;struct i2c_adapter *adapter; - in =omapdss_of_find_source_for_first_ep (node); -if (IS_ERR (in)) { -dev_err (&pdev->dev,"failed to find video source\n" ); -return PTR_ERR (in); - } - - ddata->in = in; - adapter_node =of_parse_phandle (node,"ddc-i2c-bus" ,0 );if (adapter_node) { adapter =of_get_i2c_adapter_by_node (adapter_node);of_node_put (adapter_node);if (adapter ==NULL ) {dev_err (&pdev->dev,"failed to parse ddc-i2c-bus\n" ); -omap_dss_put_device (ddata->in);return -EPROBE_DEFER ; }
@@ -297,8 +299,6 @@ static int dvic_probe(struct platform_device *pdev)return 0 ; err_reg: -omap_dss_put_device (ddata->in); -i2c_put_adapter (ddata->i2c_adapter);return r;
@@ -308,15 +308,12 @@ static int __exit dvic_remove(struct platform_device *pdev) {struct panel_drv_data *ddata =platform_get_drvdata (pdev);struct omap_dss_device *dssdev = &ddata->dssdev; -struct omap_dss_device *in = ddata->in;omapdss_unregister_display (&ddata->dssdev);dvic_disable (dssdev);dvic_disconnect (dssdev); -omap_dss_put_device (in); -i2c_put_adapter (ddata->i2c_adapter);return 0 ;
drivers/gpu/drm/omapdrm/displays/connector-hdmi.c +17 -20
@@ -55,7 +55,7 @@ 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 = ddata->in; +struct omap_dss_device *in;int r;dev_dbg (ddata->dev,"connect\n" );
@@ -63,10 +63,19 @@ static int hdmic_connect(struct omap_dss_device *dssdev)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" ); +return PTR_ERR (in); + } + r = in->ops.hdmi->connect (in, dssdev); -if (r) +if (r) { +omap_dss_put_device (in);return r; + } + ddata->in = in;return 0 ; }
@@ -81,6 +90,9 @@ static void hdmic_disconnect(struct omap_dss_device *dssdev)return ; in->ops.hdmi->disconnect (in, dssdev); + +omap_dss_put_device (in); + ddata->in =NULL ; }static int hdmic_enable (struct omap_dss_device *dssdev)
@@ -302,7 +314,6 @@ static int hdmic_probe_of(struct platform_device *pdev) {struct panel_drv_data *ddata =platform_get_drvdata (pdev);struct device_node *node = pdev->dev.of_node; -struct omap_dss_device *in;int gpio;/* HPD GPIO */
@@ -312,14 +323,6 @@ static int hdmic_probe_of(struct platform_device *pdev)else ddata->hpd_gpio = -ENODEV ; - in =omapdss_of_find_source_for_first_ep (node); -if (IS_ERR (in)) { -dev_err (&pdev->dev,"failed to find video source\n" ); -return PTR_ERR (in); - } - - ddata->in = in; -return 0 ; }
@@ -346,7 +349,7 @@ static int hdmic_probe(struct platform_device *pdev) r =devm_gpio_request_one (&pdev->dev, ddata->hpd_gpio,GPIOF_DIR_IN ,"hdmi_hpd" );if (r) - goto err_reg; +return r; r = devm_request_threaded_irq(&pdev->dev, gpio_to_irq(ddata->hpd_gpio),
@@ -355,7 +358,7 @@ static int hdmic_probe(struct platform_device *pdev)IRQF_ONESHOT , "hdmic hpd", ddata);if (r) - goto err_reg; +return r; } ddata->vm = hdmic_default_vm;
@@ -370,28 +373,22 @@ static int hdmic_probe(struct platform_device *pdev) r =omapdss_register_display (dssdev);if (r) {dev_err (&pdev->dev,"Failed to register panel\n" ); - goto err_reg; +return r; }return 0 ; -err_reg: -omap_dss_put_device (ddata->in); -return r; } static int __exit hdmic_remove(struct platform_device *pdev) {struct panel_drv_data *ddata =platform_get_drvdata (pdev);struct omap_dss_device *dssdev = &ddata->dssdev; -struct omap_dss_device *in = ddata->in;omapdss_unregister_display (&ddata->dssdev);hdmic_disable (dssdev);hdmic_disconnect (dssdev); -omap_dss_put_device (in); -return 0 ; }
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 17/48] drm: omapdrm: displays: Get connector source at connect time
Hi,
Quoted 7 lines · Laurent Pinchart
The connector drivers need a handle to the source they are connected to in order to control the source.
All drivers get that handle at probe time, resulting in probe deferral when the source hasn't been probed yet. However they don't need the handle until their connect handler is called.
Quoted 5 lines
Move retrieval of the source handle to the connect handler to avoid probe deferrals.
Signed-off-by Laurent Pinchart <[email protected]>---
-- Sebastian
Quoted 331 lines
.../gpu/drm/omapdrm/displays/connector-analog-tv.c | 45 ++++++++-------------- drivers/gpu/drm/omapdrm/displays/connector-dvi.c | 31 +++++++-------- drivers/gpu/drm/omapdrm/displays/connector-hdmi.c | 37 ++++++++---------- 3 files changed, 46 insertions(+), 67 deletions(-)drivers/gpu/drm/omapdrm/displays/connector-analog-tv.c +15
-30@@ -45,7 +45,7 @@ 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 = ddata->in; +struct omap_dss_device *in;int r;dev_dbg (ddata->dev,"connect\n" );@@ -53,10 +53,19 @@ static int tvc_connect(struct omap_dss_device *dssdev)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" ); +return PTR_ERR (in); + } + r = in->ops.atv->connect (in, dssdev); -if (r) +if (r) { +omap_dss_put_device (in);return r; + } + ddata->in = in;return 0 ; }@@ -71,6 +80,9 @@ static void tvc_disconnect(struct omap_dss_device *dssdev)return ; in->ops.atv->disconnect (in, dssdev); + +omap_dss_put_device (in); + ddata->in =NULL ; }static int tvc_enable (struct omap_dss_device *dssdev)@@ -173,23 +185,6 @@ static struct omap_dss_driver tvc_driver = { .set_wss = tvc_set_wss, }; -static int tvc_probe_of (struct platform_device *pdev) -{ -struct panel_drv_data *ddata =platform_get_drvdata (pdev); -struct device_node *node = pdev->dev.of_node; -struct omap_dss_device *in; - - in =omapdss_of_find_source_for_first_ep (node); -if (IS_ERR (in)) { -dev_err (&pdev->dev,"failed to find video source\n" ); -return PTR_ERR (in); - } - - ddata->in = in; - -return 0 ; -} -static int tvc_probe (struct platform_device *pdev) {struct panel_drv_data *ddata;@@ -203,10 +198,6 @@ static int tvc_probe(struct platform_device *pdev)platform_set_drvdata (pdev, ddata); ddata->dev = &pdev->dev; - r =tvc_probe_of (pdev); -if (r) -return r; - ddata->vm = tvc_pal_vm; dssdev = &ddata->dssdev;@@ -219,28 +210,22 @@ static int tvc_probe(struct platform_device *pdev) r =omapdss_register_display (dssdev);if (r) {dev_err (&pdev->dev,"Failed to register panel\n" ); - goto err_reg; +return r; }return 0 ; -err_reg: -omap_dss_put_device (ddata->in); -return r; } static int __exit tvc_remove(struct platform_device *pdev) {struct panel_drv_data *ddata =platform_get_drvdata (pdev);struct omap_dss_device *dssdev = &ddata->dssdev; -struct omap_dss_device *in = ddata->in;omapdss_unregister_display (&ddata->dssdev);tvc_disable (dssdev);tvc_disconnect (dssdev); -omap_dss_put_device (in); -return 0 ; }drivers/gpu/drm/omapdrm/displays/connector-dvi.c +14
-17@@ -51,16 +51,25 @@ 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 = ddata->in; +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" ); +return PTR_ERR (in); + } + r = in->ops.dvi->connect (in, dssdev); -if (r) +if (r) { +omap_dss_put_device (in);return r; + } + ddata->in = in;return 0 ; }@@ -73,6 +82,9 @@ static void dvic_disconnect(struct omap_dss_device *dssdev)return ; in->ops.dvi->disconnect (in, dssdev); + +omap_dss_put_device (in); + ddata->in =NULL ; }static int dvic_enable (struct omap_dss_device *dssdev)@@ -235,25 +247,15 @@ static int dvic_probe_of(struct platform_device *pdev) {struct panel_drv_data *ddata =platform_get_drvdata (pdev);struct device_node *node = pdev->dev.of_node; -struct omap_dss_device *in;struct device_node *adapter_node;struct i2c_adapter *adapter; - in =omapdss_of_find_source_for_first_ep (node); -if (IS_ERR (in)) { -dev_err (&pdev->dev,"failed to find video source\n" ); -return PTR_ERR (in); - } - - ddata->in = in; - adapter_node =of_parse_phandle (node,"ddc-i2c-bus" ,0 );if (adapter_node) { adapter =of_get_i2c_adapter_by_node (adapter_node);of_node_put (adapter_node);if (adapter ==NULL ) {dev_err (&pdev->dev,"failed to parse ddc-i2c-bus\n" ); -omap_dss_put_device (ddata->in);return -EPROBE_DEFER ; }@@ -297,8 +299,6 @@ static int dvic_probe(struct platform_device *pdev)return 0 ; err_reg: -omap_dss_put_device (ddata->in); -i2c_put_adapter (ddata->i2c_adapter);return r;@@ -308,15 +308,12 @@ static int __exit dvic_remove(struct platform_device *pdev) {struct panel_drv_data *ddata =platform_get_drvdata (pdev);struct omap_dss_device *dssdev = &ddata->dssdev; -struct omap_dss_device *in = ddata->in;omapdss_unregister_display (&ddata->dssdev);dvic_disable (dssdev);dvic_disconnect (dssdev); -omap_dss_put_device (in); -i2c_put_adapter (ddata->i2c_adapter);return 0 ;drivers/gpu/drm/omapdrm/displays/connector-hdmi.c +17
-20@@ -55,7 +55,7 @@ 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 = ddata->in; +struct omap_dss_device *in;int r;dev_dbg (ddata->dev,"connect\n" );@@ -63,10 +63,19 @@ static int hdmic_connect(struct omap_dss_device *dssdev)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" ); +return PTR_ERR (in); + } + r = in->ops.hdmi->connect (in, dssdev); -if (r) +if (r) { +omap_dss_put_device (in);return r; + } + ddata->in = in;return 0 ; }@@ -81,6 +90,9 @@ static void hdmic_disconnect(struct omap_dss_device *dssdev)return ; in->ops.hdmi->disconnect (in, dssdev); + +omap_dss_put_device (in); + ddata->in =NULL ; }static int hdmic_enable (struct omap_dss_device *dssdev)@@ -302,7 +314,6 @@ static int hdmic_probe_of(struct platform_device *pdev) {struct panel_drv_data *ddata =platform_get_drvdata (pdev);struct device_node *node = pdev->dev.of_node; -struct omap_dss_device *in;int gpio;/* HPD GPIO */ @@ -312,14 +323,6 @@ static int hdmic_probe_of(struct platform_device *pdev)else ddata->hpd_gpio = -ENODEV ; - in =omapdss_of_find_source_for_first_ep (node); -if (IS_ERR (in)) { -dev_err (&pdev->dev,"failed to find video source\n" ); -return PTR_ERR (in); - } - - ddata->in = in; -return 0 ; }@@ -346,7 +349,7 @@ static int hdmic_probe(struct platform_device *pdev) r =devm_gpio_request_one (&pdev->dev, ddata->hpd_gpio,GPIOF_DIR_IN ,"hdmi_hpd" );if (r) - goto err_reg; +return r; r = devm_request_threaded_irq(&pdev->dev, gpio_to_irq(ddata->hpd_gpio),@@ -355,7 +358,7 @@ static int hdmic_probe(struct platform_device *pdev)IRQF_ONESHOT , "hdmic hpd", ddata);if (r) - goto err_reg; +return r; } ddata->vm = hdmic_default_vm;@@ -370,28 +373,22 @@ static int hdmic_probe(struct platform_device *pdev) r =omapdss_register_display (dssdev);if (r) {dev_err (&pdev->dev,"Failed to register panel\n" ); - goto err_reg; +return r; }return 0 ; -err_reg: -omap_dss_put_device (ddata->in); -return r; } static int __exit hdmic_remove(struct platform_device *pdev) {struct panel_drv_data *ddata =platform_get_drvdata (pdev);struct omap_dss_device *dssdev = &ddata->dssdev; -struct omap_dss_device *in = ddata->in;omapdss_unregister_display (&ddata->dssdev);hdmic_disable (dssdev);hdmic_disconnect (dssdev); -omap_dss_put_device (in); -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 18/48 drm: omapdrm: displays: Get panel source at connect time
In reply to Laurent PinchartThe connector drivers need a handle to the source they are connected to in order to control the source.
All drivers get that handle at probe time, resulting in probe deferral when the source hasn't been probed yet. However they don't need the handle until their connect handler is called.
Move retrieval of the source handle to the connect handler to avoid probe deferrals.
--- drivers/gpu/drm/omapdrm/displays/panel-dpi.c | 35 +++++++--------- drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 27 +++++++------ .../omapdrm/displays/panel-lgphilips-lb035q02.c | 35 +++++++--------- .../drm/omapdrm/displays/panel-nec-nl8048hl11.c | 39 ++++++++---------- .../drm/omapdrm/displays/panel-sharp-ls037v7dw01.c | 35 +++++++--------- .../drm/omapdrm/displays/panel-sony-acx565akm.c | 26 ++++++------ .../drm/omapdrm/displays/panel-tpo-td028ttec1.c | 46 +++++++--------------- .../drm/omapdrm/displays/panel-tpo-td043mtea1.c | 29 +++++++------- 8 files changed, 119 insertions(+), 153 deletions(-)
drivers/gpu/drm/omapdrm/displays/panel-dpi.c +15 -20
@@ -38,16 +38,25 @@ 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 = ddata->in; +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" ); +return PTR_ERR (in); + } + r = in->ops.dpi->connect (in, dssdev); -if (r) +if (r) { +omap_dss_put_device (in);return r; + } + ddata->in = in;return 0 ; }
@@ -60,6 +69,9 @@ static void panel_dpi_disconnect(struct omap_dss_device *dssdev)return ; in->ops.dpi->disconnect (in, dssdev); + +omap_dss_put_device (in); + ddata->in =NULL ; }static int panel_dpi_enable (struct omap_dss_device *dssdev)
@@ -165,7 +177,6 @@ static int panel_dpi_probe_of(struct platform_device *pdev)struct panel_drv_data *ddata =platform_get_drvdata (pdev);struct device_node *node = pdev->dev.of_node;struct device_node *bl_node; -struct omap_dss_device *in;int r;struct display_timing timing;struct gpio_desc *gpio;
@@ -207,15 +218,6 @@ static int panel_dpi_probe_of(struct platform_device *pdev)videomode_from_timing (&timing, &ddata->vm); - in =omapdss_of_find_source_for_first_ep (node); -if (IS_ERR (in)) { -dev_err (&pdev->dev,"failed to find video source\n" ); - r =PTR_ERR (in); - goto error_free_backlight; - } - - ddata->in = in; -return 0 ; error_free_backlight:
@@ -251,29 +253,22 @@ static int panel_dpi_probe(struct platform_device *pdev) r =omapdss_register_display (dssdev);if (r) {dev_err (&pdev->dev,"Failed to register panel\n" ); - goto err_reg; +return r; }return 0 ; - -err_reg: -omap_dss_put_device (ddata->in); -return r; } static int __exit panel_dpi_remove(struct platform_device *pdev) {struct panel_drv_data *ddata =platform_get_drvdata (pdev);struct omap_dss_device *dssdev = &ddata->dssdev; -struct omap_dss_device *in = ddata->in;omapdss_unregister_display (dssdev);panel_dpi_disable (dssdev);panel_dpi_disconnect (dssdev); -omap_dss_put_device (in); -if (ddata->backlight)put_device (&ddata->backlight->dev);
drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +14 -13
@@ -703,17 +703,23 @@ static int dsicm_panel_reset(struct panel_drv_data *ddata)static int dsicm_connect (struct omap_dss_device *dssdev) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in;struct device *dev = &ddata->pdev->dev; +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" ); +return PTR_ERR (in); + } + r = in->ops.dsi->connect (in, dssdev);if (r) {dev_err (dev,"Failed to connect to video source\n" ); -return r; + goto err_connect; } r = in->ops.dsi->request_vc (ddata->in, &ddata->channel);
@@ -728,12 +734,15 @@ static int dsicm_connect(struct omap_dss_device *dssdev) goto err_vc_id; } + ddata->in = in;return 0 ; err_vc_id: in->ops.dsi->release_vc (ddata->in, ddata->channel); err_req_vc: in->ops.dsi->disconnect (in, dssdev); +err_connect: +omap_dss_put_device (in);return r; }
@@ -747,6 +756,9 @@ static void dsicm_disconnect(struct omap_dss_device *dssdev) in->ops.dsi->release_vc (in, ddata->channel); in->ops.dsi->disconnect (in, dssdev); + +omap_dss_put_device (in); + ddata->in =NULL ; }static int dsicm_enable (struct omap_dss_device *dssdev)
@@ -1119,7 +1131,6 @@ static int dsicm_probe_of(struct platform_device *pdev) {struct device_node *node = pdev->dev.of_node;struct panel_drv_data *ddata =platform_get_drvdata (pdev); -struct omap_dss_device *in;int gpio; gpio =of_get_named_gpio (node,"reset-gpios" ,0 );
@@ -1137,14 +1148,6 @@ static int dsicm_probe_of(struct platform_device *pdev)return gpio; } - in =omapdss_of_find_source_for_first_ep (node); -if (IS_ERR (in)) { -dev_err (&pdev->dev,"failed to find video source\n" ); -return PTR_ERR (in); - } - - ddata->in = in; -/* TODO: ulps, backlight */ return 0 ;
@@ -1298,8 +1301,6 @@ static int __exit dsicm_remove(struct platform_device *pdev)backlight_device_unregister (bldev); } -omap_dss_put_device (ddata->in); -dsicm_cancel_ulps_work (ddata);destroy_workqueue (ddata->workqueue);
drivers/gpu/drm/omapdrm/displays/panel-lgphilips-lb035q02.c +15 -20
@@ -119,18 +119,27 @@ 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 = ddata->in; +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" ); +return PTR_ERR (in); + } + r = in->ops.dpi->connect (in, dssdev); -if (r) +if (r) { +omap_dss_put_device (in);return r; + }init_lb035q02_panel (ddata->spi); + ddata->in = in;return 0 ; }
@@ -143,6 +152,9 @@ static void lb035q02_disconnect(struct omap_dss_device *dssdev)return ; in->ops.dpi->disconnect (in, dssdev); + +omap_dss_put_device (in); + ddata->in =NULL ; }static int lb035q02_enable (struct omap_dss_device *dssdev)
@@ -230,9 +242,7 @@ static struct omap_dss_driver lb035q02_ops = {static int lb035q02_probe_of (struct spi_device *spi) { -struct device_node *node = spi->dev.of_node;struct panel_drv_data *ddata =dev_get_drvdata (&spi->dev); -struct omap_dss_device *in;struct gpio_desc *gpio; gpio =devm_gpiod_get (&spi->dev,"enable" ,GPIOD_OUT_LOW );
@@ -243,14 +253,6 @@ static int lb035q02_probe_of(struct spi_device *spi) ddata->enable_gpio = gpio; - in =omapdss_of_find_source_for_first_ep (node); -if (IS_ERR (in)) { -dev_err (&spi->dev,"failed to find video source\n" ); -return PTR_ERR (in); - } - - ddata->in = in; -return 0 ; }
@@ -284,29 +286,22 @@ static int lb035q02_panel_spi_probe(struct spi_device *spi) r =omapdss_register_display (dssdev);if (r) {dev_err (&spi->dev,"Failed to register panel\n" ); - goto err_reg; +return r; }return 0 ; - -err_reg: -omap_dss_put_device (ddata->in); -return r; }static int lb035q02_panel_spi_remove (struct spi_device *spi) {struct panel_drv_data *ddata =dev_get_drvdata (&spi->dev);struct omap_dss_device *dssdev = &ddata->dssdev; -struct omap_dss_device *in = ddata->in;omapdss_unregister_display (dssdev);lb035q02_disable (dssdev);lb035q02_disconnect (dssdev); -omap_dss_put_device (in); -return 0 ; }
drivers/gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c +17 -22
@@ -115,16 +115,25 @@ 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 = ddata->in; +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" ); +return PTR_ERR (in); + } + r = in->ops.dpi->connect (in, dssdev); -if (r) +if (r) { +omap_dss_put_device (in);return r; + } + ddata->in = in;return 0 ; }
@@ -137,6 +146,9 @@ static void nec_8048_disconnect(struct omap_dss_device *dssdev)return ; in->ops.dpi->disconnect (in, dssdev); + +omap_dss_put_device (in); + ddata->in =NULL ; }static int nec_8048_enable (struct omap_dss_device *dssdev)
@@ -226,7 +238,6 @@ static int nec_8048_probe_of(struct spi_device *spi) {struct device_node *node = spi->dev.of_node;struct panel_drv_data *ddata =dev_get_drvdata (&spi->dev); -struct omap_dss_device *in;int gpio; gpio =of_get_named_gpio (node,"reset-gpios" ,0 );
@@ -239,14 +250,6 @@ static int nec_8048_probe_of(struct spi_device *spi)/* XXX the panel spec doesn't mention any QVGA pin?? */ ddata->qvga_gpio = -ENOENT ; - in =omapdss_of_find_source_for_first_ep (node); -if (IS_ERR (in)) { -dev_err (&spi->dev,"failed to find video source\n" ); -return PTR_ERR (in); - } - - ddata->in = in; -return 0 ; }
@@ -285,14 +288,14 @@ static int nec_8048_probe(struct spi_device *spi) r =devm_gpio_request_one (&spi->dev, ddata->qvga_gpio,GPIOF_OUT_INIT_HIGH ,"lcd QVGA" );if (r) - goto err_gpio; +return r; }if (gpio_is_valid (ddata->res_gpio)) { r =devm_gpio_request_one (&spi->dev, ddata->res_gpio,GPIOF_OUT_INIT_LOW ,"lcd RES" );if (r) - goto err_gpio; +return r; } ddata->vm = nec_8048_panel_vm;
@@ -307,22 +310,16 @@ static int nec_8048_probe(struct spi_device *spi) r =omapdss_register_display (dssdev);if (r) {dev_err (&spi->dev,"Failed to register panel\n" ); - goto err_reg; +return r; }return 0 ; - -err_reg: -err_gpio: -omap_dss_put_device (ddata->in); -return r; }static int nec_8048_remove (struct spi_device *spi) {struct panel_drv_data *ddata =dev_get_drvdata (&spi->dev);struct omap_dss_device *dssdev = &ddata->dssdev; -struct omap_dss_device *in = ddata->in;dev_dbg (&ddata->spi->dev,"%s\n" , __func__);
@@ -331,8 +328,6 @@ static int nec_8048_remove(struct spi_device *spi)nec_8048_disable (dssdev);nec_8048_disconnect (dssdev); -omap_dss_put_device (in); -return 0 ; }
drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c +15 -20
@@ -61,16 +61,25 @@ 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 = ddata->in; +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" ); +return PTR_ERR (in); + } + r = in->ops.dpi->connect (in, dssdev); -if (r) +if (r) { +omap_dss_put_device (in);return r; + } + ddata->in = in;return 0 ; }
@@ -83,6 +92,9 @@ static void sharp_ls_disconnect(struct omap_dss_device *dssdev)return ; in->ops.dpi->disconnect (in, dssdev); + +omap_dss_put_device (in); + ddata->in =NULL ; }static int sharp_ls_enable (struct omap_dss_device *dssdev)
@@ -210,8 +222,6 @@ static int sharp_ls_get_gpio_of(struct device *dev, int index, int val,static int sharp_ls_probe_of (struct platform_device *pdev) {struct panel_drv_data *ddata =platform_get_drvdata (pdev); -struct device_node *node = pdev->dev.of_node; -struct omap_dss_device *in;int r; ddata->vcc =devm_regulator_get (&pdev->dev,"envdd" );
@@ -245,14 +255,6 @@ static int sharp_ls_probe_of(struct platform_device *pdev)if (r)return r; - in =omapdss_of_find_source_for_first_ep (node); -if (IS_ERR (in)) { -dev_err (&pdev->dev,"failed to find video source\n" ); -return PTR_ERR (in); - } - - ddata->in = in; -return 0 ; }
@@ -284,29 +286,22 @@ static int sharp_ls_probe(struct platform_device *pdev) r =omapdss_register_display (dssdev);if (r) {dev_err (&pdev->dev,"Failed to register panel\n" ); - goto err_reg; +return r; }return 0 ; - -err_reg: -omap_dss_put_device (ddata->in); -return r; } static int __exit sharp_ls_remove(struct platform_device *pdev) {struct panel_drv_data *ddata =platform_get_drvdata (pdev);struct omap_dss_device *dssdev = &ddata->dssdev; -struct omap_dss_device *in = ddata->in;omapdss_unregister_display (dssdev);sharp_ls_disable (dssdev);sharp_ls_disconnect (dssdev); -omap_dss_put_device (in); -return 0 ; }
drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c +14 -12
@@ -510,16 +510,25 @@ 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 = ddata->in; +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" ); +return PTR_ERR (in); + } + r = in->ops.sdi->connect (in, dssdev); -if (r) +if (r) { +omap_dss_put_device (in);return r; + } + ddata->in = in;return 0 ; }
@@ -532,6 +541,9 @@ static void acx565akm_disconnect(struct omap_dss_device *dssdev)return ; in->ops.sdi->disconnect (in, dssdev); + +omap_dss_put_device (in); + ddata->in =NULL ; }static int acx565akm_panel_power_on (struct omap_dss_device *dssdev)
@@ -700,12 +712,6 @@ static int acx565akm_probe_of(struct spi_device *spi) ddata->reset_gpio =of_get_named_gpio (np,"reset-gpios" ,0 ); - ddata->in =omapdss_of_find_source_for_first_ep (np); -if (IS_ERR (ddata->in)) { -dev_err (&spi->dev,"failed to find video source\n" ); -return PTR_ERR (ddata->in); - } -return 0 ; }
@@ -823,7 +829,6 @@ static int acx565akm_probe(struct spi_device *spi) err_reg_bl: err_detect: err_gpio: -omap_dss_put_device (ddata->in);return r; }
@@ -831,7 +836,6 @@ static int acx565akm_remove(struct spi_device *spi) {struct panel_drv_data *ddata =dev_get_drvdata (&spi->dev);struct omap_dss_device *dssdev = &ddata->dssdev; -struct omap_dss_device *in = ddata->in;dev_dbg (&ddata->spi->dev,"%s\n" , __func__);
@@ -843,8 +847,6 @@ static int acx565akm_remove(struct spi_device *spi)acx565akm_disable (dssdev);acx565akm_disconnect (dssdev); -omap_dss_put_device (in); -return 0 ; }
drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c +15 -31
99 lines not on this page · raw message
drivers/gpu/drm/omapdrm/displays/panel-tpo-td043mtea1.c +14 -15
@@ -340,16 +340,25 @@ 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 = ddata->in; +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" ); +return PTR_ERR (in); + } + r = in->ops.dpi->connect (in, dssdev); -if (r) +if (r) { +omap_dss_put_device (in);return r; + } + ddata->in = in;return 0 ; }
@@ -362,6 +371,9 @@ static void tpo_td043_disconnect(struct omap_dss_device *dssdev)return ; in->ops.dpi->disconnect (in, dssdev); + +omap_dss_put_device (in); + ddata->in =NULL ; }static int tpo_td043_enable (struct omap_dss_device *dssdev)
@@ -463,7 +475,6 @@ static int tpo_td043_probe_of(struct spi_device *spi) {struct device_node *node = spi->dev.of_node;struct panel_drv_data *ddata =dev_get_drvdata (&spi->dev); -struct omap_dss_device *in;int gpio; gpio =of_get_named_gpio (node,"reset-gpios" ,0 );
@@ -473,14 +484,6 @@ static int tpo_td043_probe_of(struct spi_device *spi) } ddata->nreset_gpio = gpio; - in =omapdss_of_find_source_for_first_ep (node); -if (IS_ERR (in)) { -dev_err (&spi->dev,"failed to find video source\n" ); -return PTR_ERR (in); - } - - ddata->in = in; -return 0 ; }
@@ -561,7 +564,6 @@ static int tpo_td043_probe(struct spi_device *spi) err_sysfs: err_gpio_req: err_regulator: -omap_dss_put_device (ddata->in);return r; }
@@ -569,7 +571,6 @@ static int tpo_td043_remove(struct spi_device *spi) {struct panel_drv_data *ddata =dev_get_drvdata (&spi->dev);struct omap_dss_device *dssdev = &ddata->dssdev; -struct omap_dss_device *in = ddata->in;dev_dbg (&ddata->spi->dev,"%s\n" , __func__);
@@ -578,8 +579,6 @@ static int tpo_td043_remove(struct spi_device *spi)tpo_td043_disable (dssdev);tpo_td043_disconnect (dssdev); -omap_dss_put_device (in); -sysfs_remove_group (&spi->dev.kobj, &tpo_td043_attr_group);return 0 ;
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 18/48] drm: omapdrm: displays: Get panel source at connect time
Hi,
Quoted 7 lines · Laurent Pinchart
The connector drivers need a handle to the source they are connected to in order to control the source.
All drivers get that handle at probe time, resulting in probe deferral when the source hasn't been probed yet. However they don't need the handle until their connect handler is called.
Quoted 5 lines
Move retrieval of the source handle to the connect handler to avoid probe deferrals.
Signed-off-by Laurent Pinchart <[email protected]>---
-- Sebastian
Quoted 795 lines
drivers/gpu/drm/omapdrm/displays/panel-dpi.c | 35 +++++++--------- drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c | 27 +++++++------ .../omapdrm/displays/panel-lgphilips-lb035q02.c | 35 +++++++--------- .../drm/omapdrm/displays/panel-nec-nl8048hl11.c | 39 ++++++++---------- .../drm/omapdrm/displays/panel-sharp-ls037v7dw01.c | 35 +++++++--------- .../drm/omapdrm/displays/panel-sony-acx565akm.c | 26 ++++++------ .../drm/omapdrm/displays/panel-tpo-td028ttec1.c | 46 +++++++--------------- .../drm/omapdrm/displays/panel-tpo-td043mtea1.c | 29 +++++++------- 8 files changed, 119 insertions(+), 153 deletions(-)drivers/gpu/drm/omapdrm/displays/panel-dpi.c +15
-20@@ -38,16 +38,25 @@ 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 = ddata->in; +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" ); +return PTR_ERR (in); + } + r = in->ops.dpi->connect (in, dssdev); -if (r) +if (r) { +omap_dss_put_device (in);return r; + } + ddata->in = in;return 0 ; }@@ -60,6 +69,9 @@ static void panel_dpi_disconnect(struct omap_dss_device *dssdev)return ; in->ops.dpi->disconnect (in, dssdev); + +omap_dss_put_device (in); + ddata->in =NULL ; }static int panel_dpi_enable (struct omap_dss_device *dssdev)@@ -165,7 +177,6 @@ static int panel_dpi_probe_of(struct platform_device *pdev)struct panel_drv_data *ddata =platform_get_drvdata (pdev);struct device_node *node = pdev->dev.of_node;struct device_node *bl_node; -struct omap_dss_device *in;int r;struct display_timing timing;struct gpio_desc *gpio;@@ -207,15 +218,6 @@ static int panel_dpi_probe_of(struct platform_device *pdev)videomode_from_timing (&timing, &ddata->vm); - in =omapdss_of_find_source_for_first_ep (node); -if (IS_ERR (in)) { -dev_err (&pdev->dev,"failed to find video source\n" ); - r =PTR_ERR (in); - goto error_free_backlight; - } - - ddata->in = in; -return 0 ; error_free_backlight:@@ -251,29 +253,22 @@ static int panel_dpi_probe(struct platform_device *pdev) r =omapdss_register_display (dssdev);if (r) {dev_err (&pdev->dev,"Failed to register panel\n" ); - goto err_reg; +return r; }return 0 ; - -err_reg: -omap_dss_put_device (ddata->in); -return r; } static int __exit panel_dpi_remove(struct platform_device *pdev) {struct panel_drv_data *ddata =platform_get_drvdata (pdev);struct omap_dss_device *dssdev = &ddata->dssdev; -struct omap_dss_device *in = ddata->in;omapdss_unregister_display (dssdev);panel_dpi_disable (dssdev);panel_dpi_disconnect (dssdev); -omap_dss_put_device (in); -if (ddata->backlight)put_device (&ddata->backlight->dev);drivers/gpu/drm/omapdrm/displays/panel-dsi-cm.c +14
-13@@ -703,17 +703,23 @@ static int dsicm_panel_reset(struct panel_drv_data *ddata)static int dsicm_connect (struct omap_dss_device *dssdev) {struct panel_drv_data *ddata =to_panel_data (dssdev); -struct omap_dss_device *in = ddata->in;struct device *dev = &ddata->pdev->dev; +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" ); +return PTR_ERR (in); + } + r = in->ops.dsi->connect (in, dssdev);if (r) {dev_err (dev,"Failed to connect to video source\n" ); -return r; + goto err_connect; } r = in->ops.dsi->request_vc (ddata->in, &ddata->channel);@@ -728,12 +734,15 @@ static int dsicm_connect(struct omap_dss_device *dssdev) goto err_vc_id; } + ddata->in = in;return 0 ; err_vc_id: in->ops.dsi->release_vc (ddata->in, ddata->channel); err_req_vc: in->ops.dsi->disconnect (in, dssdev); +err_connect: +omap_dss_put_device (in);return r; }@@ -747,6 +756,9 @@ static void dsicm_disconnect(struct omap_dss_device *dssdev) in->ops.dsi->release_vc (in, ddata->channel); in->ops.dsi->disconnect (in, dssdev); + +omap_dss_put_device (in); + ddata->in =NULL ; }static int dsicm_enable (struct omap_dss_device *dssdev)@@ -1119,7 +1131,6 @@ static int dsicm_probe_of(struct platform_device *pdev) {struct device_node *node = pdev->dev.of_node;struct panel_drv_data *ddata =platform_get_drvdata (pdev); -struct omap_dss_device *in;int gpio; gpio =of_get_named_gpio (node,"reset-gpios" ,0 );@@ -1137,14 +1148,6 @@ static int dsicm_probe_of(struct platform_device *pdev)return gpio; } - in =omapdss_of_find_source_for_first_ep (node); -if (IS_ERR (in)) { -dev_err (&pdev->dev,"failed to find video source\n" ); -return PTR_ERR (in); - } - - ddata->in = in; -/* TODO: ulps, backlight */ return 0 ;@@ -1298,8 +1301,6 @@ static int __exit dsicm_remove(struct platform_device *pdev)backlight_device_unregister (bldev); } -omap_dss_put_device (ddata->in); -dsicm_cancel_ulps_work (ddata);destroy_workqueue (ddata->workqueue);drivers/gpu/drm/omapdrm/displays/panel-lgphilips-lb035q02.c +15
-20@@ -119,18 +119,27 @@ 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 = ddata->in; +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" ); +return PTR_ERR (in); + } + r = in->ops.dpi->connect (in, dssdev); -if (r) +if (r) { +omap_dss_put_device (in);return r; + }init_lb035q02_panel (ddata->spi); + ddata->in = in;return 0 ; }@@ -143,6 +152,9 @@ static void lb035q02_disconnect(struct omap_dss_device *dssdev)return ; in->ops.dpi->disconnect (in, dssdev); + +omap_dss_put_device (in); + ddata->in =NULL ; }static int lb035q02_enable (struct omap_dss_device *dssdev)@@ -230,9 +242,7 @@ static struct omap_dss_driver lb035q02_ops = {static int lb035q02_probe_of (struct spi_device *spi) { -struct device_node *node = spi->dev.of_node;struct panel_drv_data *ddata =dev_get_drvdata (&spi->dev); -struct omap_dss_device *in;struct gpio_desc *gpio; gpio =devm_gpiod_get (&spi->dev,"enable" ,GPIOD_OUT_LOW );@@ -243,14 +253,6 @@ static int lb035q02_probe_of(struct spi_device *spi) ddata->enable_gpio = gpio; - in =omapdss_of_find_source_for_first_ep (node); -if (IS_ERR (in)) { -dev_err (&spi->dev,"failed to find video source\n" ); -return PTR_ERR (in); - } - - ddata->in = in; -return 0 ; }@@ -284,29 +286,22 @@ static int lb035q02_panel_spi_probe(struct spi_device *spi) r =omapdss_register_display (dssdev);if (r) {dev_err (&spi->dev,"Failed to register panel\n" ); - goto err_reg; +return r; }return 0 ; - -err_reg: -omap_dss_put_device (ddata->in); -return r; }static int lb035q02_panel_spi_remove (struct spi_device *spi) {struct panel_drv_data *ddata =dev_get_drvdata (&spi->dev);struct omap_dss_device *dssdev = &ddata->dssdev; -struct omap_dss_device *in = ddata->in;omapdss_unregister_display (dssdev);lb035q02_disable (dssdev);lb035q02_disconnect (dssdev); -omap_dss_put_device (in); -return 0 ; }drivers/gpu/drm/omapdrm/displays/panel-nec-nl8048hl11.c +17
-22@@ -115,16 +115,25 @@ 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 = ddata->in; +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" ); +return PTR_ERR (in); + } + r = in->ops.dpi->connect (in, dssdev); -if (r) +if (r) { +omap_dss_put_device (in);return r; + } + ddata->in = in;return 0 ; }@@ -137,6 +146,9 @@ static void nec_8048_disconnect(struct omap_dss_device *dssdev)return ; in->ops.dpi->disconnect (in, dssdev); + +omap_dss_put_device (in); + ddata->in =NULL ; }static int nec_8048_enable (struct omap_dss_device *dssdev)@@ -226,7 +238,6 @@ static int nec_8048_probe_of(struct spi_device *spi) {struct device_node *node = spi->dev.of_node;struct panel_drv_data *ddata =dev_get_drvdata (&spi->dev); -struct omap_dss_device *in;int gpio; gpio =of_get_named_gpio (node,"reset-gpios" ,0 );@@ -239,14 +250,6 @@ static int nec_8048_probe_of(struct spi_device *spi)/* XXX the panel spec doesn't mention any QVGA pin?? */ ddata->qvga_gpio = -ENOENT ; - in =omapdss_of_find_source_for_first_ep (node); -if (IS_ERR (in)) { -dev_err (&spi->dev,"failed to find video source\n" ); -return PTR_ERR (in); - } - - ddata->in = in; -return 0 ; }@@ -285,14 +288,14 @@ static int nec_8048_probe(struct spi_device *spi) r =devm_gpio_request_one (&spi->dev, ddata->qvga_gpio,GPIOF_OUT_INIT_HIGH ,"lcd QVGA" );if (r) - goto err_gpio; +return r; }if (gpio_is_valid (ddata->res_gpio)) { r =devm_gpio_request_one (&spi->dev, ddata->res_gpio,GPIOF_OUT_INIT_LOW ,"lcd RES" );if (r) - goto err_gpio; +return r; } ddata->vm = nec_8048_panel_vm;@@ -307,22 +310,16 @@ static int nec_8048_probe(struct spi_device *spi) r =omapdss_register_display (dssdev);if (r) {dev_err (&spi->dev,"Failed to register panel\n" ); - goto err_reg; +return r; }return 0 ; - -err_reg: -err_gpio: -omap_dss_put_device (ddata->in); -return r; }static int nec_8048_remove (struct spi_device *spi) {struct panel_drv_data *ddata =dev_get_drvdata (&spi->dev);struct omap_dss_device *dssdev = &ddata->dssdev; -struct omap_dss_device *in = ddata->in;dev_dbg (&ddata->spi->dev,"%s\n" , __func__);@@ -331,8 +328,6 @@ static int nec_8048_remove(struct spi_device *spi)nec_8048_disable (dssdev);nec_8048_disconnect (dssdev); -omap_dss_put_device (in); -return 0 ; }drivers/gpu/drm/omapdrm/displays/panel-sharp-ls037v7dw01.c +15
-20@@ -61,16 +61,25 @@ 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 = ddata->in; +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" ); +return PTR_ERR (in); + } + r = in->ops.dpi->connect (in, dssdev); -if (r) +if (r) { +omap_dss_put_device (in);return r; + } + ddata->in = in;return 0 ; }@@ -83,6 +92,9 @@ static void sharp_ls_disconnect(struct omap_dss_device *dssdev)return ; in->ops.dpi->disconnect (in, dssdev); + +omap_dss_put_device (in); + ddata->in =NULL ; }static int sharp_ls_enable (struct omap_dss_device *dssdev)@@ -210,8 +222,6 @@ static int sharp_ls_get_gpio_of(struct device *dev, int index, int val,static int sharp_ls_probe_of (struct platform_device *pdev) {struct panel_drv_data *ddata =platform_get_drvdata (pdev); -struct device_node *node = pdev->dev.of_node; -struct omap_dss_device *in;int r; ddata->vcc =devm_regulator_get (&pdev->dev,"envdd" );@@ -245,14 +255,6 @@ static int sharp_ls_probe_of(struct platform_device *pdev)if (r)return r; - in =omapdss_of_find_source_for_first_ep (node); -if (IS_ERR (in)) { -dev_err (&pdev->dev,"failed to find video source\n" ); -return PTR_ERR (in); - } - - ddata->in = in; -return 0 ; }@@ -284,29 +286,22 @@ static int sharp_ls_probe(struct platform_device *pdev) r =omapdss_register_display (dssdev);if (r) {dev_err (&pdev->dev,"Failed to register panel\n" ); - goto err_reg; +return r; }return 0 ; - -err_reg: -omap_dss_put_device (ddata->in); -return r; } static int __exit sharp_ls_remove(struct platform_device *pdev) {struct panel_drv_data *ddata =platform_get_drvdata (pdev);struct omap_dss_device *dssdev = &ddata->dssdev; -struct omap_dss_device *in = ddata->in;omapdss_unregister_display (dssdev);sharp_ls_disable (dssdev);sharp_ls_disconnect (dssdev); -omap_dss_put_device (in); -return 0 ; }drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c +14
-12@@ -510,16 +510,25 @@ 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 = ddata->in; +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" ); +return PTR_ERR (in); + } + r = in->ops.sdi->connect (in, dssdev); -if (r) +if (r) { +omap_dss_put_device (in);return r; + } + ddata->in = in;return 0 ; }@@ -532,6 +541,9 @@ static void acx565akm_disconnect(struct omap_dss_device *dssdev)return ; in->ops.sdi->disconnect (in, dssdev); + +omap_dss_put_device (in); + ddata->in =NULL ; }static int acx565akm_panel_power_on (struct omap_dss_device *dssdev)@@ -700,12 +712,6 @@ static int acx565akm_probe_of(struct spi_device *spi) ddata->reset_gpio =of_get_named_gpio (np,"reset-gpios" ,0 ); - ddata->in =omapdss_of_find_source_for_first_ep (np); -if (IS_ERR (ddata->in)) { -dev_err (&spi->dev,"failed to find video source\n" ); -return PTR_ERR (ddata->in); - } -return 0 ; }@@ -823,7 +829,6 @@ static int acx565akm_probe(struct spi_device *spi) err_reg_bl: err_detect: err_gpio: -omap_dss_put_device (ddata->in);return r; }@@ -831,7 +836,6 @@ static int acx565akm_remove(struct spi_device *spi) {struct panel_drv_data *ddata =dev_get_drvdata (&spi->dev);struct omap_dss_device *dssdev = &ddata->dssdev; -struct omap_dss_device *in = ddata->in;dev_dbg (&ddata->spi->dev,"%s\n" , __func__);@@ -843,8 +847,6 @@ static int acx565akm_remove(struct spi_device *spi)acx565akm_disable (dssdev);acx565akm_disconnect (dssdev); -omap_dss_put_device (in); -return 0 ; }drivers/gpu/drm/omapdrm/displays/panel-tpo-td028ttec1.c +15
-31@@ -169,16 +169,25 @@ 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 = ddata->in; +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" ); +return PTR_ERR (in); + } + r = in->ops.dpi->connect (in, dssdev); -if (r) +if (r) { +omap_dss_put_device (in);return r; + } + ddata->in = in;return 0 ; }@@ -191,6 +200,9 @@ static void td028ttec1_panel_disconnect(struct omap_dss_device *dssdev)return ; in->ops.dpi->disconnect (in, dssdev); + +omap_dss_put_device (in); + ddata->in =NULL ; }static int td028ttec1_panel_enable (struct omap_dss_device *dssdev)@@ -362,23 +374,6 @@ static struct omap_dss_driver td028ttec1_ops = { .check_timings = td028ttec1_panel_check_timings, }; -static int td028ttec1_probe_of (struct spi_device *spi) -{ -struct device_node *node = spi->dev.of_node; -struct panel_drv_data *ddata =dev_get_drvdata (&spi->dev); -struct omap_dss_device *in; - - in =omapdss_of_find_source_for_first_ep (node); -if (IS_ERR (in)) { -dev_err (&spi->dev,"failed to find video source\n" ); -return PTR_ERR (in); - } - - ddata->in = in; - -return 0 ; -} -static int td028ttec1_panel_probe (struct spi_device *spi) {struct panel_drv_data *ddata;@@ -404,10 +399,6 @@ static int td028ttec1_panel_probe(struct spi_device *spi) ddata->spi_dev = spi; - r =td028ttec1_probe_of (spi); -if (r) -return r; - ddata->vm = td028ttec1_panel_vm; dssdev = &ddata->dssdev;@@ -420,21 +411,16 @@ static int td028ttec1_panel_probe(struct spi_device *spi) r =omapdss_register_display (dssdev);if (r) {dev_err (&spi->dev,"Failed to register panel\n" ); - goto err_reg; +return r; }return 0 ; - -err_reg: -omap_dss_put_device (ddata->in); -return r; }static int td028ttec1_panel_remove (struct spi_device *spi) {struct panel_drv_data *ddata =dev_get_drvdata (&spi->dev);struct omap_dss_device *dssdev = &ddata->dssdev; -struct omap_dss_device *in = ddata->in;dev_dbg (&ddata->spi_dev->dev,"%s\n" , __func__);@@ -443,8 +429,6 @@ static int td028ttec1_panel_remove(struct spi_device *spi)td028ttec1_panel_disable (dssdev);td028ttec1_panel_disconnect (dssdev); -omap_dss_put_device (in); -return 0 ; }drivers/gpu/drm/omapdrm/displays/panel-tpo-td043mtea1.c +14
-15@@ -340,16 +340,25 @@ 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 = ddata->in; +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" ); +return PTR_ERR (in); + } + r = in->ops.dpi->connect (in, dssdev); -if (r) +if (r) { +omap_dss_put_device (in);return r; + } + ddata->in = in;return 0 ; }@@ -362,6 +371,9 @@ static void tpo_td043_disconnect(struct omap_dss_device *dssdev)return ; in->ops.dpi->disconnect (in, dssdev); + +omap_dss_put_device (in); + ddata->in =NULL ; }static int tpo_td043_enable (struct omap_dss_device *dssdev)@@ -463,7 +475,6 @@ static int tpo_td043_probe_of(struct spi_device *spi) {struct device_node *node = spi->dev.of_node;struct panel_drv_data *ddata =dev_get_drvdata (&spi->dev); -struct omap_dss_device *in;int gpio; gpio =of_get_named_gpio (node,"reset-gpios" ,0 );@@ -473,14 +484,6 @@ static int tpo_td043_probe_of(struct spi_device *spi) } ddata->nreset_gpio = gpio; - in =omapdss_of_find_source_for_first_ep (node); -if (IS_ERR (in)) { -dev_err (&spi->dev,"failed to find video source\n" ); -return PTR_ERR (in); - } - - ddata->in = in; -return 0 ; }@@ -561,7 +564,6 @@ static int tpo_td043_probe(struct spi_device *spi) err_sysfs: err_gpio_req: err_regulator: -omap_dss_put_device (ddata->in);return r; }@@ -569,7 +571,6 @@ static int tpo_td043_remove(struct spi_device *spi) {struct panel_drv_data *ddata =dev_get_drvdata (&spi->dev);struct omap_dss_device *dssdev = &ddata->dssdev; -struct omap_dss_device *in = ddata->in;dev_dbg (&ddata->spi->dev,"%s\n" , __func__);@@ -578,8 +579,6 @@ static int tpo_td043_remove(struct spi_device *spi)tpo_td043_disable (dssdev);tpo_td043_disconnect (dssdev); -omap_dss_put_device (in); -sysfs_remove_group (&spi->dev.kobj, &tpo_td043_attr_group);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 19/48 drm: omapdrm: displays: Get encoder source at connect time
In reply to Laurent PinchartThe encoder drivers need a handle to the source they are connected to in order to control the source.
All drivers get that handle at probe time, resulting in probe deferral when the source hasn't been probed yet. However they don't need the handle until their connect handler is called.
Move retrieval of the source handle to the connect handler to avoid probe deferrals.
--- drivers/gpu/drm/omapdrm/displays/encoder-opa362.c | 35 ++++++------ drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c | 36 ++++++------ .../gpu/drm/omapdrm/displays/encoder-tpd12s015.c | 66 ++++++++-------------- 3 files changed, 54 insertions(+), 83 deletions(-)
drivers/gpu/drm/omapdrm/displays/encoder-opa362.c +16 -19
@@ -36,7 +36,7 @@ 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 = ddata->in; +struct omap_dss_device *in;int r;dev_dbg (dssdev->dev,"connect\n" );
@@ -44,13 +44,22 @@ static int opa362_connect(struct omap_dss_device *dssdev,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" ); +return PTR_ERR (in); + } + r = in->ops.atv->connect (in, dssdev); -if (r) +if (r) { +omap_dss_put_device (in);return r; + } dst->src = dssdev; dssdev->dst = dst; + ddata->in = in;return 0 ; }
@@ -74,6 +83,9 @@ static void opa362_disconnect(struct omap_dss_device *dssdev, dssdev->dst =NULL ; in->ops.atv->disconnect (in, &ddata->dssdev); + +omap_dss_put_device (in); + ddata->in =NULL ; }static int opa362_enable (struct omap_dss_device *dssdev)
@@ -171,9 +183,8 @@ static const struct omapdss_atv_ops opa362_atv_ops = {static int opa362_probe (struct platform_device *pdev) { -struct device_node *node = pdev->dev.of_node;struct panel_drv_data *ddata; -struct omap_dss_device *dssdev, *in; +struct omap_dss_device *dssdev;struct gpio_desc *gpio;int r;
@@ -191,14 +202,6 @@ static int opa362_probe(struct platform_device *pdev) ddata->enable_gpio = gpio; - in =omapdss_of_find_source_for_first_ep (node); -if (IS_ERR (in)) { -dev_err (&pdev->dev,"failed to find video source\n" ); -return PTR_ERR (in); - } - - ddata->in = in; - dssdev = &ddata->dssdev; dssdev->ops.atv = &opa362_atv_ops; dssdev->dev = &pdev->dev;
@@ -209,20 +212,16 @@ static int opa362_probe(struct platform_device *pdev) r =omapdss_register_output (dssdev);if (r) {dev_err (&pdev->dev,"Failed to register output\n" ); - goto err_reg; +return r; }return 0 ; -err_reg: -omap_dss_put_device (ddata->in); -return r; } 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; -struct omap_dss_device *in = ddata->in;omapdss_unregister_output (&ddata->dssdev);
@@ -234,8 +233,6 @@ static int __exit opa362_remove(struct platform_device *pdev)if (omapdss_device_is_connected (dssdev))opa362_disconnect (dssdev, dssdev->dst); -omap_dss_put_device (in); -return 0 ; }
drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c +16 -20
@@ -32,19 +32,28 @@ 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 = ddata->in; +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" ); +return PTR_ERR (in); + } + r = in->ops.dpi->connect (in, dssdev); -if (r) +if (r) { +omap_dss_put_device (in);return r; + } dst->src = dssdev; dssdev->dst = dst; + ddata->in = in;return 0 ; }
@@ -66,6 +75,9 @@ static void tfp410_disconnect(struct omap_dss_device *dssdev, dssdev->dst =NULL ; in->ops.dpi->disconnect (in, &ddata->dssdev); + +omap_dss_put_device (in); + ddata->in =NULL ; }static int tfp410_enable (struct omap_dss_device *dssdev)
@@ -165,7 +177,6 @@ static int tfp410_probe_of(struct platform_device *pdev) {struct panel_drv_data *ddata =platform_get_drvdata (pdev);struct device_node *node = pdev->dev.of_node; -struct omap_dss_device *in;int gpio; gpio =of_get_named_gpio (node,"powerdown-gpios" ,0 );
@@ -178,14 +189,6 @@ static int tfp410_probe_of(struct platform_device *pdev)return gpio; } - in =omapdss_of_find_source_for_first_ep (node); -if (IS_ERR (in)) { -dev_err (&pdev->dev,"failed to find video source\n" ); -return PTR_ERR (in); - } - - ddata->in = in; -return 0 ; }
@@ -211,7 +214,7 @@ static int tfp410_probe(struct platform_device *pdev)if (r) {dev_err (&pdev->dev,"Failed to request PD GPIO %d\n" , ddata->pd_gpio); - goto err_gpio; +return r; } }
@@ -226,21 +229,16 @@ static int tfp410_probe(struct platform_device *pdev) r =omapdss_register_output (dssdev);if (r) {dev_err (&pdev->dev,"Failed to register output\n" ); - goto err_reg; +return r; }return 0 ; -err_reg: -err_gpio: -omap_dss_put_device (ddata->in); -return r; } 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; -struct omap_dss_device *in = ddata->in;omapdss_unregister_output (&ddata->dssdev);
@@ -252,8 +250,6 @@ static int __exit tfp410_remove(struct platform_device *pdev)if (omapdss_device_is_connected (dssdev))tfp410_disconnect (dssdev, dssdev->dst); -omap_dss_put_device (in); -return 0 ; }
drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c +22 -44
139 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 19/48] drm: omapdrm: displays: Get encoder source at connect time
Hi,
Quoted 7 lines · Laurent Pinchart
The encoder drivers need a handle to the source they are connected to in order to control the source.
All drivers get that handle at probe time, resulting in probe deferral when the source hasn't been probed yet. However they don't need the handle until their connect handler is called.
Quoted 5 lines
Move retrieval of the source handle to the connect handler to avoid probe deferrals.
Signed-off-by Laurent Pinchart <[email protected]>---
-- Sebastian
Quoted 378 lines
drivers/gpu/drm/omapdrm/displays/encoder-opa362.c | 35 ++++++------ drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c | 36 ++++++------ .../gpu/drm/omapdrm/displays/encoder-tpd12s015.c | 66 ++++++++-------------- 3 files changed, 54 insertions(+), 83 deletions(-)drivers/gpu/drm/omapdrm/displays/encoder-opa362.c +16
-19@@ -36,7 +36,7 @@ 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 = ddata->in; +struct omap_dss_device *in;int r;dev_dbg (dssdev->dev,"connect\n" );@@ -44,13 +44,22 @@ static int opa362_connect(struct omap_dss_device *dssdev,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" ); +return PTR_ERR (in); + } + r = in->ops.atv->connect (in, dssdev); -if (r) +if (r) { +omap_dss_put_device (in);return r; + } dst->src = dssdev; dssdev->dst = dst; + ddata->in = in;return 0 ; }@@ -74,6 +83,9 @@ static void opa362_disconnect(struct omap_dss_device *dssdev, dssdev->dst =NULL ; in->ops.atv->disconnect (in, &ddata->dssdev); + +omap_dss_put_device (in); + ddata->in =NULL ; }static int opa362_enable (struct omap_dss_device *dssdev)@@ -171,9 +183,8 @@ static const struct omapdss_atv_ops opa362_atv_ops = {static int opa362_probe (struct platform_device *pdev) { -struct device_node *node = pdev->dev.of_node;struct panel_drv_data *ddata; -struct omap_dss_device *dssdev, *in; +struct omap_dss_device *dssdev;struct gpio_desc *gpio;int r;@@ -191,14 +202,6 @@ static int opa362_probe(struct platform_device *pdev) ddata->enable_gpio = gpio; - in =omapdss_of_find_source_for_first_ep (node); -if (IS_ERR (in)) { -dev_err (&pdev->dev,"failed to find video source\n" ); -return PTR_ERR (in); - } - - ddata->in = in; - dssdev = &ddata->dssdev; dssdev->ops.atv = &opa362_atv_ops; dssdev->dev = &pdev->dev;@@ -209,20 +212,16 @@ static int opa362_probe(struct platform_device *pdev) r =omapdss_register_output (dssdev);if (r) {dev_err (&pdev->dev,"Failed to register output\n" ); - goto err_reg; +return r; }return 0 ; -err_reg: -omap_dss_put_device (ddata->in); -return r; } 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; -struct omap_dss_device *in = ddata->in;omapdss_unregister_output (&ddata->dssdev);@@ -234,8 +233,6 @@ static int __exit opa362_remove(struct platform_device *pdev)if (omapdss_device_is_connected (dssdev))opa362_disconnect (dssdev, dssdev->dst); -omap_dss_put_device (in); -return 0 ; }drivers/gpu/drm/omapdrm/displays/encoder-tfp410.c +16
-20@@ -32,19 +32,28 @@ 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 = ddata->in; +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" ); +return PTR_ERR (in); + } + r = in->ops.dpi->connect (in, dssdev); -if (r) +if (r) { +omap_dss_put_device (in);return r; + } dst->src = dssdev; dssdev->dst = dst; + ddata->in = in;return 0 ; }@@ -66,6 +75,9 @@ static void tfp410_disconnect(struct omap_dss_device *dssdev, dssdev->dst =NULL ; in->ops.dpi->disconnect (in, &ddata->dssdev); + +omap_dss_put_device (in); + ddata->in =NULL ; }static int tfp410_enable (struct omap_dss_device *dssdev)@@ -165,7 +177,6 @@ static int tfp410_probe_of(struct platform_device *pdev) {struct panel_drv_data *ddata =platform_get_drvdata (pdev);struct device_node *node = pdev->dev.of_node; -struct omap_dss_device *in;int gpio; gpio =of_get_named_gpio (node,"powerdown-gpios" ,0 );@@ -178,14 +189,6 @@ static int tfp410_probe_of(struct platform_device *pdev)return gpio; } - in =omapdss_of_find_source_for_first_ep (node); -if (IS_ERR (in)) { -dev_err (&pdev->dev,"failed to find video source\n" ); -return PTR_ERR (in); - } - - ddata->in = in; -return 0 ; }@@ -211,7 +214,7 @@ static int tfp410_probe(struct platform_device *pdev)if (r) {dev_err (&pdev->dev,"Failed to request PD GPIO %d\n" , ddata->pd_gpio); - goto err_gpio; +return r; } }@@ -226,21 +229,16 @@ static int tfp410_probe(struct platform_device *pdev) r =omapdss_register_output (dssdev);if (r) {dev_err (&pdev->dev,"Failed to register output\n" ); - goto err_reg; +return r; }return 0 ; -err_reg: -err_gpio: -omap_dss_put_device (ddata->in); -return r; } 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; -struct omap_dss_device *in = ddata->in;omapdss_unregister_output (&ddata->dssdev);@@ -252,8 +250,6 @@ static int __exit tfp410_remove(struct platform_device *pdev)if (omapdss_device_is_connected (dssdev))tfp410_disconnect (dssdev, dssdev->dst); -omap_dss_put_device (in); -return 0 ; }drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c +22
-44@@ -40,12 +40,20 @@ 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 = ddata->in; +struct omap_dss_device *in;int r; + 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" ); +return PTR_ERR (in); + } + r = in->ops.hdmi->connect (in, dssdev); -if (r) +if (r) { +omap_dss_put_device (in);return r; + } dst->src = dssdev; dssdev->dst = dst;@@ -56,6 +64,7 @@ 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 ; }@@ -77,6 +86,9 @@ static void tpd_disconnect(struct omap_dss_device *dssdev, dssdev->dst =NULL ; in->ops.hdmi->disconnect (in, &ddata->dssdev); + +omap_dss_put_device (in); + ddata->in =NULL ; }static int tpd_enable (struct omap_dss_device *dssdev)@@ -269,23 +281,6 @@ static irqreturn_t tpd_hpd_isr(int irq, void *data)return IRQ_HANDLED ; } -static int tpd_probe_of (struct platform_device *pdev) -{ -struct panel_drv_data *ddata =platform_get_drvdata (pdev); -struct device_node *node = pdev->dev.of_node; -struct omap_dss_device *in; - - in =omapdss_of_find_source_for_first_ep (node); -if (IS_ERR (in)) { -dev_err (&pdev->dev,"failed to find video source\n" ); -return PTR_ERR (in); - } - - ddata->in = in; - -return 0 ; -} -static int tpd_probe (struct platform_device *pdev) {struct omap_dss_device *in, *dssdev;@@ -299,34 +294,24 @@ static int tpd_probe(struct platform_device *pdev)platform_set_drvdata (pdev, ddata); - r =tpd_probe_of (pdev); -if (r) -return r; - gpio =devm_gpiod_get_index_optional (&pdev->dev,NULL ,0 ,GPIOD_OUT_LOW ); -if (IS_ERR (gpio)) { - r =PTR_ERR (gpio); - goto err_gpio; - } +if (IS_ERR (gpio)) +return PTR_ERR (gpio); ddata->ct_cp_hpd_gpio = gpio; gpio =devm_gpiod_get_index_optional (&pdev->dev,NULL ,1 ,GPIOD_OUT_LOW ); -if (IS_ERR (gpio)) { - r =PTR_ERR (gpio); - goto err_gpio; - } +if (IS_ERR (gpio)) +return PTR_ERR (gpio); ddata->ls_oe_gpio = gpio; gpio =devm_gpiod_get_index (&pdev->dev,NULL ,2 ,GPIOD_IN ); -if (IS_ERR (gpio)) { - r =PTR_ERR (gpio); - goto err_gpio; - } +if (IS_ERR (gpio)) +return PTR_ERR (gpio); ddata->hpd_gpio = gpio;@@ -337,7 +322,7 @@ static int tpd_probe(struct platform_device *pdev)IRQF_TRIGGER_RISING |IRQF_TRIGGER_FALLING |IRQF_ONESHOT , "tpd12s015 hpd", ddata);if (r) - goto err_gpio; +return r; dssdev = &ddata->dssdev; dssdev->ops.hdmi = &tpd_hdmi_ops;@@ -352,21 +337,16 @@ static int tpd_probe(struct platform_device *pdev) r =omapdss_register_output (dssdev);if (r) {dev_err (&pdev->dev,"Failed to register output\n" ); - goto err_reg; +return r; }return 0 ; -err_reg: -err_gpio: -omap_dss_put_device (ddata->in); -return r; } 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; -struct omap_dss_device *in = ddata->in;omapdss_unregister_output (&ddata->dssdev);@@ -378,8 +358,6 @@ static int __exit tpd_remove(struct platform_device *pdev)if (omapdss_device_is_connected (dssdev))tpd_disconnect (dssdev, dssdev->dst); -omap_dss_put_device (in); -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 20/48 drm: omapdrm: Merge the omapdrm and omapdss drivers
In reply to Laurent PinchartThe split between the omapdss and omapdrm driver is historic and was due to other userspace APIs (FBDEV and V4L2) being supported in addition to DRM/KMS. Now that the drivers only supports the DRM/KMS API, there is no need to keep them separate anymore.
Merge the two drivers and remove the now unneeded omapdrm virtual platform device.
--- drivers/gpu/drm/omapdrm/Kconfig | 5 +- drivers/gpu/drm/omapdrm/Makefile | 25 ++++++++++ drivers/gpu/drm/omapdrm/dss/Kconfig | 12 ----- drivers/gpu/drm/omapdrm/dss/Makefile | 25 ---------- drivers/gpu/drm/omapdrm/dss/base.c | 13 ----- drivers/gpu/drm/omapdrm/dss/core.c | 14 ++---- drivers/gpu/drm/omapdrm/dss/dss.c | 23 ++++++++- drivers/gpu/drm/omapdrm/dss/omapdss.h | 4 -- drivers/gpu/drm/omapdrm/omap_dmm_tiler.c | 12 ++++- drivers/gpu/drm/omapdrm/omap_dmm_tiler.h | 3 +- drivers/gpu/drm/omapdrm/omap_drv.c | 82 ++------------------------------ drivers/gpu/drm/omapdrm/omap_drv.h | 4 ++ 12 files changed, 74 insertions(+), 148 deletions(-)
drivers/gpu/drm/omapdrm/Kconfig +4 -1
@@ -2,8 +2,11 @@ config DRM_OMAP tristate "OMAP DRM" depends on DRM depends on ARCH_OMAP2PLUS || ARCH_MULTIPLATFORM - select OMAP2_DSS select DRM_KMS_HELPER + select HDMI + select OMAP2_DSS + select OMAP2_DSS_INIT + select VIDEOMODE_HELPERS default n help DRM display driver for OMAP2/3/4 based boards.
drivers/gpu/drm/omapdrm/Makefile +25 -0
@@ -21,4 +21,29 @@ omapdrm-y := omap_drv.o \ omapdrm-$(CONFIG_DRM_FBDEV_EMULATION) += omap_fbdev.o +# Core DSS files +omapdrm-y += \ + dss/base.o \ + dss/core.o \ + dss/dispc.o \ + dss/dispc_coefs.o \ + dss/display.o \ + dss/dss.o \ + dss/dss-of.o \ + dss/output.o \ + dss/pll.o \ + dss/video-pll.o + +omapdrm-$(CONFIG_OMAP2_DSS_DPI) += dss/dpi.o +omapdrm-$(CONFIG_OMAP2_DSS_VENC) += dss/venc.o +omapdrm-$(CONFIG_OMAP2_DSS_SDI) += dss/sdi.o +omapdrm-$(CONFIG_OMAP2_DSS_DSI) += dss/dsi.o +omapdrm-$(CONFIG_OMAP2_DSS_HDMI_COMMON) += dss/hdmi_common.o dss/hdmi_wp.o \ + dss/hdmi_pll.o dss/hdmi_phy.o +omapdrm-$(CONFIG_OMAP4_DSS_HDMI) += dss/hdmi4.o dss/hdmi4_core.o +omapdrm-$(CONFIG_OMAP4_DSS_HDMI_CEC) += dss/hdmi4_cec.o +omapdrm-$(CONFIG_OMAP5_DSS_HDMI) += dss/hdmi5.o dss/hdmi5_core.o + +ccflags-$(CONFIG_OMAP2_DSS_DEBUG) += -DDEBUG + obj-$(CONFIG_DRM_OMAP) += omapdrm.o
drivers/gpu/drm/omapdrm/dss/Kconfig +0 -12
@@ -1,16 +1,6 @@ config OMAP2_DSS_INIT bool -menuconfig OMAP2_DSS - tristate "OMAP2+ Display Subsystem support" - select VIDEOMODE_HELPERS - select OMAP2_DSS_INIT - select HDMI - help - OMAP2+ Display Subsystem support. - -if OMAP2_DSS - config OMAP2_DSS_DEBUG bool "Debug support" default n
@@ -126,5 +116,3 @@ config OMAP2_DSS_SLEEP_AFTER_VENC_RESET This option enables the sleep, and is enabled by default. You can disable the sleep if it doesn't cause problems on your platform. - -endif
drivers/gpu/drm/omapdrm/dss/Makefile +0 -25
@@ -1,26 +1 @@ obj-$(CONFIG_OMAP2_DSS_INIT) += omapdss-boot-init.o -obj-$(CONFIG_OMAP2_DSS) += omapdss.o - -# Core DSS files -omapdss-y := \ - base.o \ - display.o \ - dss-of.o \ - output.o \ - core.o \ - dss.o \ - dispc.o \ - dispc_coefs.o \ - pll.o \ - video-pll.o - -omapdss-$(CONFIG_OMAP2_DSS_DPI) += dpi.o -omapdss-$(CONFIG_OMAP2_DSS_VENC) += venc.o -omapdss-$(CONFIG_OMAP2_DSS_SDI) += sdi.o -omapdss-$(CONFIG_OMAP2_DSS_DSI) += dsi.o -omapdss-$(CONFIG_OMAP2_DSS_HDMI_COMMON) += hdmi_common.o hdmi_wp.o hdmi_pll.o \ - hdmi_phy.o -omapdss-$(CONFIG_OMAP4_DSS_HDMI) += hdmi4.o hdmi4_core.o -omapdss-$(CONFIG_OMAP4_DSS_HDMI_CEC) += hdmi4_cec.o -omapdss-$(CONFIG_OMAP5_DSS_HDMI) += hdmi5.o hdmi5_core.o -ccflags-$(CONFIG_OMAP2_DSS_DEBUG) += -DDEBUG
drivers/gpu/drm/omapdrm/dss/base.c +0 -13
@@ -5,7 +5,6 @@#include <linux/list.h> #include "omapdss.h" -static bool dss_initialized;static const struct dispc_ops *ops;static struct list_head omapdss_comp_list;
@@ -16,17 +15,6 @@ struct omapdss_comp_node {bool dss_core_component; }; -void omapdss_set_is_initialized (bool set) -{ - dss_initialized = set; -} - -bool omapdss_is_initialized (void ) -{ -return dss_initialized; -} -EXPORT_SYMBOL (omapdss_is_initialized); -void dispc_set_ops (const struct dispc_ops *o) { ops = o;
@@ -130,4 +118,3 @@ bool omapdss_stack_is_ready(void)return true; } -EXPORT_SYMBOL (omapdss_stack_is_ready);
drivers/gpu/drm/omapdrm/dss/core.c +3 -11
@@ -24,13 +24,14 @@#include <linux/kernel.h> #include <linux/module.h> -#include <linux/platform_device.h> #include "omapdss.h" #include "dss.h" +#include "../omap_dmm_tiler.h" /* INIT */ static int (*dss_output_drv_reg_funcs[])(void )__initdata = { + dmm_init_platform_driver, dss_init_platform_driver, dispc_init_platform_driver, #ifdef CONFIG_OMAP2_DSS_DSI
@@ -62,10 +63,9 @@ static void (*dss_output_drv_unreg_funcs[])(void) = {#endif dispc_uninit_platform_driver, dss_uninit_platform_driver, + dmm_uninit_platform_driver, }; -static struct platform_device *omap_drm_device; -static int __init omap_dss_init (void ) {int r;
@@ -77,12 +77,6 @@ static int __init omap_dss_init(void) 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:
@@ -98,8 +92,6 @@ static void __exit omap_dss_exit(void) {int i; -platform_device_unregister (omap_drm_device); -for (i =0 ; i <ARRAY_SIZE (dss_output_drv_unreg_funcs); ++i) dss_output_drv_unreg_funcs[i](); }
drivers/gpu/drm/omapdrm/dss/dss.c +21 -2
@@ -49,6 +49,7 @@#include "omapdss.h" #include "dss.h" +#include "../omap_drv.h" #define DSS_SZ_REGS SZ_512
@@ -94,6 +95,8 @@ struct dss_features { static struct { struct platform_device *pdev; + struct omap_drm_private drm; + void __iomem *base; struct regmap *syscon_pll_ctrl; u32 syscon_pll_ctrl_offset;
@@ -1366,10 +1369,15 @@ static int dss_bind(struct device *dev)pm_set_vt_switch (0 );omapdss_gather_components (dev); -omapdss_set_is_initialized (true); + + r =omapdrm_init (&dss.drm, dev); +if (r) + goto err_drm_init;return 0 ; +err_drm_init: +component_unbind_all (&pdev->dev,NULL ); err_component: err_runtime_get:pm_runtime_disable (&pdev->dev);
@@ -1390,7 +1398,7 @@ static void dss_unbind(struct device *dev) {struct platform_device *pdev =to_platform_device (dev); -omapdss_set_is_initialized (false); +omapdrm_cleanup (&dss.drm);component_unbind_all (&pdev->dev,NULL );
@@ -1531,7 +1539,18 @@ static int dss_runtime_resume(struct device *dev)return 0 ; } +static int dss_suspend (struct device *dev) +{ +return omap_drm_suspend (&dss.drm); +} + +static int dss_resume (struct device *dev) +{ +return omap_drm_resume (&dss.drm); +} +static const struct dev_pm_ops dss_pm_ops = { +SET_SYSTEM_SLEEP_PM_OPS (dss_suspend, dss_resume) .runtime_suspend = dss_runtime_suspend, .runtime_resume = dss_runtime_resume, };
drivers/gpu/drm/omapdrm/dss/omapdss.h +0 -4
@@ -583,8 +583,6 @@ struct omap_dss_driver { const struct hdmi_avi_infoframe *avi); }; -bool omapdss_is_initialized (void ); -int omap_dss_register_driver (struct omap_dss_driver *);void omap_dss_unregister_driver (struct omap_dss_driver *);
@@ -633,8 +631,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); -void omapdss_set_is_initialized (bool set); -struct device_node *dss_of_port_get_parent_device (struct device_node *port);u32 dss_of_port_get_port_number (struct device_node *port);
drivers/gpu/drm/omapdrm/omap_dmm_tiler.c +11 -1
@@ -1042,7 +1042,7 @@ static const struct of_device_id dmm_of_match[] = { };#endif -struct platform_driver omap_dmm_driver = { +static struct platform_driver omap_dmm_driver = { .probe = omap_dmm_probe, .remove = omap_dmm_remove, .driver = {
@@ -1053,6 +1053,16 @@ struct platform_driver omap_dmm_driver = { }, }; +int __init dmm_init_platform_driver (void ) +{ +return platform_driver_register (&omap_dmm_driver); +} + +void dmm_uninit_platform_driver (void ) +{ +platform_driver_unregister (&omap_dmm_driver); +} +MODULE_LICENSE ("GPL v2" );MODULE_AUTHOR ("Andy Gross <[email protected]>" );MODULE_DESCRIPTION ("OMAP DMM/Tiler Driver" );
drivers/gpu/drm/omapdrm/omap_dmm_tiler.h +2 -1
@@ -109,7 +109,8 @@ void tiler_align(enum tiler_fmt fmt, u16 *w, u16 *h);u32 tiler_get_cpu_cache_flags (void );bool dmm_is_available (void ); -extern struct platform_driver omap_dmm_driver; +int dmm_init_platform_driver (void )__init ; +void dmm_uninit_platform_driver (void );/* GEM bo flags -> tiler fmt */ static inline enum tiler_fmt gem2fmt (u32 flags)
drivers/gpu/drm/omapdrm/omap_drv.c +4 -78
120 lines not on this page · raw message
drivers/gpu/drm/omapdrm/omap_drv.h +4 -0
@@ -88,6 +88,10 @@ struct omap_drm_private {u32 irq_mask;/* enabled irqs in addition to wait_list */ }; +int omapdrm_init (struct omap_drm_private *priv,struct device *dev); +void omapdrm_cleanup (struct omap_drm_private *priv); +int omap_drm_suspend (struct omap_drm_private *priv); +int omap_drm_resume (struct omap_drm_private *priv);int omap_debugfs_init (struct drm_minor *minor);
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 20/48] drm: omapdrm: Merge the omapdrm and omapdss drivers
Hi,
Quoted 29 lines · Laurent Pinchart
The split between the omapdss and omapdrm driver is historic and was due to other userspace APIs (FBDEV and V4L2) being supported in addition to DRM/KMS. Now that the drivers only supports the DRM/KMS API, there is no need to keep them separate anymore.
Merge the two drivers and remove the now unneeded omapdrm virtual platform device.
Signed-off-by Laurent Pinchart <[email protected]>--- drivers/gpu/drm/omapdrm/Kconfig | 5 +- drivers/gpu/drm/omapdrm/Makefile | 25 ++++++++++ drivers/gpu/drm/omapdrm/dss/Kconfig | 12 ----- drivers/gpu/drm/omapdrm/dss/Makefile | 25 ---------- drivers/gpu/drm/omapdrm/dss/base.c | 13 ----- drivers/gpu/drm/omapdrm/dss/core.c | 14 ++---- drivers/gpu/drm/omapdrm/dss/dss.c | 23 ++++++++- drivers/gpu/drm/omapdrm/dss/omapdss.h | 4 -- drivers/gpu/drm/omapdrm/omap_dmm_tiler.c | 12 ++++- drivers/gpu/drm/omapdrm/omap_dmm_tiler.h | 3 +- drivers/gpu/drm/omapdrm/omap_drv.c | 82 ++------------------------------ drivers/gpu/drm/omapdrm/omap_drv.h | 4 ++ 12 files changed, 74 insertions(+), 148 deletions(-)drivers/gpu/drm/omapdrm/Kconfig +0
-0
drivers/gpu/drm/omapdrm/Kconfig config DRM_OMAP · line 7
Quoted 7 lines
drivers/gpu/drm/omapdrm/Kconfig +2
-1@@ -2,8 +2,11 @@ config DRM_OMAP tristate "OMAP DRM" depends on DRM depends on ARCH_OMAP2PLUS || ARCH_MULTIPLATFORM - select OMAP2_DSS select DRM_KMS_HELPER + select HDMI + select OMAP2_DSS
As far as I can see "CONFIG_OMAP2_DSS" no longer exists after the merge, so this can be dropped.
Otherwise:
-- Sebastian
Quoted 472 lines
drivers/gpu/drm/omapdrm/Kconfig +2
-0+ select OMAP2_DSS_INIT + select VIDEOMODE_HELPERS default n help DRM display driver for OMAP2/3/4 based boards.drivers/gpu/drm/omapdrm/Makefile +25
-0@@ -21,4 +21,29 @@ omapdrm-y := omap_drv.o \ omapdrm-$(CONFIG_DRM_FBDEV_EMULATION) += omap_fbdev.o +# Core DSS files +omapdrm-y += \ + dss/base.o \ + dss/core.o \ + dss/dispc.o \ + dss/dispc_coefs.o \ + dss/display.o \ + dss/dss.o \ + dss/dss-of.o \ + dss/output.o \ + dss/pll.o \ + dss/video-pll.o + +omapdrm-$(CONFIG_OMAP2_DSS_DPI) += dss/dpi.o +omapdrm-$(CONFIG_OMAP2_DSS_VENC) += dss/venc.o +omapdrm-$(CONFIG_OMAP2_DSS_SDI) += dss/sdi.o +omapdrm-$(CONFIG_OMAP2_DSS_DSI) += dss/dsi.o +omapdrm-$(CONFIG_OMAP2_DSS_HDMI_COMMON) += dss/hdmi_common.o dss/hdmi_wp.o \ + dss/hdmi_pll.o dss/hdmi_phy.o +omapdrm-$(CONFIG_OMAP4_DSS_HDMI) += dss/hdmi4.o dss/hdmi4_core.o +omapdrm-$(CONFIG_OMAP4_DSS_HDMI_CEC) += dss/hdmi4_cec.o +omapdrm-$(CONFIG_OMAP5_DSS_HDMI) += dss/hdmi5.o dss/hdmi5_core.o + +ccflags-$(CONFIG_OMAP2_DSS_DEBUG) += -DDEBUG + obj-$(CONFIG_DRM_OMAP) += omapdrm.odrivers/gpu/drm/omapdrm/dss/Kconfig +0
-12@@ -1,16 +1,6 @@ config OMAP2_DSS_INIT bool -menuconfig OMAP2_DSS - tristate "OMAP2+ Display Subsystem support" - select VIDEOMODE_HELPERS - select OMAP2_DSS_INIT - select HDMI - help - OMAP2+ Display Subsystem support. - -if OMAP2_DSS - config OMAP2_DSS_DEBUG bool "Debug support" default n@@ -126,5 +116,3 @@ config OMAP2_DSS_SLEEP_AFTER_VENC_RESET This option enables the sleep, and is enabled by default. You can disable the sleep if it doesn't cause problems on your platform. - -endifdrivers/gpu/drm/omapdrm/dss/Makefile +0
-25@@ -1,26 +1 @@ obj-$(CONFIG_OMAP2_DSS_INIT) += omapdss-boot-init.o -obj-$(CONFIG_OMAP2_DSS) += omapdss.o - -# Core DSS files -omapdss-y := \ - base.o \ - display.o \ - dss-of.o \ - output.o \ - core.o \ - dss.o \ - dispc.o \ - dispc_coefs.o \ - pll.o \ - video-pll.o - -omapdss-$(CONFIG_OMAP2_DSS_DPI) += dpi.o -omapdss-$(CONFIG_OMAP2_DSS_VENC) += venc.o -omapdss-$(CONFIG_OMAP2_DSS_SDI) += sdi.o -omapdss-$(CONFIG_OMAP2_DSS_DSI) += dsi.o -omapdss-$(CONFIG_OMAP2_DSS_HDMI_COMMON) += hdmi_common.o hdmi_wp.o hdmi_pll.o \ - hdmi_phy.o -omapdss-$(CONFIG_OMAP4_DSS_HDMI) += hdmi4.o hdmi4_core.o -omapdss-$(CONFIG_OMAP4_DSS_HDMI_CEC) += hdmi4_cec.o -omapdss-$(CONFIG_OMAP5_DSS_HDMI) += hdmi5.o hdmi5_core.o -ccflags-$(CONFIG_OMAP2_DSS_DEBUG) += -DDEBUGdrivers/gpu/drm/omapdrm/dss/base.c +0
-13@@ -5,7 +5,6 @@#include <linux/list.h> #include "omapdss.h" -static bool dss_initialized;static const struct dispc_ops *ops;static struct list_head omapdss_comp_list;@@ -16,17 +15,6 @@ struct omapdss_comp_node {bool dss_core_component; }; -void omapdss_set_is_initialized (bool set) -{ - dss_initialized = set; -} - -bool omapdss_is_initialized (void ) -{ -return dss_initialized; -} -EXPORT_SYMBOL (omapdss_is_initialized); -void dispc_set_ops (const struct dispc_ops *o) { ops = o;@@ -130,4 +118,3 @@ bool omapdss_stack_is_ready(void)return true; } -EXPORT_SYMBOL (omapdss_stack_is_ready);drivers/gpu/drm/omapdrm/dss/core.c +3
-11@@ -24,13 +24,14 @@#include <linux/kernel.h> #include <linux/module.h> -#include <linux/platform_device.h> #include "omapdss.h" #include "dss.h" +#include "../omap_dmm_tiler.h" /* INIT */ static int (*dss_output_drv_reg_funcs[])(void )__initdata = { + dmm_init_platform_driver, dss_init_platform_driver, dispc_init_platform_driver, #ifdef CONFIG_OMAP2_DSS_DSI@@ -62,10 +63,9 @@ static void (*dss_output_drv_unreg_funcs[])(void) = {#endif dispc_uninit_platform_driver, dss_uninit_platform_driver, + dmm_uninit_platform_driver, }; -static struct platform_device *omap_drm_device; -static int __init omap_dss_init (void ) {int r;@@ -77,12 +77,6 @@ static int __init omap_dss_init(void) 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:@@ -98,8 +92,6 @@ static void __exit omap_dss_exit(void) {int i; -platform_device_unregister (omap_drm_device); -for (i =0 ; i <ARRAY_SIZE (dss_output_drv_unreg_funcs); ++i) dss_output_drv_unreg_funcs[i](); }drivers/gpu/drm/omapdrm/dss/dss.c +21
-2@@ -49,6 +49,7 @@#include "omapdss.h" #include "dss.h" +#include "../omap_drv.h" #define DSS_SZ_REGS SZ_512@@ -94,6 +95,8 @@ struct dss_features { static struct { struct platform_device *pdev; + struct omap_drm_private drm; + void __iomem *base; struct regmap *syscon_pll_ctrl; u32 syscon_pll_ctrl_offset;@@ -1366,10 +1369,15 @@ static int dss_bind(struct device *dev)pm_set_vt_switch (0 );omapdss_gather_components (dev); -omapdss_set_is_initialized (true); + + r =omapdrm_init (&dss.drm, dev); +if (r) + goto err_drm_init;return 0 ; +err_drm_init: +component_unbind_all (&pdev->dev,NULL ); err_component: err_runtime_get:pm_runtime_disable (&pdev->dev);@@ -1390,7 +1398,7 @@ static void dss_unbind(struct device *dev) {struct platform_device *pdev =to_platform_device (dev); -omapdss_set_is_initialized (false); +omapdrm_cleanup (&dss.drm);component_unbind_all (&pdev->dev,NULL );@@ -1531,7 +1539,18 @@ static int dss_runtime_resume(struct device *dev)return 0 ; } +static int dss_suspend (struct device *dev) +{ +return omap_drm_suspend (&dss.drm); +} + +static int dss_resume (struct device *dev) +{ +return omap_drm_resume (&dss.drm); +} +static const struct dev_pm_ops dss_pm_ops = { +SET_SYSTEM_SLEEP_PM_OPS (dss_suspend, dss_resume) .runtime_suspend = dss_runtime_suspend, .runtime_resume = dss_runtime_resume, };drivers/gpu/drm/omapdrm/dss/omapdss.h +0
-4@@ -583,8 +583,6 @@ struct omap_dss_driver { const struct hdmi_avi_infoframe *avi); }; -bool omapdss_is_initialized (void ); -int omap_dss_register_driver (struct omap_dss_driver *);void omap_dss_unregister_driver (struct omap_dss_driver *);@@ -633,8 +631,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); -void omapdss_set_is_initialized (bool set); -struct device_node *dss_of_port_get_parent_device (struct device_node *port);u32 dss_of_port_get_port_number (struct device_node *port);drivers/gpu/drm/omapdrm/omap_dmm_tiler.c +11
-1@@ -1042,7 +1042,7 @@ static const struct of_device_id dmm_of_match[] = { };#endif -struct platform_driver omap_dmm_driver = { +static struct platform_driver omap_dmm_driver = { .probe = omap_dmm_probe, .remove = omap_dmm_remove, .driver = {@@ -1053,6 +1053,16 @@ struct platform_driver omap_dmm_driver = { }, }; +int __init dmm_init_platform_driver (void ) +{ +return platform_driver_register (&omap_dmm_driver); +} + +void dmm_uninit_platform_driver (void ) +{ +platform_driver_unregister (&omap_dmm_driver); +} +MODULE_LICENSE ("GPL v2" );MODULE_AUTHOR ("Andy Gross <[email protected]>" );MODULE_DESCRIPTION ("OMAP DMM/Tiler Driver" );drivers/gpu/drm/omapdrm/omap_dmm_tiler.h +2
-1@@ -109,7 +109,8 @@ void tiler_align(enum tiler_fmt fmt, u16 *w, u16 *h);u32 tiler_get_cpu_cache_flags (void );bool dmm_is_available (void ); -extern struct platform_driver omap_dmm_driver; +int dmm_init_platform_driver (void )__init ; +void dmm_uninit_platform_driver (void );/* GEM bo flags -> tiler fmt */ static inline enum tiler_fmt gem2fmt (u32 flags)drivers/gpu/drm/omapdrm/omap_drv.c +4
-78@@ -542,7 +542,7 @@ static const struct soc_device_attribute omapdrm_soc_devices[] = { {/* sentinel */ } }; -static int omapdrm_init (struct omap_drm_private *priv,struct device *dev) +int omapdrm_init (struct omap_drm_private *priv,struct device *dev) {const struct soc_device_attribute *soc;struct drm_device *ddev;@@ -630,7 +630,7 @@ static int omapdrm_init(struct omap_drm_private *priv, struct device *dev)return ret; } -static void omapdrm_cleanup (struct omap_drm_private *priv) +void omapdrm_cleanup (struct omap_drm_private *priv) {struct drm_device *ddev = priv->ddev;@@ -659,44 +659,6 @@ static void omapdrm_cleanup(struct omap_drm_private *priv)omap_crtc_pre_uninit (); } -static int pdev_probe (struct platform_device *pdev) -{ -struct omap_drm_private *priv; -int ret; - -if (omapdss_is_initialized () == false) -return -EPROBE_DEFER ; - - ret =dma_set_coherent_mask (&pdev->dev,DMA_BIT_MASK (32 )); -if (ret) { -dev_err (&pdev->dev,"Failed to set the DMA mask\n" ); -return ret; - } - -/* Allocate and initialize the driver private structure. */ - priv =kzalloc (sizeof (*priv),GFP_KERNEL ); -if (!priv) -return -ENOMEM ; - -platform_set_drvdata (pdev, priv); - - ret =omapdrm_init (priv, &pdev->dev); -if (ret <0 ) -kfree (priv); - -return ret; -} - -static int pdev_remove (struct platform_device *pdev) -{ -struct omap_drm_private *priv =platform_get_drvdata (pdev); - -omapdrm_cleanup (priv); -kfree (priv); - -return 0 ; -} -#ifdef CONFIG_PM_SLEEP static int omap_drm_suspend_all_displays (void ) {@@ -734,9 +696,8 @@ static int omap_drm_resume_all_displays(void)return 0 ; } -static int omap_drm_suspend (struct device *dev) +int omap_drm_suspend (struct omap_drm_private *priv) { -struct omap_drm_private *priv =dev_get_drvdata (dev);struct drm_device *drm_dev = priv->ddev;drm_kms_helper_poll_disable (drm_dev);@@ -748,9 +709,8 @@ static int omap_drm_suspend(struct device *dev)return 0 ; } -static int omap_drm_resume (struct device *dev) +int omap_drm_resume (struct omap_drm_private *priv) { -struct omap_drm_private *priv =dev_get_drvdata (dev);struct drm_device *drm_dev = priv->ddev;drm_modeset_lock_all (drm_dev);@@ -763,40 +723,6 @@ static int omap_drm_resume(struct device *dev) }#endif -static SIMPLE_DEV_PM_OPS(omapdrm_pm_ops, omap_drm_suspend, omap_drm_resume); - -static struct platform_driver pdev = { - .driver = { - .name ="omapdrm" , - .pm = &omapdrm_pm_ops, - }, - .probe = pdev_probe, - .remove = pdev_remove, -}; - -static struct platform_driver *const drivers[] = { - &omap_dmm_driver, - &pdev, -}; - -static int __init omap_drm_init (void ) -{ -DBG ("init" ); - -return platform_register_drivers (drivers,ARRAY_SIZE (drivers)); -} - -static void __exit omap_drm_fini(void) -{ -DBG ("fini" ); - -platform_unregister_drivers (drivers,ARRAY_SIZE (drivers)); -} - -/* need late_initcall() so we load after dss_driver's are loaded */ -late_initcall (omap_drm_init); -module_exit (omap_drm_fini); -MODULE_AUTHOR ("Rob Clark <[email protected]>" );MODULE_DESCRIPTION ("OMAP DRM Display Driver" );MODULE_ALIAS ("platform:" DRIVER_NAME );drivers/gpu/drm/omapdrm/omap_drv.h +4
-0@@ -88,6 +88,10 @@ struct omap_drm_private {u32 irq_mask;/* enabled irqs in addition to wait_list */ }; +int omapdrm_init (struct omap_drm_private *priv,struct device *dev); +void omapdrm_cleanup (struct omap_drm_private *priv); +int omap_drm_suspend (struct omap_drm_private *priv); +int omap_drm_resume (struct omap_drm_private *priv);int omap_debugfs_init (struct drm_minor *minor);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
Re: [PATCH 20/48] drm: omapdrm: Merge the omapdrm and omapdss drivers
Hi Sebastian,
Quoted 26 lines · On Saturday, 14 October 2017 16:12:37 EEST Sebastian Reichel wrote:
Quoted 25 lines · Laurent Pinchart
The split between the omapdss and omapdrm driver is historic and was due to other userspace APIs (FBDEV and V4L2) being supported in addition to DRM/KMS. Now that the drivers only supports the DRM/KMS API, there is no need to keep them separate anymore.
Merge the two drivers and remove the now unneeded omapdrm virtual platform device.
Signed-off-by Laurent Pinchart <[email protected]>---
drivers/gpu/drm/omapdrm/Kconfig | 5 +- drivers/gpu/drm/omapdrm/Makefile | 25 ++++++++++ drivers/gpu/drm/omapdrm/dss/Kconfig | 12 ----- drivers/gpu/drm/omapdrm/dss/Makefile | 25 ---------- drivers/gpu/drm/omapdrm/dss/base.c | 13 ----- drivers/gpu/drm/omapdrm/dss/core.c | 14 ++---- drivers/gpu/drm/omapdrm/dss/dss.c | 23 ++++++++- drivers/gpu/drm/omapdrm/dss/omapdss.h | 4 -- drivers/gpu/drm/omapdrm/omap_dmm_tiler.c | 12 ++++- drivers/gpu/drm/omapdrm/omap_dmm_tiler.h | 3 +- drivers/gpu/drm/omapdrm/omap_drv.c | 82 ++------------------------- drivers/gpu/drm/omapdrm/omap_drv.h | 4 ++ 12 files changed, 74 insertions(+), 148 deletions(-)
Quoted 15 lines
drivers/gpu/drm/omapdrm/Kconfig config DRM_OMAP · line 7
Quoted 12 lines
(quoted diff) +0
-0b/drivers/gpu/drm/omapdrm/Kconfig index
b3d08c5f41d4..7e5080e45b16100644drivers/gpu/drm/omapdrm/Kconfig +2
-1@@ -2,8 +2,11 @@ config DRM_OMAP tristate "OMAP DRM" depends on DRM depends on ARCH_OMAP2PLUS || ARCH_MULTIPLATFORM - select OMAP2_DSS select DRM_KMS_HELPER + select HDMI + select OMAP2_DSSAs far as I can see "
CONFIG_OMAP2_DSS" no longer exists after the merge, so this can be dropped.
Good point. I'll fix that in v2.
Quoted 11 lines
Otherwise:
Reviewed-by Sebastian Reichel <[email protected]>-- Sebastian
Quoted 5 lines
drivers/gpu/drm/omapdrm/Kconfig +2
-0+ select OMAP2_DSS_INIT + select VIDEOMODE_HELPERS default n help DRM display driver for OMAP2/3/4 based boards.
[snip]
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 21/48 drm: omapdrm: dss: Support passing private data to debugfs show handlers
In reply to Laurent PinchartTo simplify implementation of debugfs seq_file show handlers, the driver passes the pointer to the show function through the debugfs_create_file data pointer. This prevents using the pointer to pass driver private data to the show handler, and requires all handlers to use global variables to access private data.
To prepare for the removal of global private data in the driver, rework the debugfs infrastructure to allow passing a private data pointer to show handlers.
The price to pay is explicit removal of debugfs files to free the internally allocated memory. This is desirable anyway as debugfs entries should be removed when a component driver is unbound, otherwise crashes will occur due to access to freed memory when the components will be dynamically allocated instead of stored in global variables.
--- drivers/gpu/drm/omapdrm/dss/dispc.c | 13 ++++-- drivers/gpu/drm/omapdrm/dss/dsi.c | 40 +++++++++++----- drivers/gpu/drm/omapdrm/dss/dss.c | 92 +++++++++++++++++++++++++------------ drivers/gpu/drm/omapdrm/dss/dss.h | 27 +++++++---- drivers/gpu/drm/omapdrm/dss/hdmi.h | 2 + drivers/gpu/drm/omapdrm/dss/hdmi4.c | 9 ++-- drivers/gpu/drm/omapdrm/dss/hdmi5.c | 9 ++-- drivers/gpu/drm/omapdrm/dss/venc.c | 11 +++-- 8 files changed, 140 insertions(+), 63 deletions(-)
drivers/gpu/drm/omapdrm/dss/dispc.c +10 -3
@@ -168,6 +168,8 @@ static struct {struct platform_device *pdev;void __iomem *base; +struct dss_debugfs_entry *debugfs; +int irq;irq_handler_t user_handler;void *user_data;
@@ -3269,7 +3271,7 @@ void dispc_dump_clocks(struct seq_file *s)dispc_runtime_put (); } -static void dispc_dump_regs (struct seq_file *s) +static int dispc_dump_regs (struct seq_file *s,void *p) {int i, j;const char *mgr_names[] = {
@@ -3290,7 +3292,7 @@ static void dispc_dump_regs(struct seq_file *s)#define DUMPREG (r) seq_printf(s, "%-50s %08x\n", #r, dispc_read_reg(r))if (dispc_runtime_get ()) -return ; +return 0 ;/* DISPC common registers */ DUMPREG (DISPC_REVISION );
@@ -3462,6 +3464,8 @@ static void dispc_dump_regs(struct seq_file *s)#undef DISPC_REG#undef DUMPREG + +return 0 ; }/* calculate clock rates using dividers in cinfo */
@@ -4606,7 +4610,8 @@ static int dispc_bind(struct device *dev, struct device *master, void *data)dispc_set_ops (&dispc_ops); -dss_debugfs_create_file ("dispc" , dispc_dump_regs); + dispc.debugfs =dss_debugfs_create_file ("dispc" , dispc_dump_regs, + &dispc);return 0 ;
@@ -4618,6 +4623,8 @@ static int dispc_bind(struct device *dev, struct device *master, void *data)static void dispc_unbind (struct device *dev,struct device *master,void *data) { +dss_debugfs_remove_file (dispc.debugfs); +dispc_set_ops (NULL );pm_runtime_disable (dev);
drivers/gpu/drm/omapdrm/dss/dsi.c +29 -11
@@ -402,6 +402,10 @@ struct dsi_data {#endif int debug_read;int debug_write; +struct { +struct dss_debugfs_entry *irqs; +struct dss_debugfs_entry *regs; + } debugfs;#ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS spinlock_t irq_stats_lock;
@@ -1659,18 +1663,20 @@ static void dsi_dump_dsidev_irqs(struct platform_device *dsidev,#undef PIS } -static void dsi1_dump_irqs (struct seq_file *s) +static int dsi1_dump_irqs (struct seq_file *s,void *p) {struct platform_device *dsidev =dsi_get_dsidev_from_id (0 );dsi_dump_dsidev_irqs (dsidev, s); +return 0 ; } -static void dsi2_dump_irqs (struct seq_file *s) +static int dsi2_dump_irqs (struct seq_file *s,void *p) {struct platform_device *dsidev =dsi_get_dsidev_from_id (1 );dsi_dump_dsidev_irqs (dsidev, s); +return 0 ; }#endif
@@ -1758,18 +1764,20 @@ static void dsi_dump_dsidev_regs(struct platform_device *dsidev,#undef DUMPREG } -static void dsi1_dump_regs (struct seq_file *s) +static int dsi1_dump_regs (struct seq_file *s,void *p) {struct platform_device *dsidev =dsi_get_dsidev_from_id (0 );dsi_dump_dsidev_regs (dsidev, s); +return 0 ; } -static void dsi2_dump_regs (struct seq_file *s) +static int dsi2_dump_regs (struct seq_file *s,void *p) {struct platform_device *dsidev =dsi_get_dsidev_from_id (1 );dsi_dump_dsidev_regs (dsidev, s); +return 0 ; }enum dsi_cio_power_state {
@@ -5567,15 +5575,22 @@ static int dsi_bind(struct device *dev, struct device *master, void *data)dsi_runtime_put (dsidev);if (dsi->module_id ==0 ) -dss_debugfs_create_file ("dsi1_regs" , dsi1_dump_regs); -else if (dsi->module_id ==1 ) -dss_debugfs_create_file ("dsi2_regs" , dsi2_dump_regs); - + dsi->debugfs.regs =dss_debugfs_create_file ("dsi1_regs" , + dsi1_dump_regs, + &dsi); +else + dsi->debugfs.regs =dss_debugfs_create_file ("dsi2_regs" , + dsi2_dump_regs, + &dsi);#ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS if (dsi->module_id ==0 ) -dss_debugfs_create_file ("dsi1_irqs" , dsi1_dump_irqs); -else if (dsi->module_id ==1 ) -dss_debugfs_create_file ("dsi2_irqs" , dsi2_dump_irqs); + dsi->debugfs.irqs =dss_debugfs_create_file ("dsi1_irqs" , + dsi1_dump_irqs, + &dsi); +else + dsi->debugfs.irqs =dss_debugfs_create_file ("dsi2_irqs" , + dsi2_dump_irqs, + &dsi);#endif return 0 ;
@@ -5594,6 +5609,9 @@ static void dsi_unbind(struct device *dev, struct device *master, void *data)struct platform_device *dsidev =to_platform_device (dev);struct dsi_data *dsi =dsi_get_dsidrv_data (dsidev); +dss_debugfs_remove_file (dsi->debugfs.irqs); +dss_debugfs_remove_file (dsi->debugfs.regs); +of_platform_depopulate (&dsidev->dev);WARN_ON (dsi->scp_clk_refcount >0 );
drivers/gpu/drm/omapdrm/dss/dss.c +62 -30
158 lines not on this page · raw message
drivers/gpu/drm/omapdrm/dss/dss.h +17 -10
@@ -27,6 +27,11 @@#include "omapdss.h" +struct dentry ; +struct dss_debugfs_entry ; +struct platform_device ; +struct seq_file ; +#define MAX_DSS_LCD_MANAGERS 3#define MAX_NUM_DSI 2
@@ -234,9 +239,6 @@ struct dss_lcd_mgr_config {int lcden_sig_polarity; }; -struct seq_file ; -struct platform_device ; -/* core */ static inline int dss_set_min_bus_tput (struct device *dev,unsigned long tput) {
@@ -255,12 +257,20 @@ static inline bool dss_mgr_is_lcd(enum omap_channel id)/* DSS */ #if defined(CONFIG_OMAP2_DSS_DEBUGFS ) -int dss_debugfs_create_file (const char *name,void (*write)(struct seq_file *)); +struct dss_debugfs_entry *dss_debugfs_create_file (const char *name, +int (*show_fn)(struct seq_file *s,void *data),void *data); +void dss_debugfs_remove_file (struct dss_debugfs_entry *entry);#else -static inline int dss_debugfs_create_file (const char *name, -void (*write)(struct seq_file *)) +static inline struct dss_debugfs_entry * +dss_debugfs_create_file (const char *name, +int (*show_fn)(struct seq_file *s,void *data), +void *data) +{ +return NULL ; +} + +static inline void dss_debugfs_remove_file (struct dss_debugfs_entry *entry) { -return 0 ; }#endif /* CONFIG_OMAP2_DSS_DEBUGFS */
@@ -325,9 +335,6 @@ static inline void sdi_uninit_port(struct device_node *port)#ifdef CONFIG_OMAP2_DSS_DSI -struct dentry ; -struct file_operations ; -int dsi_init_platform_driver (void )__init ;void dsi_uninit_platform_driver (void );
drivers/gpu/drm/omapdrm/dss/hdmi.h +2 -0
@@ -358,6 +358,8 @@ struct omap_hdmi {struct mutex lock;struct platform_device *pdev; +struct dss_debugfs_entry *debugfs; +struct hdmi_wp_data wp;struct hdmi_pll_data pll;struct hdmi_phy_data phy;
drivers/gpu/drm/omapdrm/dss/hdmi4.c +6 -3
@@ -302,13 +302,13 @@ static void hdmi_display_get_timings(struct omap_dss_device *dssdev, *vm = hdmi.cfg.vm; } -static void hdmi_dump_regs (struct seq_file *s) +static int hdmi_dump_regs (struct seq_file *s,void *p) {mutex_lock (&hdmi.lock);if (hdmi_runtime_get ()) {mutex_unlock (&hdmi.lock); -return ; +return 0 ; }hdmi_wp_dump (&hdmi.wp, s);
@@ -318,6 +318,7 @@ static void hdmi_dump_regs(struct seq_file *s)hdmi_runtime_put ();mutex_unlock (&hdmi.lock); +return 0 ; }static int read_edid (u8 *buf,int len)
@@ -776,7 +777,7 @@ static int hdmi4_bind(struct device *dev, struct device *master, void *data)return r; } -dss_debugfs_create_file ("hdmi" , hdmi_dump_regs); + hdmi.debugfs =dss_debugfs_create_file ("hdmi" , hdmi_dump_regs, &hdmi);return 0 ; err:
@@ -788,6 +789,8 @@ static void hdmi4_unbind(struct device *dev, struct device *master, void *data) {struct platform_device *pdev =to_platform_device (dev); +dss_debugfs_remove_file (hdmi.debugfs); +if (hdmi.audio_pdev)platform_device_unregister (hdmi.audio_pdev);
drivers/gpu/drm/omapdrm/dss/hdmi5.c +6 -3
@@ -299,13 +299,13 @@ static void hdmi_display_get_timings(struct omap_dss_device *dssdev, *vm = hdmi.cfg.vm; } -static void hdmi_dump_regs (struct seq_file *s) +static int hdmi_dump_regs (struct seq_file *s,void *p) {mutex_lock (&hdmi.lock);if (hdmi_runtime_get ()) {mutex_unlock (&hdmi.lock); -return ; +return 0 ; }hdmi_wp_dump (&hdmi.wp, s);
@@ -315,6 +315,7 @@ static void hdmi_dump_regs(struct seq_file *s)hdmi_runtime_put ();mutex_unlock (&hdmi.lock); +return 0 ; }static int read_edid (u8 *buf,int len)
@@ -774,7 +775,7 @@ static int hdmi5_bind(struct device *dev, struct device *master, void *data)return r; } -dss_debugfs_create_file ("hdmi" , hdmi_dump_regs); + hdmi.debugfs =dss_debugfs_create_file ("hdmi" , hdmi_dump_regs, &hdmi);return 0 ; err:
@@ -786,6 +787,8 @@ static void hdmi5_unbind(struct device *dev, struct device *master, void *data) {struct platform_device *pdev =to_platform_device (dev); +dss_debugfs_remove_file (hdmi.debugfs); +if (hdmi.audio_pdev)platform_device_unregister (hdmi.audio_pdev);
drivers/gpu/drm/omapdrm/dss/venc.c +8 -3
@@ -328,6 +328,8 @@ static struct {u32 wss_data;struct regulator *vdda_dac_reg; +struct dss_debugfs_entry *debugfs; +struct clk *tv_dac_clk;struct videomode vm;
@@ -671,12 +673,12 @@ static int venc_init_regulator(void)return 0 ; } -static void venc_dump_regs (struct seq_file *s) +static int venc_dump_regs (struct seq_file *s,void *p) {#define DUMPREG (r) seq_printf(s, "%-35s %08x\n", #r, venc_read_reg(r))if (venc_runtime_get ()) -return ; +return 0 ;DUMPREG (VENC_F_CONTROL );DUMPREG (VENC_VIDOUT_CTRL );
@@ -723,6 +725,7 @@ static void venc_dump_regs(struct seq_file *s)venc_runtime_put ();#undef DUMPREG +return 0 ; }static int venc_get_clocks (struct platform_device *pdev)
@@ -913,7 +916,7 @@ static int venc_bind(struct device *dev, struct device *master, void *data) goto err_probe_of; } -dss_debugfs_create_file ("venc" , venc_dump_regs); + venc.debugfs =dss_debugfs_create_file ("venc" , venc_dump_regs, &venc);venc_init_output (pdev);
@@ -929,6 +932,8 @@ static void venc_unbind(struct device *dev, struct device *master, void *data) {struct platform_device *pdev =to_platform_device (dev); +dss_debugfs_remove_file (venc.debugfs); +venc_uninit_output (pdev);pm_runtime_disable (&pdev->dev);
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 21/48] drm: omapdrm: dss: Support passing private data to debugfs show handlers
Hi Laurent,
Quoted 10 lines · Laurent Pinchart
To simplify implementation of debugfs
seq_fileshow handlers, the driver passes the pointer to the show function through thedebugfs_create_filedata pointer. This prevents using the pointer to pass driver private data to the show handler, and requires all handlers to use global variables to access private data.To prepare for the removal of global private data in the driver, rework the debugfs infrastructure to allow passing a private data pointer to show handlers.
Quoted 8 lines
The price to pay is explicit removal of debugfs files to free the internally allocated memory. This is desirable anyway as debugfs entries should be removed when a component driver is unbound, otherwise crashes will occur due to access to freed memory when the components will be dynamically allocated instead of stored in global variables.
Signed-off-by Laurent Pinchart <[email protected]>---
(One nit-pick in dss.h, see below)
-- Sebastian
Quoted 345 lines
drivers/gpu/drm/omapdrm/dss/dispc.c | 13 ++++-- drivers/gpu/drm/omapdrm/dss/dsi.c | 40 +++++++++++----- drivers/gpu/drm/omapdrm/dss/dss.c | 92 +++++++++++++++++++++++++------------ drivers/gpu/drm/omapdrm/dss/dss.h | 27 +++++++---- drivers/gpu/drm/omapdrm/dss/hdmi.h | 2 + drivers/gpu/drm/omapdrm/dss/hdmi4.c | 9 ++-- drivers/gpu/drm/omapdrm/dss/hdmi5.c | 9 ++-- drivers/gpu/drm/omapdrm/dss/venc.c | 11 +++-- 8 files changed, 140 insertions(+), 63 deletions(-)drivers/gpu/drm/omapdrm/dss/dispc.c +10
-3@@ -168,6 +168,8 @@ static struct {struct platform_device *pdev;void __iomem *base; +struct dss_debugfs_entry *debugfs; +int irq;irq_handler_t user_handler;void *user_data;@@ -3269,7 +3271,7 @@ void dispc_dump_clocks(struct seq_file *s)dispc_runtime_put (); } -static void dispc_dump_regs (struct seq_file *s) +static int dispc_dump_regs (struct seq_file *s,void *p) {int i, j;const char *mgr_names[] = {@@ -3290,7 +3292,7 @@ static void dispc_dump_regs(struct seq_file *s)#define DUMPREG (r) seq_printf(s, "%-50s %08x\n", #r, dispc_read_reg(r))if (dispc_runtime_get ()) -return ; +return 0 ;/* DISPC common registers */ DUMPREG (DISPC_REVISION );@@ -3462,6 +3464,8 @@ static void dispc_dump_regs(struct seq_file *s)#undef DISPC_REG#undef DUMPREG + +return 0 ; }/* calculate clock rates using dividers in cinfo */ @@ -4606,7 +4610,8 @@ static int dispc_bind(struct device *dev, struct device *master, void *data)dispc_set_ops (&dispc_ops); -dss_debugfs_create_file ("dispc" , dispc_dump_regs); + dispc.debugfs =dss_debugfs_create_file ("dispc" , dispc_dump_regs, + &dispc);return 0 ;@@ -4618,6 +4623,8 @@ static int dispc_bind(struct device *dev, struct device *master, void *data)static void dispc_unbind (struct device *dev,struct device *master,void *data) { +dss_debugfs_remove_file (dispc.debugfs); +dispc_set_ops (NULL );pm_runtime_disable (dev);drivers/gpu/drm/omapdrm/dss/dsi.c +29
-11@@ -402,6 +402,10 @@ struct dsi_data {#endif int debug_read;int debug_write; +struct { +struct dss_debugfs_entry *irqs; +struct dss_debugfs_entry *regs; + } debugfs;#ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS spinlock_t irq_stats_lock;@@ -1659,18 +1663,20 @@ static void dsi_dump_dsidev_irqs(struct platform_device *dsidev,#undef PIS } -static void dsi1_dump_irqs (struct seq_file *s) +static int dsi1_dump_irqs (struct seq_file *s,void *p) {struct platform_device *dsidev =dsi_get_dsidev_from_id (0 );dsi_dump_dsidev_irqs (dsidev, s); +return 0 ; } -static void dsi2_dump_irqs (struct seq_file *s) +static int dsi2_dump_irqs (struct seq_file *s,void *p) {struct platform_device *dsidev =dsi_get_dsidev_from_id (1 );dsi_dump_dsidev_irqs (dsidev, s); +return 0 ; }#endif @@ -1758,18 +1764,20 @@ static void dsi_dump_dsidev_regs(struct platform_device *dsidev,#undef DUMPREG } -static void dsi1_dump_regs (struct seq_file *s) +static int dsi1_dump_regs (struct seq_file *s,void *p) {struct platform_device *dsidev =dsi_get_dsidev_from_id (0 );dsi_dump_dsidev_regs (dsidev, s); +return 0 ; } -static void dsi2_dump_regs (struct seq_file *s) +static int dsi2_dump_regs (struct seq_file *s,void *p) {struct platform_device *dsidev =dsi_get_dsidev_from_id (1 );dsi_dump_dsidev_regs (dsidev, s); +return 0 ; }enum dsi_cio_power_state {@@ -5567,15 +5575,22 @@ static int dsi_bind(struct device *dev, struct device *master, void *data)dsi_runtime_put (dsidev);if (dsi->module_id ==0 ) -dss_debugfs_create_file ("dsi1_regs" , dsi1_dump_regs); -else if (dsi->module_id ==1 ) -dss_debugfs_create_file ("dsi2_regs" , dsi2_dump_regs); - + dsi->debugfs.regs =dss_debugfs_create_file ("dsi1_regs" , + dsi1_dump_regs, + &dsi); +else + dsi->debugfs.regs =dss_debugfs_create_file ("dsi2_regs" , + dsi2_dump_regs, + &dsi);#ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS if (dsi->module_id ==0 ) -dss_debugfs_create_file ("dsi1_irqs" , dsi1_dump_irqs); -else if (dsi->module_id ==1 ) -dss_debugfs_create_file ("dsi2_irqs" , dsi2_dump_irqs); + dsi->debugfs.irqs =dss_debugfs_create_file ("dsi1_irqs" , + dsi1_dump_irqs, + &dsi); +else + dsi->debugfs.irqs =dss_debugfs_create_file ("dsi2_irqs" , + dsi2_dump_irqs, + &dsi);#endif return 0 ;@@ -5594,6 +5609,9 @@ static void dsi_unbind(struct device *dev, struct device *master, void *data)struct platform_device *dsidev =to_platform_device (dev);struct dsi_data *dsi =dsi_get_dsidrv_data (dsidev); +dss_debugfs_remove_file (dsi->debugfs.irqs); +dss_debugfs_remove_file (dsi->debugfs.regs); +of_platform_depopulate (&dsidev->dev);WARN_ON (dsi->scp_clk_refcount >0 );drivers/gpu/drm/omapdrm/dss/dss.c +62
-30@@ -118,6 +118,11 @@ static struct {const struct dss_features *feat; +struct { +struct dss_debugfs_entry *clk; +struct dss_debugfs_entry *dss; + } debugfs; +struct dss_pll *video1_pll;struct dss_pll *video2_pll; } dss;@@ -393,12 +398,12 @@ static void dss_dump_clocks(struct seq_file *s) }#endif -static void dss_dump_regs (struct seq_file *s) +static int dss_dump_regs (struct seq_file *s,void *p) {#define DUMPREG (r) seq_printf(s, "%-35s %08x\n", #r, dss_read_reg(r))if (dss_runtime_get ()) -return ; +return 0 ;DUMPREG (DSS_REVISION );DUMPREG (DSS_SYSCONFIG );@@ -413,6 +418,7 @@ static void dss_dump_regs(struct seq_file *s)dss_runtime_put ();#undef DUMPREG +return 0 ; }static int dss_get_channel_index (enum omap_channel channel)@@ -906,35 +912,16 @@ void dss_runtime_put(void)/* DEBUGFS */ #if defined(CONFIG_OMAP2_DSS_DEBUGFS ) -static void dss_debug_dump_clocks (struct seq_file *s) +static int dss_debug_dump_clocks (struct seq_file *s,void *p) {dss_dump_clocks (s);dispc_dump_clocks (s);#ifdef CONFIG_OMAP2_DSS_DSI dsi_dump_clocks (s);#endif -} - -static int dss_debug_show (struct seq_file *s,void *unused) -{ -void (*func)(struct seq_file *) = s->private; - -func (s);return 0 ; } -static int dss_debug_open (struct inode *inode,struct file *file) -{ -return single_open (file, dss_debug_show, inode->i_private); -} - -static const struct file_operations dss_debug_fops = { - .open = dss_debug_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; -static struct dentry *dss_debugfs_dir;static int dss_initialize_debugfs (void )@@ -947,9 +934,6 @@ static int dss_initialize_debugfs(void)return err; } -debugfs_create_file ("clk" ,S_IRUGO , dss_debugfs_dir, - &dss_debug_dump_clocks, &dss_debug_fops); -return 0 ; }@@ -959,15 +943,59 @@ static void dss_uninitialize_debugfs(void)debugfs_remove_recursive (dss_debugfs_dir); } -int dss_debugfs_create_file (const char *name,void (*write)(struct seq_file *)) +struct dss_debugfs_entry { +struct dentry *dentry; +int (*show_fn)(struct seq_file *s,void *data); +void *data; +}; + +static int dss_debug_open (struct inode *inode,struct file *file) { +struct dss_debugfs_entry *entry = inode->i_private; + +return single_open (file, entry->show_fn, entry->data); +} + +static const struct file_operations dss_debug_fops = { + .open = dss_debug_open, + .read = seq_read, + .llseek = seq_lseek, + .release = single_release, +}; + +struct dss_debugfs_entry *dss_debugfs_create_file (const char *name, +int (*show_fn)(struct seq_file *s,void *data),void *data) +{ +struct dss_debugfs_entry *entry;struct dentry *d; - d =debugfs_create_file (name,S_IRUGO , dss_debugfs_dir, - write, &dss_debug_fops); + entry =kzalloc (sizeof (*entry),GFP_KERNEL ); +if (!entry) +return ERR_PTR (-ENOMEM ); + + entry->show_fn = show_fn; + entry->data = data; -return PTR_ERR_OR_ZERO (d); + d =debugfs_create_file (name,0444 , dss_debugfs_dir, entry, + &dss_debug_fops); +if (IS_ERR (d)) { +kfree (entry); +return ERR_PTR (PTR_ERR (d)); + } + + entry->dentry = d; +return entry; +} + +void dss_debugfs_remove_file (struct dss_debugfs_entry *entry) +{ +if (IS_ERR_OR_NULL (entry)) +return ; + +debugfs_remove (entry->dentry); +kfree (entry); } +#else /* CONFIG_OMAP2_DSS_DEBUGFS */ static inline int dss_initialize_debugfs (void ) {@@ -1364,7 +1392,9 @@ static int dss_bind(struct device *dev)if (r) goto err_component; -dss_debugfs_create_file ("dss" , dss_dump_regs); + dss.debugfs.clk =dss_debugfs_create_file ("clk" , dss_debug_dump_clocks, + &dss); + dss.debugfs.dss =dss_debugfs_create_file ("dss" , dss_dump_regs, &dss);pm_set_vt_switch (0 );@@ -1377,6 +1407,8 @@ static int dss_bind(struct device *dev)return 0 ; err_drm_init: +dss_debugfs_remove_file (dss.debugfs.clk); +dss_debugfs_remove_file (dss.debugfs.dss);component_unbind_all (&pdev->dev,NULL ); err_component: err_runtime_get:drivers/gpu/drm/omapdrm/dss/dss.h +0
-0
drivers/gpu/drm/omapdrm/dss/dss.h line 30
Quoted 4 lines
drivers/gpu/drm/omapdrm/dss/dss.h +1
-0@@ -27,6 +27,11 @@#include "omapdss.h" +struct dentry ;
You can drop this one. It is not used in dss.h.
Quoted 220 lines
drivers/gpu/drm/omapdrm/dss/dss.h +16
-10+struct dss_debugfs_entry ; +struct platform_device ; +struct seq_file ; +#define MAX_DSS_LCD_MANAGERS 3#define MAX_NUM_DSI 2@@ -234,9 +239,6 @@ struct dss_lcd_mgr_config {int lcden_sig_polarity; }; -struct seq_file ; -struct platform_device ; -/* core */ static inline int dss_set_min_bus_tput (struct device *dev,unsigned long tput) {@@ -255,12 +257,20 @@ static inline bool dss_mgr_is_lcd(enum omap_channel id)/* DSS */ #if defined(CONFIG_OMAP2_DSS_DEBUGFS ) -int dss_debugfs_create_file (const char *name,void (*write)(struct seq_file *)); +struct dss_debugfs_entry *dss_debugfs_create_file (const char *name, +int (*show_fn)(struct seq_file *s,void *data),void *data); +void dss_debugfs_remove_file (struct dss_debugfs_entry *entry);#else -static inline int dss_debugfs_create_file (const char *name, -void (*write)(struct seq_file *)) +static inline struct dss_debugfs_entry * +dss_debugfs_create_file (const char *name, +int (*show_fn)(struct seq_file *s,void *data), +void *data) +{ +return NULL ; +} + +static inline void dss_debugfs_remove_file (struct dss_debugfs_entry *entry) { -return 0 ; }#endif /* CONFIG_OMAP2_DSS_DEBUGFS */ @@ -325,9 +335,6 @@ static inline void sdi_uninit_port(struct device_node *port)#ifdef CONFIG_OMAP2_DSS_DSI -struct dentry ; -struct file_operations ; -int dsi_init_platform_driver (void )__init ;void dsi_uninit_platform_driver (void );drivers/gpu/drm/omapdrm/dss/hdmi.h +2
-0@@ -358,6 +358,8 @@ struct omap_hdmi {struct mutex lock;struct platform_device *pdev; +struct dss_debugfs_entry *debugfs; +struct hdmi_wp_data wp;struct hdmi_pll_data pll;struct hdmi_phy_data phy;drivers/gpu/drm/omapdrm/dss/hdmi4.c +6
-3@@ -302,13 +302,13 @@ static void hdmi_display_get_timings(struct omap_dss_device *dssdev, *vm = hdmi.cfg.vm; } -static void hdmi_dump_regs (struct seq_file *s) +static int hdmi_dump_regs (struct seq_file *s,void *p) {mutex_lock (&hdmi.lock);if (hdmi_runtime_get ()) {mutex_unlock (&hdmi.lock); -return ; +return 0 ; }hdmi_wp_dump (&hdmi.wp, s);@@ -318,6 +318,7 @@ static void hdmi_dump_regs(struct seq_file *s)hdmi_runtime_put ();mutex_unlock (&hdmi.lock); +return 0 ; }static int read_edid (u8 *buf,int len)@@ -776,7 +777,7 @@ static int hdmi4_bind(struct device *dev, struct device *master, void *data)return r; } -dss_debugfs_create_file ("hdmi" , hdmi_dump_regs); + hdmi.debugfs =dss_debugfs_create_file ("hdmi" , hdmi_dump_regs, &hdmi);return 0 ; err:@@ -788,6 +789,8 @@ static void hdmi4_unbind(struct device *dev, struct device *master, void *data) {struct platform_device *pdev =to_platform_device (dev); +dss_debugfs_remove_file (hdmi.debugfs); +if (hdmi.audio_pdev)platform_device_unregister (hdmi.audio_pdev);drivers/gpu/drm/omapdrm/dss/hdmi5.c +6
-3@@ -299,13 +299,13 @@ static void hdmi_display_get_timings(struct omap_dss_device *dssdev, *vm = hdmi.cfg.vm; } -static void hdmi_dump_regs (struct seq_file *s) +static int hdmi_dump_regs (struct seq_file *s,void *p) {mutex_lock (&hdmi.lock);if (hdmi_runtime_get ()) {mutex_unlock (&hdmi.lock); -return ; +return 0 ; }hdmi_wp_dump (&hdmi.wp, s);@@ -315,6 +315,7 @@ static void hdmi_dump_regs(struct seq_file *s)hdmi_runtime_put ();mutex_unlock (&hdmi.lock); +return 0 ; }static int read_edid (u8 *buf,int len)@@ -774,7 +775,7 @@ static int hdmi5_bind(struct device *dev, struct device *master, void *data)return r; } -dss_debugfs_create_file ("hdmi" , hdmi_dump_regs); + hdmi.debugfs =dss_debugfs_create_file ("hdmi" , hdmi_dump_regs, &hdmi);return 0 ; err:@@ -786,6 +787,8 @@ static void hdmi5_unbind(struct device *dev, struct device *master, void *data) {struct platform_device *pdev =to_platform_device (dev); +dss_debugfs_remove_file (hdmi.debugfs); +if (hdmi.audio_pdev)platform_device_unregister (hdmi.audio_pdev);drivers/gpu/drm/omapdrm/dss/venc.c +8
-3@@ -328,6 +328,8 @@ static struct {u32 wss_data;struct regulator *vdda_dac_reg; +struct dss_debugfs_entry *debugfs; +struct clk *tv_dac_clk;struct videomode vm;@@ -671,12 +673,12 @@ static int venc_init_regulator(void)return 0 ; } -static void venc_dump_regs (struct seq_file *s) +static int venc_dump_regs (struct seq_file *s,void *p) {#define DUMPREG (r) seq_printf(s, "%-35s %08x\n", #r, venc_read_reg(r))if (venc_runtime_get ()) -return ; +return 0 ;DUMPREG (VENC_F_CONTROL );DUMPREG (VENC_VIDOUT_CTRL );@@ -723,6 +725,7 @@ static void venc_dump_regs(struct seq_file *s)venc_runtime_put ();#undef DUMPREG +return 0 ; }static int venc_get_clocks (struct platform_device *pdev)@@ -913,7 +916,7 @@ static int venc_bind(struct device *dev, struct device *master, void *data) goto err_probe_of; } -dss_debugfs_create_file ("venc" , venc_dump_regs); + venc.debugfs =dss_debugfs_create_file ("venc" , venc_dump_regs, &venc);venc_init_output (pdev);@@ -929,6 +932,8 @@ static void venc_unbind(struct device *dev, struct device *master, void *data) {struct platform_device *pdev =to_platform_device (dev); +dss_debugfs_remove_file (venc.debugfs); +venc_uninit_output (pdev);pm_runtime_disable (&pdev->dev);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
Re: [PATCH 21/48] drm: omapdrm: dss: Support passing private data to debugfs show handlers
Hi Sebastian,
Quoted 35 lines · On Monday, 16 October 2017 00:10:19 EEST Sebastian Reichel wrote:
Quoted 10 lines · Laurent Pinchart
To simplify implementation of debugfs
seq_fileshow handlers, the driver passes the pointer to the show function through thedebugfs_create_filedata pointer. This prevents using the pointer to pass driver private data to the show handler, and requires all handlers to use global variables to access private data.To prepare for the removal of global private data in the driver, rework the debugfs infrastructure to allow passing a private data pointer to show handlers.
Quoted 8 lines
The price to pay is explicit removal of debugfs files to free the internally allocated memory. This is desirable anyway as debugfs entries should be removed when a component driver is unbound, otherwise crashes will occur due to access to freed memory when the components will be dynamically allocated instead of stored in global variables.
Signed-off-by Laurent Pinchart <[email protected]>---
Reviewed-by Sebastian Reichel <[email protected]>(One nit-pick in
dss.h, see below)-- Sebastian
Quoted 9 lines
drivers/gpu/drm/omapdrm/dss/dispc.c | 13 ++++-- drivers/gpu/drm/omapdrm/dss/dsi.c | 40 +++++++++++----- drivers/gpu/drm/omapdrm/dss/dss.c | 92 +++++++++++++++++++++----------- drivers/gpu/drm/omapdrm/dss/dss.h | 27 +++++++---- drivers/gpu/drm/omapdrm/dss/hdmi.h | 2 + drivers/gpu/drm/omapdrm/dss/hdmi4.c | 9 ++-- drivers/gpu/drm/omapdrm/dss/hdmi5.c | 9 ++-- drivers/gpu/drm/omapdrm/dss/venc.c | 11 +++-- 8 files changed, 140 insertions(+), 63 deletions(-)
[snip]
Quoted 7 lines
Quoted 7 lines
(quoted diff) +0
-0
b/drivers/gpu/drm/omapdrm/dss/dss.hindexdb529481b364..e688e937da28100644drivers/gpu/drm/omapdrm/dss/dss.h +0
-0@@ -27,6 +27,11 @@
Quoted 5 lines
drivers/gpu/drm/omapdrm/dss/dss.h line 30
Quoted 3 lines
drivers/gpu/drm/omapdrm/dss/dss.h +1
-0#include "omapdss.h" +struct dentry ;You can drop this one. It is not used in
dss.h.
Indeed, it's a leftover from a previous version where I was still exposing struct dentry. I'll remove it in v2.
Quoted 3 lines
Quoted 3 lines
drivers/gpu/drm/omapdrm/dss/dss.h +3
-0+struct dss_debugfs_entry ; +struct platform_device ; +struct seq_file ;
[snip]
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 22/48 drm: omapdrm: dss: Pass DSS private structure to runtime PM functions
In reply to Laurent PinchartTo prepare for the removal of the global variable storing DSS private data, pass its pointer to the dss_runtime_{get,put}() functions.
As this requires getting hold of the DSS private structure in the callers, we expose the structure through an opaque pointer that can be retrieved through a new dss_device_get() function. The function currently returns a pointer to the global data structure, and will later be updated to get the pointer from device driver data when the DSS private structure will be allocated dynamically.
--- drivers/gpu/drm/omapdrm/dss/dsi.c | 7 +++++-- drivers/gpu/drm/omapdrm/dss/dss.c | 37 ++++++++++++++++++++------------- drivers/gpu/drm/omapdrm/dss/dss.h | 13 ++++++++---- drivers/gpu/drm/omapdrm/dss/hdmi.h | 6 ++++-- drivers/gpu/drm/omapdrm/dss/hdmi4.c | 3 ++- drivers/gpu/drm/omapdrm/dss/hdmi5.c | 3 ++- drivers/gpu/drm/omapdrm/dss/hdmi_pll.c | 10 +++++---- drivers/gpu/drm/omapdrm/dss/video-pll.c | 12 ++++++----- 8 files changed, 58 insertions(+), 33 deletions(-)
drivers/gpu/drm/omapdrm/dss/dsi.c +5 -2
@@ -5333,7 +5333,8 @@ static const struct dss_pll_hw dss_omap5_dsi_pll_hw = { .has_refsel = true, }; -static int dsi_init_pll_data (struct platform_device *dsidev) +static int dsi_init_pll_data (struct dss_device *dss, +struct platform_device *dsidev) {struct dsi_data *dsi =dsi_get_dsidrv_data (dsidev);struct dss_pll *pll = &dsi->pll;
@@ -5352,6 +5353,7 @@ static int dsi_init_pll_data(struct platform_device *dsidev) pll->base = dsi->pll_base; pll->hw = dsi->data->pll_hw; pll->ops = &dsi_pll_ops; + pll->dss = dss; r =dss_pll_register (pll);if (r)
@@ -5428,6 +5430,7 @@ static const struct soc_device_attribute dsi_soc_devices[] = {static int dsi_bind (struct device *dev,struct device *master,void *data) {struct platform_device *dsidev =to_platform_device (dev); +struct dss_device *dss =dss_get_device (master);const struct soc_device_attribute *soc;const struct dsi_module_id_data *d;u32 rev;
@@ -5538,7 +5541,7 @@ static int dsi_bind(struct device *dev, struct device *master, void *data)if (r)return r; -dsi_init_pll_data (dsidev); +dsi_init_pll_data (dss, dsidev);pm_runtime_enable (&dsidev->dev);
drivers/gpu/drm/omapdrm/dss/dss.c +23 -14
@@ -93,7 +93,7 @@ struct dss_features {bool has_lcd_clk_src; }; -static struct { +struct dss_device {struct platform_device *pdev;struct omap_drm_private drm;
@@ -125,7 +125,9 @@ static struct {struct dss_pll *video1_pll;struct dss_pll *video2_pll; -} dss; +}; + +static struct dss_device dss;static const char *const dss_generic_clk_source_names[] = { [DSS_CLK_SRC_FCK ] ="FCK" ,
@@ -382,7 +384,7 @@ static void dss_dump_clocks(struct seq_file *s)const char *fclk_name;unsigned long fclk_rate; -if (dss_runtime_get ()) +if (dss_runtime_get (&dss))return ;seq_printf (s,"- DSS -\n" );
@@ -394,7 +396,7 @@ static void dss_dump_clocks(struct seq_file *s) fclk_name, fclk_rate); - dss_runtime_put(); + dss_runtime_put(&dss); }#endif
@@ -402,7 +404,7 @@ static int dss_dump_regs(struct seq_file *s, void *p) {#define DUMPREG (r) seq_printf(s, "%-35s %08x\n", #r, dss_read_reg(r)) -if (dss_runtime_get ()) +if (dss_runtime_get (&dss))return 0 ;DUMPREG (DSS_REVISION );
@@ -416,7 +418,7 @@ static int dss_dump_regs(struct seq_file *s, void *p)DUMPREG (DSS_SDI_STATUS ); } -dss_runtime_put (); +dss_runtime_put (&dss);#undef DUMPREGreturn 0 ; }
@@ -889,27 +891,32 @@ static void dss_put_clocks(void)clk_put (dss.parent_clk); } -int dss_runtime_get (void ) +int dss_runtime_get (struct dss_device *dss) {int r;DSSDBG ("dss_runtime_get\n" ); - r =pm_runtime_get_sync (&dss.pdev->dev); + r =pm_runtime_get_sync (&dss->pdev->dev);WARN_ON (r <0 );return r <0 ? r :0 ; } -void dss_runtime_put (void ) +void dss_runtime_put (struct dss_device *dss) {int r;DSSDBG ("dss_runtime_put\n" ); - r =pm_runtime_put_sync (&dss.pdev->dev); + r =pm_runtime_put_sync (&dss->pdev->dev);WARN_ON (r <0 && r != -ENOSYS && r != -EBUSY ); } +struct dss_device *dss_get_device (struct device *dev) +{ +return &dss; +} +/* DEBUGFS */ #if defined(CONFIG_OMAP2_DSS_DEBUGFS )static int dss_debug_dump_clocks (struct seq_file *s,void *p)
@@ -1297,13 +1304,15 @@ static int dss_video_pll_probe(struct platform_device *pdev) }if (of_property_match_string (np,"reg-names" ,"pll1" ) >=0 ) { - dss.video1_pll =dss_video_pll_init (pdev,0 , pll_regulator); + dss.video1_pll =dss_video_pll_init (&dss, pdev,0 , + pll_regulator);if (IS_ERR (dss.video1_pll))return PTR_ERR (dss.video1_pll); }if (of_property_match_string (np,"reg-names" ,"pll2" ) >=0 ) { - dss.video2_pll =dss_video_pll_init (pdev,1 , pll_regulator); + dss.video2_pll =dss_video_pll_init (&dss, pdev,1 , + pll_regulator);if (IS_ERR (dss.video2_pll)) {dss_video_pll_uninit (dss.video1_pll);return PTR_ERR (dss.video2_pll);
@@ -1361,7 +1370,7 @@ static int dss_bind(struct device *dev)pm_runtime_enable (&pdev->dev); - r =dss_runtime_get (); + r =dss_runtime_get (&dss);if (r) goto err_runtime_get;
@@ -1386,7 +1395,7 @@ static int dss_bind(struct device *dev) rev =dss_read_reg (DSS_REVISION );pr_info ("OMAP DSS rev %d.%d\n" ,FLD_GET (rev,7 ,4 ),FLD_GET (rev,3 ,0 )); -dss_runtime_put (); +dss_runtime_put (&dss); r =component_bind_all (&pdev->dev,NULL );if (r)
drivers/gpu/drm/omapdrm/dss/dss.h +9 -4
@@ -29,6 +29,7 @@struct dentry ;struct dss_debugfs_entry ; +struct dss_device ;struct platform_device ;struct seq_file ;
@@ -198,6 +199,7 @@ struct dss_pll_hw {struct dss_pll {const char *name;enum dss_pll_id id; +struct dss_device *dss;struct clk *clkin;struct regulator *regulator;
@@ -277,8 +279,10 @@ static inline void dss_debugfs_remove_file(struct dss_debugfs_entry *entry)int dss_init_platform_driver (void )__init ;void dss_uninit_platform_driver (void ); -int dss_runtime_get (void ); -void dss_runtime_put (void ); +struct dss_device *dss_get_device (struct device *dev); + +int dss_runtime_get (struct dss_device *dss); +void dss_runtime_put (struct dss_device *dss);unsigned long dss_get_dispc_clk_rate (void );unsigned long dss_get_max_fck_rate (void );
@@ -289,8 +293,9 @@ enum dss_hdmi_venc_clk_source_select dss_get_hdmi_venc_clk_source(void);const char *dss_get_clk_source_name (enum dss_clk_source clk_src);/* DSS VIDEO PLL */ -struct dss_pll *dss_video_pll_init (struct platform_device *pdev,int id, -struct regulator *regulator); +struct dss_pll *dss_video_pll_init (struct dss_device *dss, +struct platform_device *pdev,int id, +struct regulator *regulator);void dss_video_pll_uninit (struct dss_pll *pll);void dss_ctrl_pll_enable (enum dss_pll_id pll_id,bool enable);
drivers/gpu/drm/omapdrm/dss/hdmi.h +4 -2
@@ -29,6 +29,8 @@#include "omapdss.h" #include "dss.h" +struct dss_device ; +/* HDMI Wrapper */ #define HDMI_WP_REVISION 0x0
@@ -324,8 +326,8 @@ phys_addr_t hdmi_wp_get_audio_dma_addr(struct hdmi_wp_data *wp);/* HDMI PLL funcs */ void hdmi_pll_dump (struct hdmi_pll_data *pll,struct seq_file *s); -int hdmi_pll_init (struct platform_device *pdev,struct hdmi_pll_data *pll, -struct hdmi_wp_data *wp); +int hdmi_pll_init (struct dss_device *dss,struct platform_device *pdev, +struct hdmi_pll_data *pll,struct hdmi_wp_data *wp);void hdmi_pll_uninit (struct hdmi_pll_data *hpll);/* HDMI PHY funcs */
drivers/gpu/drm/omapdrm/dss/hdmi4.c +2 -1
@@ -717,6 +717,7 @@ static int hdmi_audio_register(struct device *dev)static int hdmi4_bind (struct device *dev,struct device *master,void *data) {struct platform_device *pdev =to_platform_device (dev); +struct dss_device *dss =dss_get_device (master);int r;int irq;
@@ -734,7 +735,7 @@ static int hdmi4_bind(struct device *dev, struct device *master, void *data)if (r)return r; - r =hdmi_pll_init (pdev, &hdmi.pll, &hdmi.wp); + r =hdmi_pll_init (dss, pdev, &hdmi.pll, &hdmi.wp);if (r)return r;
drivers/gpu/drm/omapdrm/dss/hdmi5.c +2 -1
@@ -719,6 +719,7 @@ static int hdmi_audio_register(struct device *dev)static int hdmi5_bind (struct device *dev,struct device *master,void *data) {struct platform_device *pdev =to_platform_device (dev); +struct dss_device *dss =dss_get_device (master);int r;int irq;
@@ -736,7 +737,7 @@ static int hdmi5_bind(struct device *dev, struct device *master, void *data)if (r)return r; - r =hdmi_pll_init (pdev, &hdmi.pll, &hdmi.wp); + r =hdmi_pll_init (dss, pdev, &hdmi.pll, &hdmi.wp);if (r)return r;
drivers/gpu/drm/omapdrm/dss/hdmi_pll.c +6 -4
@@ -128,7 +128,8 @@ static const struct dss_pll_hw dss_omap5_hdmi_pll_hw = { .has_refsel = true, }; -static int hdmi_init_pll_data (struct platform_device *pdev, +static int hdmi_init_pll_data (struct dss_device *dss, +struct platform_device *pdev,struct hdmi_pll_data *hpll) {struct dss_pll *pll = &hpll->pll;
@@ -145,6 +146,7 @@ static int hdmi_init_pll_data(struct platform_device *pdev, pll->id =DSS_PLL_HDMI ; pll->base = hpll->base; pll->clkin = clk; + pll->dss = dss;if (hpll->wp->version ==4 ) pll->hw = &dss_omap4_hdmi_pll_hw;
@@ -160,8 +162,8 @@ static int hdmi_init_pll_data(struct platform_device *pdev,return 0 ; } -int hdmi_pll_init (struct platform_device *pdev,struct hdmi_pll_data *pll, -struct hdmi_wp_data *wp) +int hdmi_pll_init (struct dss_device *dss,struct platform_device *pdev, +struct hdmi_pll_data *pll,struct hdmi_wp_data *wp) {int r;struct resource *res;
@@ -174,7 +176,7 @@ int hdmi_pll_init(struct platform_device *pdev, struct hdmi_pll_data *pll,if (IS_ERR (pll->base))return PTR_ERR (pll->base); - r =hdmi_init_pll_data (pdev, pll); + r =hdmi_init_pll_data (dss, pdev, pll);if (r) {DSSERR ("failed to init HDMI PLL\n" );return r;
drivers/gpu/drm/omapdrm/dss/video-pll.c +7 -5
@@ -62,7 +62,7 @@ static int dss_video_pll_enable(struct dss_pll *pll) struct dss_video_pll *vpll = container_of(pll, struct dss_video_pll, pll);int r; - r =dss_runtime_get (); + r =dss_runtime_get (pll->dss);if (r)return r;
@@ -81,7 +81,7 @@ static int dss_video_pll_enable(struct dss_pll *pll) err_reset:dss_dpll_disable_scp_clk (vpll);dss_ctrl_pll_enable (pll->id, false); -dss_runtime_put (); +dss_runtime_put (pll->dss);return r; }
@@ -96,7 +96,7 @@ static void dss_video_pll_disable(struct dss_pll *pll)dss_ctrl_pll_enable (pll->id, false); -dss_runtime_put (); +dss_runtime_put (pll->dss); }static const struct dss_pll_ops dss_pll_ops = {
@@ -134,8 +134,9 @@ static const struct dss_pll_hw dss_dra7_video_pll_hw = { .errata_i886 = true, }; -struct dss_pll *dss_video_pll_init (struct platform_device *pdev,int id, -struct regulator *regulator) +struct dss_pll *dss_video_pll_init (struct dss_device *dss, +struct platform_device *pdev,int id, +struct regulator *regulator) {const char *const reg_name[] = {"pll1" ,"pll2" };const char *const clkctrl_name[] = {"pll1_clkctrl" ,"pll2_clkctrl" };
@@ -187,6 +188,7 @@ struct dss_pll *dss_video_pll_init(struct platform_device *pdev, int id, pll->base = pll_base; pll->hw = &dss_dra7_video_pll_hw; pll->ops = &dss_pll_ops; + pll->dss = dss; r =dss_pll_register (pll);if (r)
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 22/48] drm: omapdrm: dss: Pass DSS private structure to runtime PM functions
Hi,
Quoted 10 lines · Laurent Pinchart
To prepare for the removal of the global variable storing DSS private data, pass its pointer to the dss_runtime_{get,put}() functions.
As this requires getting hold of the DSS private structure in the callers, we expose the structure through an opaque pointer that can be retrieved through a new
dss_device_get()function. The function currently returns a pointer to the global data structure, and will later be updated to get the pointer from device driver data when the DSS private structure will be allocated dynamically.
Quoted 2 lines
Signed-off-by Laurent Pinchart <[email protected]>---
-- Sebastian
Quoted 395 lines
drivers/gpu/drm/omapdrm/dss/dsi.c | 7 +++++-- drivers/gpu/drm/omapdrm/dss/dss.c | 37 ++++++++++++++++++++------------- drivers/gpu/drm/omapdrm/dss/dss.h | 13 ++++++++---- drivers/gpu/drm/omapdrm/dss/hdmi.h | 6 ++++-- drivers/gpu/drm/omapdrm/dss/hdmi4.c | 3 ++- drivers/gpu/drm/omapdrm/dss/hdmi5.c | 3 ++- drivers/gpu/drm/omapdrm/dss/hdmi_pll.c | 10 +++++---- drivers/gpu/drm/omapdrm/dss/video-pll.c | 12 ++++++----- 8 files changed, 58 insertions(+), 33 deletions(-)drivers/gpu/drm/omapdrm/dss/dsi.c +5
-2@@ -5333,7 +5333,8 @@ static const struct dss_pll_hw dss_omap5_dsi_pll_hw = { .has_refsel = true, }; -static int dsi_init_pll_data (struct platform_device *dsidev) +static int dsi_init_pll_data (struct dss_device *dss, +struct platform_device *dsidev) {struct dsi_data *dsi =dsi_get_dsidrv_data (dsidev);struct dss_pll *pll = &dsi->pll;@@ -5352,6 +5353,7 @@ static int dsi_init_pll_data(struct platform_device *dsidev) pll->base = dsi->pll_base; pll->hw = dsi->data->pll_hw; pll->ops = &dsi_pll_ops; + pll->dss = dss; r =dss_pll_register (pll);if (r)@@ -5428,6 +5430,7 @@ static const struct soc_device_attribute dsi_soc_devices[] = {static int dsi_bind (struct device *dev,struct device *master,void *data) {struct platform_device *dsidev =to_platform_device (dev); +struct dss_device *dss =dss_get_device (master);const struct soc_device_attribute *soc;const struct dsi_module_id_data *d;u32 rev;@@ -5538,7 +5541,7 @@ static int dsi_bind(struct device *dev, struct device *master, void *data)if (r)return r; -dsi_init_pll_data (dsidev); +dsi_init_pll_data (dss, dsidev);pm_runtime_enable (&dsidev->dev);drivers/gpu/drm/omapdrm/dss/dss.c +23
-14@@ -93,7 +93,7 @@ struct dss_features {bool has_lcd_clk_src; }; -static struct { +struct dss_device {struct platform_device *pdev;struct omap_drm_private drm;@@ -125,7 +125,9 @@ static struct {struct dss_pll *video1_pll;struct dss_pll *video2_pll; -} dss; +}; + +static struct dss_device dss;static const char *const dss_generic_clk_source_names[] = { [DSS_CLK_SRC_FCK ] ="FCK" ,@@ -382,7 +384,7 @@ static void dss_dump_clocks(struct seq_file *s)const char *fclk_name;unsigned long fclk_rate; -if (dss_runtime_get ()) +if (dss_runtime_get (&dss))return ;seq_printf (s,"- DSS -\n" );@@ -394,7 +396,7 @@ static void dss_dump_clocks(struct seq_file *s) fclk_name, fclk_rate); - dss_runtime_put(); + dss_runtime_put(&dss); }#endif @@ -402,7 +404,7 @@ static int dss_dump_regs(struct seq_file *s, void *p) {#define DUMPREG (r) seq_printf(s, "%-35s %08x\n", #r, dss_read_reg(r)) -if (dss_runtime_get ()) +if (dss_runtime_get (&dss))return 0 ;DUMPREG (DSS_REVISION );@@ -416,7 +418,7 @@ static int dss_dump_regs(struct seq_file *s, void *p)DUMPREG (DSS_SDI_STATUS ); } -dss_runtime_put (); +dss_runtime_put (&dss);#undef DUMPREGreturn 0 ; }@@ -889,27 +891,32 @@ static void dss_put_clocks(void)clk_put (dss.parent_clk); } -int dss_runtime_get (void ) +int dss_runtime_get (struct dss_device *dss) {int r;DSSDBG ("dss_runtime_get\n" ); - r =pm_runtime_get_sync (&dss.pdev->dev); + r =pm_runtime_get_sync (&dss->pdev->dev);WARN_ON (r <0 );return r <0 ? r :0 ; } -void dss_runtime_put (void ) +void dss_runtime_put (struct dss_device *dss) {int r;DSSDBG ("dss_runtime_put\n" ); - r =pm_runtime_put_sync (&dss.pdev->dev); + r =pm_runtime_put_sync (&dss->pdev->dev);WARN_ON (r <0 && r != -ENOSYS && r != -EBUSY ); } +struct dss_device *dss_get_device (struct device *dev) +{ +return &dss; +} +/* DEBUGFS */ #if defined(CONFIG_OMAP2_DSS_DEBUGFS )static int dss_debug_dump_clocks (struct seq_file *s,void *p)@@ -1297,13 +1304,15 @@ static int dss_video_pll_probe(struct platform_device *pdev) }if (of_property_match_string (np,"reg-names" ,"pll1" ) >=0 ) { - dss.video1_pll =dss_video_pll_init (pdev,0 , pll_regulator); + dss.video1_pll =dss_video_pll_init (&dss, pdev,0 , + pll_regulator);if (IS_ERR (dss.video1_pll))return PTR_ERR (dss.video1_pll); }if (of_property_match_string (np,"reg-names" ,"pll2" ) >=0 ) { - dss.video2_pll =dss_video_pll_init (pdev,1 , pll_regulator); + dss.video2_pll =dss_video_pll_init (&dss, pdev,1 , + pll_regulator);if (IS_ERR (dss.video2_pll)) {dss_video_pll_uninit (dss.video1_pll);return PTR_ERR (dss.video2_pll);@@ -1361,7 +1370,7 @@ static int dss_bind(struct device *dev)pm_runtime_enable (&pdev->dev); - r =dss_runtime_get (); + r =dss_runtime_get (&dss);if (r) goto err_runtime_get;@@ -1386,7 +1395,7 @@ static int dss_bind(struct device *dev) rev =dss_read_reg (DSS_REVISION );pr_info ("OMAP DSS rev %d.%d\n" ,FLD_GET (rev,7 ,4 ),FLD_GET (rev,3 ,0 )); -dss_runtime_put (); +dss_runtime_put (&dss); r =component_bind_all (&pdev->dev,NULL );if (r)drivers/gpu/drm/omapdrm/dss/dss.h +9
-4@@ -29,6 +29,7 @@struct dentry ;struct dss_debugfs_entry ; +struct dss_device ;struct platform_device ;struct seq_file ;@@ -198,6 +199,7 @@ struct dss_pll_hw {struct dss_pll {const char *name;enum dss_pll_id id; +struct dss_device *dss;struct clk *clkin;struct regulator *regulator;@@ -277,8 +279,10 @@ static inline void dss_debugfs_remove_file(struct dss_debugfs_entry *entry)int dss_init_platform_driver (void )__init ;void dss_uninit_platform_driver (void ); -int dss_runtime_get (void ); -void dss_runtime_put (void ); +struct dss_device *dss_get_device (struct device *dev); + +int dss_runtime_get (struct dss_device *dss); +void dss_runtime_put (struct dss_device *dss);unsigned long dss_get_dispc_clk_rate (void );unsigned long dss_get_max_fck_rate (void );@@ -289,8 +293,9 @@ enum dss_hdmi_venc_clk_source_select dss_get_hdmi_venc_clk_source(void);const char *dss_get_clk_source_name (enum dss_clk_source clk_src);/* DSS VIDEO PLL */ -struct dss_pll *dss_video_pll_init (struct platform_device *pdev,int id, -struct regulator *regulator); +struct dss_pll *dss_video_pll_init (struct dss_device *dss, +struct platform_device *pdev,int id, +struct regulator *regulator);void dss_video_pll_uninit (struct dss_pll *pll);void dss_ctrl_pll_enable (enum dss_pll_id pll_id,bool enable);drivers/gpu/drm/omapdrm/dss/hdmi.h +4
-2@@ -29,6 +29,8 @@#include "omapdss.h" #include "dss.h" +struct dss_device ; +/* HDMI Wrapper */ #define HDMI_WP_REVISION 0x0@@ -324,8 +326,8 @@ phys_addr_t hdmi_wp_get_audio_dma_addr(struct hdmi_wp_data *wp);/* HDMI PLL funcs */ void hdmi_pll_dump (struct hdmi_pll_data *pll,struct seq_file *s); -int hdmi_pll_init (struct platform_device *pdev,struct hdmi_pll_data *pll, -struct hdmi_wp_data *wp); +int hdmi_pll_init (struct dss_device *dss,struct platform_device *pdev, +struct hdmi_pll_data *pll,struct hdmi_wp_data *wp);void hdmi_pll_uninit (struct hdmi_pll_data *hpll);/* HDMI PHY funcs */ drivers/gpu/drm/omapdrm/dss/hdmi4.c +2
-1@@ -717,6 +717,7 @@ static int hdmi_audio_register(struct device *dev)static int hdmi4_bind (struct device *dev,struct device *master,void *data) {struct platform_device *pdev =to_platform_device (dev); +struct dss_device *dss =dss_get_device (master);int r;int irq;@@ -734,7 +735,7 @@ static int hdmi4_bind(struct device *dev, struct device *master, void *data)if (r)return r; - r =hdmi_pll_init (pdev, &hdmi.pll, &hdmi.wp); + r =hdmi_pll_init (dss, pdev, &hdmi.pll, &hdmi.wp);if (r)return r;drivers/gpu/drm/omapdrm/dss/hdmi5.c +2
-1@@ -719,6 +719,7 @@ static int hdmi_audio_register(struct device *dev)static int hdmi5_bind (struct device *dev,struct device *master,void *data) {struct platform_device *pdev =to_platform_device (dev); +struct dss_device *dss =dss_get_device (master);int r;int irq;@@ -736,7 +737,7 @@ static int hdmi5_bind(struct device *dev, struct device *master, void *data)if (r)return r; - r =hdmi_pll_init (pdev, &hdmi.pll, &hdmi.wp); + r =hdmi_pll_init (dss, pdev, &hdmi.pll, &hdmi.wp);if (r)return r;drivers/gpu/drm/omapdrm/dss/hdmi_pll.c +6
-4@@ -128,7 +128,8 @@ static const struct dss_pll_hw dss_omap5_hdmi_pll_hw = { .has_refsel = true, }; -static int hdmi_init_pll_data (struct platform_device *pdev, +static int hdmi_init_pll_data (struct dss_device *dss, +struct platform_device *pdev,struct hdmi_pll_data *hpll) {struct dss_pll *pll = &hpll->pll;@@ -145,6 +146,7 @@ static int hdmi_init_pll_data(struct platform_device *pdev, pll->id =DSS_PLL_HDMI ; pll->base = hpll->base; pll->clkin = clk; + pll->dss = dss;if (hpll->wp->version ==4 ) pll->hw = &dss_omap4_hdmi_pll_hw;@@ -160,8 +162,8 @@ static int hdmi_init_pll_data(struct platform_device *pdev,return 0 ; } -int hdmi_pll_init (struct platform_device *pdev,struct hdmi_pll_data *pll, -struct hdmi_wp_data *wp) +int hdmi_pll_init (struct dss_device *dss,struct platform_device *pdev, +struct hdmi_pll_data *pll,struct hdmi_wp_data *wp) {int r;struct resource *res;@@ -174,7 +176,7 @@ int hdmi_pll_init(struct platform_device *pdev, struct hdmi_pll_data *pll,if (IS_ERR (pll->base))return PTR_ERR (pll->base); - r =hdmi_init_pll_data (pdev, pll); + r =hdmi_init_pll_data (dss, pdev, pll);if (r) {DSSERR ("failed to init HDMI PLL\n" );return r;drivers/gpu/drm/omapdrm/dss/video-pll.c +7
-5@@ -62,7 +62,7 @@ static int dss_video_pll_enable(struct dss_pll *pll) struct dss_video_pll *vpll = container_of(pll, struct dss_video_pll, pll);int r; - r =dss_runtime_get (); + r =dss_runtime_get (pll->dss);if (r)return r;@@ -81,7 +81,7 @@ static int dss_video_pll_enable(struct dss_pll *pll) err_reset:dss_dpll_disable_scp_clk (vpll);dss_ctrl_pll_enable (pll->id, false); -dss_runtime_put (); +dss_runtime_put (pll->dss);return r; }@@ -96,7 +96,7 @@ static void dss_video_pll_disable(struct dss_pll *pll)dss_ctrl_pll_enable (pll->id, false); -dss_runtime_put (); +dss_runtime_put (pll->dss); }static const struct dss_pll_ops dss_pll_ops = {@@ -134,8 +134,9 @@ static const struct dss_pll_hw dss_dra7_video_pll_hw = { .errata_i886 = true, }; -struct dss_pll *dss_video_pll_init (struct platform_device *pdev,int id, -struct regulator *regulator) +struct dss_pll *dss_video_pll_init (struct dss_device *dss, +struct platform_device *pdev,int id, +struct regulator *regulator) {const char *const reg_name[] = {"pll1" ,"pll2" };const char *const clkctrl_name[] = {"pll1_clkctrl" ,"pll2_clkctrl" };@@ -187,6 +188,7 @@ struct dss_pll *dss_video_pll_init(struct platform_device *pdev, int id, pll->base = pll_base; pll->hw = &dss_dra7_video_pll_hw; pll->ops = &dss_pll_ops; + pll->dss = dss; r =dss_pll_register (pll);if (r)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 23/48 drm: omapdrm: dss: Pass PLL pointer to dss_ctrl_pll_enable()
In reply to Laurent PinchartThis will allow accessing the PLL data to get the DSS device pointer, removing the need to access the global DSS private data.
--- drivers/gpu/drm/omapdrm/dss/dss.c | 13 +++++++------ drivers/gpu/drm/omapdrm/dss/dss.h | 2 +- drivers/gpu/drm/omapdrm/dss/hdmi_pll.c | 4 ++-- drivers/gpu/drm/omapdrm/dss/video-pll.c | 6 +++--- 4 files changed, 13 insertions(+), 12 deletions(-)
drivers/gpu/drm/omapdrm/dss/dss.c +7 -6
@@ -191,17 +191,17 @@ static void dss_restore_context(void)#undef SR#undef RR -void dss_ctrl_pll_enable (enum dss_pll_id pll_id,bool enable) +void dss_ctrl_pll_enable (struct dss_pll *pll,bool enable) {unsigned int shift;unsigned int val; -if (!dss.syscon_pll_ctrl) +if (!pll->dss->syscon_pll_ctrl)return ; val = !enable; -switch (pll_id) { +switch (pll->id) {case DSS_PLL_VIDEO1 : shift =0 ;break ;
@@ -212,12 +212,13 @@ void dss_ctrl_pll_enable(enum dss_pll_id pll_id, bool enable) shift =2 ;break ;default : -DSSERR ("illegal DSS PLL ID %d\n" , pll_id); +DSSERR ("illegal DSS PLL ID %d\n" , pll->id);return ; } -regmap_update_bits (dss.syscon_pll_ctrl, dss.syscon_pll_ctrl_offset, -1 << shift, val << shift); +regmap_update_bits (pll->dss->syscon_pll_ctrl, + pll->dss->syscon_pll_ctrl_offset, +1 << shift, val << shift); } static int dss_ctrl_pll_set_control_mux(enum dss_clk_source clk_src,
drivers/gpu/drm/omapdrm/dss/dss.h +1 -1
@@ -298,7 +298,7 @@ struct dss_pll *dss_video_pll_init(struct dss_device *dss, struct regulator *regulator);void dss_video_pll_uninit (struct dss_pll *pll); -void dss_ctrl_pll_enable (enum dss_pll_id pll_id,bool enable); +void dss_ctrl_pll_enable (struct dss_pll *pll,bool enable);void dss_sdi_init (int datapairs);int dss_sdi_enable (void );
drivers/gpu/drm/omapdrm/dss/hdmi_pll.c +2 -2
@@ -48,7 +48,7 @@ static int hdmi_pll_enable(struct dss_pll *dsspll) r =pm_runtime_get_sync (&pll->pdev->dev);WARN_ON (r <0 ); -dss_ctrl_pll_enable (DSS_PLL_HDMI , true); +dss_ctrl_pll_enable (dsspll, true); r =hdmi_wp_set_pll_pwr (wp,HDMI_PLLPWRCMD_BOTHON_ALLCLKS );if (r)
@@ -65,7 +65,7 @@ static void hdmi_pll_disable(struct dss_pll *dsspll)hdmi_wp_set_pll_pwr (wp,HDMI_PLLPWRCMD_ALLOFF ); -dss_ctrl_pll_enable (DSS_PLL_HDMI , false); +dss_ctrl_pll_enable (dsspll, false); r =pm_runtime_put_sync (&pll->pdev->dev);WARN_ON (r <0 && r != -ENOSYS );
drivers/gpu/drm/omapdrm/dss/video-pll.c +3 -3
@@ -66,7 +66,7 @@ static int dss_video_pll_enable(struct dss_pll *pll)if (r)return r; -dss_ctrl_pll_enable (pll->id, true); +dss_ctrl_pll_enable (pll, true);dss_dpll_enable_scp_clk (vpll);
@@ -80,7 +80,7 @@ static int dss_video_pll_enable(struct dss_pll *pll) err_reset:dss_dpll_disable_scp_clk (vpll); -dss_ctrl_pll_enable (pll->id, false); +dss_ctrl_pll_enable (pll, false);dss_runtime_put (pll->dss);return r;
@@ -94,7 +94,7 @@ static void dss_video_pll_disable(struct dss_pll *pll)dss_dpll_disable_scp_clk (vpll); -dss_ctrl_pll_enable (pll->id, false); +dss_ctrl_pll_enable (pll, false);dss_runtime_put (pll->dss); }
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 23/48] drm: omapdrm: dss: Pass PLL pointer to dss_ctrl_pll_enable()
Hi,
Quoted 5 lines · Laurent Pinchart
This will allow accessing the PLL data to get the DSS device pointer, removing the need to access the global DSS private data.
Signed-off-by Laurent Pinchart <[email protected]>---
-- Sebastian
Quoted 123 lines
drivers/gpu/drm/omapdrm/dss/dss.c | 13 +++++++------ drivers/gpu/drm/omapdrm/dss/dss.h | 2 +- drivers/gpu/drm/omapdrm/dss/hdmi_pll.c | 4 ++-- drivers/gpu/drm/omapdrm/dss/video-pll.c | 6 +++--- 4 files changed, 13 insertions(+), 12 deletions(-)drivers/gpu/drm/omapdrm/dss/dss.c +7
-6@@ -191,17 +191,17 @@ static void dss_restore_context(void)#undef SR#undef RR -void dss_ctrl_pll_enable (enum dss_pll_id pll_id,bool enable) +void dss_ctrl_pll_enable (struct dss_pll *pll,bool enable) {unsigned int shift;unsigned int val; -if (!dss.syscon_pll_ctrl) +if (!pll->dss->syscon_pll_ctrl)return ; val = !enable; -switch (pll_id) { +switch (pll->id) {case DSS_PLL_VIDEO1 : shift =0 ;break ;@@ -212,12 +212,13 @@ void dss_ctrl_pll_enable(enum dss_pll_id pll_id, bool enable) shift =2 ;break ;default : -DSSERR ("illegal DSS PLL ID %d\n" , pll_id); +DSSERR ("illegal DSS PLL ID %d\n" , pll->id);return ; } -regmap_update_bits (dss.syscon_pll_ctrl, dss.syscon_pll_ctrl_offset, -1 << shift, val << shift); +regmap_update_bits (pll->dss->syscon_pll_ctrl, + pll->dss->syscon_pll_ctrl_offset, +1 << shift, val << shift); } static int dss_ctrl_pll_set_control_mux(enum dss_clk_source clk_src,drivers/gpu/drm/omapdrm/dss/dss.h +1
-1@@ -298,7 +298,7 @@ struct dss_pll *dss_video_pll_init(struct dss_device *dss, struct regulator *regulator);void dss_video_pll_uninit (struct dss_pll *pll); -void dss_ctrl_pll_enable (enum dss_pll_id pll_id,bool enable); +void dss_ctrl_pll_enable (struct dss_pll *pll,bool enable);void dss_sdi_init (int datapairs);int dss_sdi_enable (void );drivers/gpu/drm/omapdrm/dss/hdmi_pll.c +2
-2@@ -48,7 +48,7 @@ static int hdmi_pll_enable(struct dss_pll *dsspll) r =pm_runtime_get_sync (&pll->pdev->dev);WARN_ON (r <0 ); -dss_ctrl_pll_enable (DSS_PLL_HDMI , true); +dss_ctrl_pll_enable (dsspll, true); r =hdmi_wp_set_pll_pwr (wp,HDMI_PLLPWRCMD_BOTHON_ALLCLKS );if (r)@@ -65,7 +65,7 @@ static void hdmi_pll_disable(struct dss_pll *dsspll)hdmi_wp_set_pll_pwr (wp,HDMI_PLLPWRCMD_ALLOFF ); -dss_ctrl_pll_enable (DSS_PLL_HDMI , false); +dss_ctrl_pll_enable (dsspll, false); r =pm_runtime_put_sync (&pll->pdev->dev);WARN_ON (r <0 && r != -ENOSYS );drivers/gpu/drm/omapdrm/dss/video-pll.c +3
-3@@ -66,7 +66,7 @@ static int dss_video_pll_enable(struct dss_pll *pll)if (r)return r; -dss_ctrl_pll_enable (pll->id, true); +dss_ctrl_pll_enable (pll, true);dss_dpll_enable_scp_clk (vpll);@@ -80,7 +80,7 @@ static int dss_video_pll_enable(struct dss_pll *pll) err_reset:dss_dpll_disable_scp_clk (vpll); -dss_ctrl_pll_enable (pll->id, false); +dss_ctrl_pll_enable (pll, false);dss_runtime_put (pll->dss);return r;@@ -94,7 +94,7 @@ static void dss_video_pll_disable(struct dss_pll *pll)dss_dpll_disable_scp_clk (vpll); -dss_ctrl_pll_enable (pll->id, false); +dss_ctrl_pll_enable (pll, false);dss_runtime_put (pll->dss); }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 24/48 drm: omapdrm: sdi: Pass DSS pointer to dss_sdi_*() functions
In reply to Laurent PinchartThis removes the need to access the global DSS private data in those functions (both for the current accesses and the future ones that will be introduced when allocating the DSS device dynamically).
--- drivers/gpu/drm/omapdrm/dss/dss.c | 8 ++++---- drivers/gpu/drm/omapdrm/dss/dss.h | 14 ++++++++------ drivers/gpu/drm/omapdrm/dss/sdi.c | 13 ++++++++----- 3 files changed, 20 insertions(+), 15 deletions(-)
drivers/gpu/drm/omapdrm/dss/dss.c +4 -4
@@ -287,7 +287,7 @@ static int dss_ctrl_pll_set_control_mux(enum dss_clk_source clk_src,return 0 ; } -void dss_sdi_init (int datapairs) +void dss_sdi_init (struct dss_device *dss,int datapairs) {u32 l;
@@ -306,7 +306,7 @@ void dss_sdi_init(int datapairs)dss_write_reg (DSS_PLL_CONTROL , l); } -int dss_sdi_enable (void ) +int dss_sdi_enable (struct dss_device *dss) {unsigned long timeout;
@@ -364,7 +364,7 @@ int dss_sdi_enable(void)return -ETIMEDOUT ; } -void dss_sdi_disable (void ) +void dss_sdi_disable (struct dss_device *dss) {dispc_lcd_enable_signal (0 );
@@ -1226,7 +1226,7 @@ static int dss_init_ports(struct platform_device *pdev)dpi_init_port (pdev, port, dss.feat->model);break ;case OMAP_DISPLAY_TYPE_SDI : -sdi_init_port (pdev, port); +sdi_init_port (&dss, pdev, port);break ;default :break ;
drivers/gpu/drm/omapdrm/dss/dss.h +8 -6
@@ -300,9 +300,9 @@ void dss_video_pll_uninit(struct dss_pll *pll);void dss_ctrl_pll_enable (struct dss_pll *pll,bool enable); -void dss_sdi_init (int datapairs); -int dss_sdi_enable (void ); -void dss_sdi_disable (void ); +void dss_sdi_init (struct dss_device *dss,int datapairs); +int dss_sdi_enable (struct dss_device *dss); +void dss_sdi_disable (struct dss_device *dss);void dss_select_dsi_clk_source (int dsi_module,enum dss_clk_source clk_src);
@@ -323,11 +323,13 @@ bool dss_div_calc(unsigned long pck, unsigned long fck_min,/* SDI */ #ifdef CONFIG_OMAP2_DSS_SDI -int sdi_init_port (struct platform_device *pdev,struct device_node *port); +int sdi_init_port (struct dss_device *dss,struct platform_device *pdev, +struct device_node *port);void sdi_uninit_port (struct device_node *port);#else -static inline int sdi_init_port (struct platform_device *pdev, -struct device_node *port) +static inline int sdi_init_port (struct dss_device *dss, +struct platform_device *pdev, +struct device_node *port) {return 0 ; }
drivers/gpu/drm/omapdrm/dss/sdi.c +8 -5
@@ -33,6 +33,7 @@ static struct { struct platform_device *pdev; + struct dss_device *dss; bool update_enabled; struct regulator *vdds_sdi_reg;
@@ -189,8 +190,8 @@ static int sdi_display_enable(struct omap_dss_device *dssdev)*/ dispc_mgr_set_clock_div (channel, &sdi.mgr_config.clock_info); -dss_sdi_init (sdi.datapairs); - r =dss_sdi_enable (); +dss_sdi_init (sdi.dss, sdi.datapairs); + r =dss_sdi_enable (sdi.dss);if (r) goto err_sdi_enable;mdelay (2 );
@@ -202,7 +203,7 @@ static int sdi_display_enable(struct omap_dss_device *dssdev)return 0 ; err_mgr_enable: -dss_sdi_disable (); +dss_sdi_disable (sdi.dss); err_sdi_enable: err_set_dss_clock_div: err_calc_clock_div:
@@ -219,7 +220,7 @@ static void sdi_display_disable(struct omap_dss_device *dssdev)dss_mgr_disable (channel); -dss_sdi_disable (); +dss_sdi_disable (sdi.dss);dispc_runtime_put ();
@@ -347,7 +348,8 @@ static void sdi_uninit_output(struct platform_device *pdev)omapdss_unregister_output (out); } -int sdi_init_port (struct platform_device *pdev,struct device_node *port) +int sdi_init_port (struct dss_device *dss,struct platform_device *pdev, +struct device_node *port) {struct device_node *ep;u32 datapairs;
@@ -364,6 +366,7 @@ int sdi_init_port(struct platform_device *pdev, struct device_node *port) } sdi.datapairs = datapairs; + sdi.dss = dss;of_node_put (ep);
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 24/48] drm: omapdrm: sdi: Pass DSS pointer to dss_sdi_*() functions
Hi Laurent,
Quoted 43 lines · Laurent Pinchart
This removes the need to access the global DSS private data in those functions (both for the current accesses and the future ones that will be introduced when allocating the DSS device dynamically).
Signed-off-by Laurent Pinchart <[email protected]>--- drivers/gpu/drm/omapdrm/dss/dss.c | 8 ++++---- drivers/gpu/drm/omapdrm/dss/dss.h | 14 ++++++++------ drivers/gpu/drm/omapdrm/dss/sdi.c | 13 ++++++++----- 3 files changed, 20 insertions(+), 15 deletions(-)drivers/gpu/drm/omapdrm/dss/dss.c +3
-3@@ -287,7 +287,7 @@ static int dss_ctrl_pll_set_control_mux(enum dss_clk_source clk_src,return 0 ; } -void dss_sdi_init (int datapairs) +void dss_sdi_init (struct dss_device *dss,int datapairs) {u32 l;@@ -306,7 +306,7 @@ void dss_sdi_init(int datapairs)dss_write_reg (DSS_PLL_CONTROL , l); } -int dss_sdi_enable (void ) +int dss_sdi_enable (struct dss_device *dss) {unsigned long timeout;@@ -364,7 +364,7 @@ int dss_sdi_enable(void)return -ETIMEDOUT ; } -void dss_sdi_disable (void ) +void dss_sdi_disable (struct dss_device *dss) {dispc_lcd_enable_signal (0 );
drivers/gpu/drm/omapdrm/dss/dss.c static int dss_init_ports(struct platform_device *pdev) · line 1229
Quoted 5 lines
drivers/gpu/drm/omapdrm/dss/dss.c +1
-1@@ -1226,7 +1226,7 @@ static int dss_init_ports(struct platform_device *pdev)dpi_init_port (pdev, port, dss.feat->model);break ;case OMAP_DISPLAY_TYPE_SDI : -sdi_init_port (pdev, port); +sdi_init_port (&dss, pdev, port);
I guess this should be 'dss' instead of '&dss'? Otherwise looks fine.
-- Sebastian
Quoted 105 lines
drivers/gpu/drm/omapdrm/dss/dss.c +0
-0break ;default :break ;drivers/gpu/drm/omapdrm/dss/dss.h +8
-6@@ -300,9 +300,9 @@ void dss_video_pll_uninit(struct dss_pll *pll);void dss_ctrl_pll_enable (struct dss_pll *pll,bool enable); -void dss_sdi_init (int datapairs); -int dss_sdi_enable (void ); -void dss_sdi_disable (void ); +void dss_sdi_init (struct dss_device *dss,int datapairs); +int dss_sdi_enable (struct dss_device *dss); +void dss_sdi_disable (struct dss_device *dss);void dss_select_dsi_clk_source (int dsi_module,enum dss_clk_source clk_src);@@ -323,11 +323,13 @@ bool dss_div_calc(unsigned long pck, unsigned long fck_min,/* SDI */ #ifdef CONFIG_OMAP2_DSS_SDI -int sdi_init_port (struct platform_device *pdev,struct device_node *port); +int sdi_init_port (struct dss_device *dss,struct platform_device *pdev, +struct device_node *port);void sdi_uninit_port (struct device_node *port);#else -static inline int sdi_init_port (struct platform_device *pdev, -struct device_node *port) +static inline int sdi_init_port (struct dss_device *dss, +struct platform_device *pdev, +struct device_node *port) {return 0 ; }drivers/gpu/drm/omapdrm/dss/sdi.c +8
-5@@ -33,6 +33,7 @@ static struct { struct platform_device *pdev; + struct dss_device *dss; bool update_enabled; struct regulator *vdds_sdi_reg;@@ -189,8 +190,8 @@ static int sdi_display_enable(struct omap_dss_device *dssdev)*/ dispc_mgr_set_clock_div (channel, &sdi.mgr_config.clock_info); -dss_sdi_init (sdi.datapairs); - r =dss_sdi_enable (); +dss_sdi_init (sdi.dss, sdi.datapairs); + r =dss_sdi_enable (sdi.dss);if (r) goto err_sdi_enable;mdelay (2 );@@ -202,7 +203,7 @@ static int sdi_display_enable(struct omap_dss_device *dssdev)return 0 ; err_mgr_enable: -dss_sdi_disable (); +dss_sdi_disable (sdi.dss); err_sdi_enable: err_set_dss_clock_div: err_calc_clock_div:@@ -219,7 +220,7 @@ static void sdi_display_disable(struct omap_dss_device *dssdev)dss_mgr_disable (channel); -dss_sdi_disable (); +dss_sdi_disable (sdi.dss);dispc_runtime_put ();@@ -347,7 +348,8 @@ static void sdi_uninit_output(struct platform_device *pdev)omapdss_unregister_output (out); } -int sdi_init_port (struct platform_device *pdev,struct device_node *port) +int sdi_init_port (struct dss_device *dss,struct platform_device *pdev, +struct device_node *port) {struct device_node *ep;u32 datapairs;@@ -364,6 +366,7 @@ int sdi_init_port(struct platform_device *pdev, struct device_node *port) } sdi.datapairs = datapairs; + sdi.dss = dss;of_node_put (ep);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
Sebastian Reichel
Reviewed-byRe: [PATCH 24/48] drm: omapdrm: sdi: Pass DSS pointer to dss_sdi_*() functions
Hi,
Quoted 45 lines · Sebastian Reichel
Hi Laurent,
Quoted 42 lines · Laurent Pinchart
This removes the need to access the global DSS private data in those functions (both for the current accesses and the future ones that will be introduced when allocating the DSS device dynamically).
Signed-off-by Laurent Pinchart <[email protected]>--- drivers/gpu/drm/omapdrm/dss/dss.c | 8 ++++---- drivers/gpu/drm/omapdrm/dss/dss.h | 14 ++++++++------ drivers/gpu/drm/omapdrm/dss/sdi.c | 13 ++++++++----- 3 files changed, 20 insertions(+), 15 deletions(-)drivers/gpu/drm/omapdrm/dss/dss.c +3
-3@@ -287,7 +287,7 @@ static int dss_ctrl_pll_set_control_mux(enum dss_clk_source clk_src,return 0 ; } -void dss_sdi_init (int datapairs) +void dss_sdi_init (struct dss_device *dss,int datapairs) {u32 l;@@ -306,7 +306,7 @@ void dss_sdi_init(int datapairs)dss_write_reg (DSS_PLL_CONTROL , l); } -int dss_sdi_enable (void ) +int dss_sdi_enable (struct dss_device *dss) {unsigned long timeout;@@ -364,7 +364,7 @@ int dss_sdi_enable(void)return -ETIMEDOUT ; } -void dss_sdi_disable (void ) +void dss_sdi_disable (struct dss_device *dss) {dispc_lcd_enable_signal (0 );
Quoted 9 lines
drivers/gpu/drm/omapdrm/dss/dss.c static int dss_init_ports(struct platform_device *pdev) · line 1229
Quoted 6 lines
drivers/gpu/drm/omapdrm/dss/dss.c +1
-1@@ -1226,7 +1226,7 @@ static int dss_init_ports(struct platform_device *pdev)dpi_init_port (pdev, port, dss.feat->model);break ;case OMAP_DISPLAY_TYPE_SDI : -sdi_init_port (pdev, port); +sdi_init_port (&dss, pdev, port);I guess this should be 'dss' instead of '&dss'? Otherwise looks fine.
Oops, read to fast, this is correct.
-- Sebastian
Quoted 103 lines
-- Sebastian
Quoted 101 lines
drivers/gpu/drm/omapdrm/dss/dss.c +0
-0break ;default :break ;drivers/gpu/drm/omapdrm/dss/dss.h +8
-6@@ -300,9 +300,9 @@ void dss_video_pll_uninit(struct dss_pll *pll);void dss_ctrl_pll_enable (struct dss_pll *pll,bool enable); -void dss_sdi_init (int datapairs); -int dss_sdi_enable (void ); -void dss_sdi_disable (void ); +void dss_sdi_init (struct dss_device *dss,int datapairs); +int dss_sdi_enable (struct dss_device *dss); +void dss_sdi_disable (struct dss_device *dss);void dss_select_dsi_clk_source (int dsi_module,enum dss_clk_source clk_src);@@ -323,11 +323,13 @@ bool dss_div_calc(unsigned long pck, unsigned long fck_min,/* SDI */ #ifdef CONFIG_OMAP2_DSS_SDI -int sdi_init_port (struct platform_device *pdev,struct device_node *port); +int sdi_init_port (struct dss_device *dss,struct platform_device *pdev, +struct device_node *port);void sdi_uninit_port (struct device_node *port);#else -static inline int sdi_init_port (struct platform_device *pdev, -struct device_node *port) +static inline int sdi_init_port (struct dss_device *dss, +struct platform_device *pdev, +struct device_node *port) {return 0 ; }drivers/gpu/drm/omapdrm/dss/sdi.c +8
-5@@ -33,6 +33,7 @@ static struct { struct platform_device *pdev; + struct dss_device *dss; bool update_enabled; struct regulator *vdds_sdi_reg;@@ -189,8 +190,8 @@ static int sdi_display_enable(struct omap_dss_device *dssdev)*/ dispc_mgr_set_clock_div (channel, &sdi.mgr_config.clock_info); -dss_sdi_init (sdi.datapairs); - r =dss_sdi_enable (); +dss_sdi_init (sdi.dss, sdi.datapairs); + r =dss_sdi_enable (sdi.dss);if (r) goto err_sdi_enable;mdelay (2 );@@ -202,7 +203,7 @@ static int sdi_display_enable(struct omap_dss_device *dssdev)return 0 ; err_mgr_enable: -dss_sdi_disable (); +dss_sdi_disable (sdi.dss); err_sdi_enable: err_set_dss_clock_div: err_calc_clock_div:@@ -219,7 +220,7 @@ static void sdi_display_disable(struct omap_dss_device *dssdev)dss_mgr_disable (channel); -dss_sdi_disable (); +dss_sdi_disable (sdi.dss);dispc_runtime_put ();@@ -347,7 +348,8 @@ static void sdi_uninit_output(struct platform_device *pdev)omapdss_unregister_output (out); } -int sdi_init_port (struct platform_device *pdev,struct device_node *port) +int sdi_init_port (struct dss_device *dss,struct platform_device *pdev, +struct device_node *port) {struct device_node *ep;u32 datapairs;@@ -364,6 +366,7 @@ int sdi_init_port(struct platform_device *pdev, struct device_node *port) } sdi.datapairs = datapairs; + sdi.dss = dss;of_node_put (ep);Signature · 3 lines
Regards, Laurent Pinchart
Quoted 11 lines
Quoted 4 lines
_______________________________________________
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
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 25/48 drm: omapdrm: dss: Pass DSS pointer to dss_ops operations
In reply to Laurent PinchartThis removes the need to access the global DSS private data in those functions (both for the current accesses and the future ones that will be introduced when allocating the DSS device dynamically).
--- drivers/gpu/drm/omapdrm/dss/dpi.c | 12 ++++--- drivers/gpu/drm/omapdrm/dss/dsi.c | 18 +++++----- drivers/gpu/drm/omapdrm/dss/dss.c | 68 ++++++++++++++++++++++--------------- drivers/gpu/drm/omapdrm/dss/dss.h | 25 ++++++++------ drivers/gpu/drm/omapdrm/dss/hdmi.h | 1 + drivers/gpu/drm/omapdrm/dss/hdmi4.c | 3 +- drivers/gpu/drm/omapdrm/dss/hdmi5.c | 3 +- 7 files changed, 77 insertions(+), 53 deletions(-)
drivers/gpu/drm/omapdrm/dss/dpi.c +7 -5
@@ -40,6 +40,7 @@struct dpi_data {struct platform_device *pdev;enum dss_model dss_model; +struct dss_device *dss;struct regulator *vdds_dsi_reg;enum dss_clk_source clk_src;
@@ -304,7 +305,7 @@ static int dpi_set_pll_clk(struct dpi_data *dpi, enum omap_channel channel,if (r)return r; -dss_select_lcd_clk_source (channel, dpi->clk_src); +dss_select_lcd_clk_source (dpi->dss, channel, dpi->clk_src); dpi->mgr_config.clock_info = ctx.dispc_cinfo;
@@ -414,7 +415,7 @@ static int dpi_display_enable(struct omap_dss_device *dssdev)if (r) goto err_get_dispc; - r =dss_dpi_select_source (out->port_num, channel); + r =dss_dpi_select_source (dpi->dss, out->port_num, channel);if (r) goto err_src_sel;
@@ -466,7 +467,7 @@ static void dpi_display_disable(struct omap_dss_device *dssdev)dss_mgr_disable (channel);if (dpi->pll) { -dss_select_lcd_clk_source (channel,DSS_CLK_SRC_FCK ); +dss_select_lcd_clk_source (dpi->dss, channel,DSS_CLK_SRC_FCK );dss_pll_disable (dpi->pll); }
@@ -750,8 +751,8 @@ static void dpi_uninit_output_port(struct device_node *port)omapdss_unregister_output (out); } -int dpi_init_port (struct platform_device *pdev,struct device_node *port, -enum dss_model dss_model) +int dpi_init_port (struct dss_device *dss,struct platform_device *pdev, +struct device_node *port,enum dss_model dss_model) {struct dpi_data *dpi;struct device_node *ep;
@@ -778,6 +779,7 @@ int dpi_init_port(struct platform_device *pdev, struct device_node *port, dpi->pdev = pdev; dpi->dss_model = dss_model; + dpi->dss = dss; port->data = dpi;mutex_init (&dpi->lock);
drivers/gpu/drm/omapdrm/dss/dsi.c +10 -8
@@ -345,6 +345,7 @@ struct dsi_data {struct clk *dss_clk;struct regmap *syscon; +struct dss_device *dss;struct dispc_clock_info user_dispc_cinfo;struct dss_pll_clock_info user_dsi_cinfo;
@@ -4217,7 +4218,7 @@ static int dsi_display_init_dispc(struct platform_device *dsidev,struct dsi_data *dsi =dsi_get_dsidrv_data (dsidev);int r; -dss_select_lcd_clk_source (channel, dsi->module_id ==0 ? +dss_select_lcd_clk_source (dsi->dss, channel, dsi->module_id ==0 ?DSS_CLK_SRC_PLL1_1 :DSS_CLK_SRC_PLL2_1 );
@@ -4271,7 +4272,7 @@ static int dsi_display_init_dispc(struct platform_device *dsidev,dss_mgr_unregister_framedone_handler (channel, dsi_framedone_irq_callback, dsidev); err: -dss_select_lcd_clk_source (channel,DSS_CLK_SRC_FCK ); +dss_select_lcd_clk_source (dsi->dss, channel,DSS_CLK_SRC_FCK );return r; }
@@ -4284,7 +4285,7 @@ static void dsi_display_uninit_dispc(struct platform_device *dsidev,dss_mgr_unregister_framedone_handler (channel, dsi_framedone_irq_callback, dsidev); -dss_select_lcd_clk_source (channel,DSS_CLK_SRC_FCK ); +dss_select_lcd_clk_source (dsi->dss, channel,DSS_CLK_SRC_FCK ); }static int dsi_configure_dsi_clocks (struct platform_device *dsidev)
@@ -4317,9 +4318,9 @@ static int dsi_display_init_dsi(struct platform_device *dsidev)if (r) goto err1; -dss_select_dsi_clk_source (dsi->module_id, dsi->module_id ==0 ? -DSS_CLK_SRC_PLL1_2 : -DSS_CLK_SRC_PLL2_2 ); +dss_select_dsi_clk_source (dsi->dss, dsi->module_id, + dsi->module_id ==0 ? +DSS_CLK_SRC_PLL1_2 :DSS_CLK_SRC_PLL2_2 );DSSDBG ("PLL OK\n" );
@@ -4351,7 +4352,7 @@ static int dsi_display_init_dsi(struct platform_device *dsidev) err3:dsi_cio_uninit (dsidev); err2: -dss_select_dsi_clk_source (dsi->module_id,DSS_CLK_SRC_FCK ); +dss_select_dsi_clk_source (dsi->dss, dsi->module_id,DSS_CLK_SRC_FCK ); err1:dss_pll_disable (&dsi->pll); err0:
@@ -4373,7 +4374,7 @@ static void dsi_display_uninit_dsi(struct platform_device *dsidev,dsi_vc_enable (dsidev,2 ,0 );dsi_vc_enable (dsidev,3 ,0 ); -dss_select_dsi_clk_source (dsi->module_id,DSS_CLK_SRC_FCK ); +dss_select_dsi_clk_source (dsi->dss, dsi->module_id,DSS_CLK_SRC_FCK );dsi_cio_uninit (dsidev);dsi_pll_uninit (dsidev, disconnect_lanes); }
@@ -5443,6 +5444,7 @@ static int dsi_bind(struct device *dev, struct device *master, void *data)if (!dsi)return -ENOMEM ; + dsi->dss = dss; dsi->pdev = dsidev;dev_set_drvdata (&dsidev->dev, dsi);
drivers/gpu/drm/omapdrm/dss/dss.c +40 -28
166 lines not on this page · raw message
drivers/gpu/drm/omapdrm/dss/dss.h +15 -10
@@ -287,8 +287,10 @@ void dss_runtime_put(struct dss_device *dss);unsigned long dss_get_dispc_clk_rate (void );unsigned long dss_get_max_fck_rate (void );enum omap_dss_output_id dss_get_supported_outputs (enum omap_channel channel); -int dss_dpi_select_source (int port,enum omap_channel channel); -void dss_select_hdmi_venc_clk_source (enum dss_hdmi_venc_clk_source_select ); +int dss_dpi_select_source (struct dss_device *dss,int port, +enum omap_channel channel); +void dss_select_hdmi_venc_clk_source (struct dss_device *dss, +enum dss_hdmi_venc_clk_source_select src);enum dss_hdmi_venc_clk_source_select dss_get_hdmi_venc_clk_source (void );const char *dss_get_clk_source_name (enum dss_clk_source clk_src);
@@ -304,10 +306,11 @@ void dss_sdi_init(struct dss_device *dss, int datapairs);int dss_sdi_enable (struct dss_device *dss);void dss_sdi_disable (struct dss_device *dss); -void dss_select_dsi_clk_source (int dsi_module, -enum dss_clk_source clk_src); -void dss_select_lcd_clk_source (enum omap_channel channel, -enum dss_clk_source clk_src); +void dss_select_dsi_clk_source (struct dss_device *dss,int dsi_module, +enum dss_clk_source clk_src); +void dss_select_lcd_clk_source (struct dss_device *dss, +enum omap_channel channel, +enum dss_clk_source clk_src);enum dss_clk_source dss_get_dispc_clk_source (void );enum dss_clk_source dss_get_dsi_clk_source (int dsi_module);enum dss_clk_source dss_get_lcd_clk_source (enum omap_channel channel);
@@ -353,12 +356,14 @@ void dsi_irq_handler(void);/* DPI */ #ifdef CONFIG_OMAP2_DSS_DPI -int dpi_init_port (struct platform_device *pdev,struct device_node *port, -enum dss_model dss_model); +int dpi_init_port (struct dss_device *dss,struct platform_device *pdev, +struct device_node *port,enum dss_model dss_model);void dpi_uninit_port (struct device_node *port);#else -static inline int dpi_init_port (struct platform_device *pdev, -struct device_node *port,enum dss_model dss_model) +static inline int dpi_init_port (struct dss_device *port, +struct platform_device *pdev, +struct device_node *port, +enum dss_model dss_model) {return 0 ; }
drivers/gpu/drm/omapdrm/dss/hdmi.h +1 -0
@@ -359,6 +359,7 @@ static inline bool hdmi_mode_has_audio(struct hdmi_config *cfg)struct omap_hdmi {struct mutex lock;struct platform_device *pdev; +struct dss_device *dss;struct dss_debugfs_entry *debugfs;
drivers/gpu/drm/omapdrm/dss/hdmi4.c +2 -1
@@ -147,7 +147,7 @@ static int hdmi_power_on_core(struct omap_dss_device *dssdev)hdmi4_core_powerdown_disable (&hdmi.core);/* Make selection of HDMI in DSS */ -dss_select_hdmi_venc_clk_source (DSS_HDMI_M_PCLK ); +dss_select_hdmi_venc_clk_source (hdmi.dss,DSS_HDMI_M_PCLK ); hdmi.core_enabled = true;
@@ -722,6 +722,7 @@ static int hdmi4_bind(struct device *dev, struct device *master, void *data)int irq; hdmi.pdev = pdev; + hdmi.dss = dss;dev_set_drvdata (&pdev->dev, &hdmi);mutex_init (&hdmi.lock);
drivers/gpu/drm/omapdrm/dss/hdmi5.c +2 -1
@@ -149,7 +149,7 @@ static int hdmi_power_on_core(struct omap_dss_device *dssdev) goto err_runtime_get;/* Make selection of HDMI in DSS */ -dss_select_hdmi_venc_clk_source (DSS_HDMI_M_PCLK ); +dss_select_hdmi_venc_clk_source (hdmi.dss,DSS_HDMI_M_PCLK ); hdmi.core_enabled = true;
@@ -724,6 +724,7 @@ static int hdmi5_bind(struct device *dev, struct device *master, void *data)int irq; hdmi.pdev = pdev; + hdmi.dss = dss;dev_set_drvdata (&pdev->dev, &hdmi);mutex_init (&hdmi.lock);
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 25/48] drm: omapdrm: dss: Pass DSS pointer to dss_ops operations
Hi,
Quoted 6 lines · Laurent Pinchart
This removes the need to access the global DSS private data in those functions (both for the current accesses and the future ones that will be introduced when allocating the DSS device dynamically).
Signed-off-by Laurent Pinchart <[email protected]>---
-- Sebastian
Quoted 443 lines
drivers/gpu/drm/omapdrm/dss/dpi.c | 12 ++++--- drivers/gpu/drm/omapdrm/dss/dsi.c | 18 +++++----- drivers/gpu/drm/omapdrm/dss/dss.c | 68 ++++++++++++++++++++++--------------- drivers/gpu/drm/omapdrm/dss/dss.h | 25 ++++++++------ drivers/gpu/drm/omapdrm/dss/hdmi.h | 1 + drivers/gpu/drm/omapdrm/dss/hdmi4.c | 3 +- drivers/gpu/drm/omapdrm/dss/hdmi5.c | 3 +- 7 files changed, 77 insertions(+), 53 deletions(-)drivers/gpu/drm/omapdrm/dss/dpi.c +7
-5@@ -40,6 +40,7 @@struct dpi_data {struct platform_device *pdev;enum dss_model dss_model; +struct dss_device *dss;struct regulator *vdds_dsi_reg;enum dss_clk_source clk_src;@@ -304,7 +305,7 @@ static int dpi_set_pll_clk(struct dpi_data *dpi, enum omap_channel channel,if (r)return r; -dss_select_lcd_clk_source (channel, dpi->clk_src); +dss_select_lcd_clk_source (dpi->dss, channel, dpi->clk_src); dpi->mgr_config.clock_info = ctx.dispc_cinfo;@@ -414,7 +415,7 @@ static int dpi_display_enable(struct omap_dss_device *dssdev)if (r) goto err_get_dispc; - r =dss_dpi_select_source (out->port_num, channel); + r =dss_dpi_select_source (dpi->dss, out->port_num, channel);if (r) goto err_src_sel;@@ -466,7 +467,7 @@ static void dpi_display_disable(struct omap_dss_device *dssdev)dss_mgr_disable (channel);if (dpi->pll) { -dss_select_lcd_clk_source (channel,DSS_CLK_SRC_FCK ); +dss_select_lcd_clk_source (dpi->dss, channel,DSS_CLK_SRC_FCK );dss_pll_disable (dpi->pll); }@@ -750,8 +751,8 @@ static void dpi_uninit_output_port(struct device_node *port)omapdss_unregister_output (out); } -int dpi_init_port (struct platform_device *pdev,struct device_node *port, -enum dss_model dss_model) +int dpi_init_port (struct dss_device *dss,struct platform_device *pdev, +struct device_node *port,enum dss_model dss_model) {struct dpi_data *dpi;struct device_node *ep;@@ -778,6 +779,7 @@ int dpi_init_port(struct platform_device *pdev, struct device_node *port, dpi->pdev = pdev; dpi->dss_model = dss_model; + dpi->dss = dss; port->data = dpi;mutex_init (&dpi->lock);drivers/gpu/drm/omapdrm/dss/dsi.c +10
-8@@ -345,6 +345,7 @@ struct dsi_data {struct clk *dss_clk;struct regmap *syscon; +struct dss_device *dss;struct dispc_clock_info user_dispc_cinfo;struct dss_pll_clock_info user_dsi_cinfo;@@ -4217,7 +4218,7 @@ static int dsi_display_init_dispc(struct platform_device *dsidev,struct dsi_data *dsi =dsi_get_dsidrv_data (dsidev);int r; -dss_select_lcd_clk_source (channel, dsi->module_id ==0 ? +dss_select_lcd_clk_source (dsi->dss, channel, dsi->module_id ==0 ?DSS_CLK_SRC_PLL1_1 :DSS_CLK_SRC_PLL2_1 );@@ -4271,7 +4272,7 @@ static int dsi_display_init_dispc(struct platform_device *dsidev,dss_mgr_unregister_framedone_handler (channel, dsi_framedone_irq_callback, dsidev); err: -dss_select_lcd_clk_source (channel,DSS_CLK_SRC_FCK ); +dss_select_lcd_clk_source (dsi->dss, channel,DSS_CLK_SRC_FCK );return r; }@@ -4284,7 +4285,7 @@ static void dsi_display_uninit_dispc(struct platform_device *dsidev,dss_mgr_unregister_framedone_handler (channel, dsi_framedone_irq_callback, dsidev); -dss_select_lcd_clk_source (channel,DSS_CLK_SRC_FCK ); +dss_select_lcd_clk_source (dsi->dss, channel,DSS_CLK_SRC_FCK ); }static int dsi_configure_dsi_clocks (struct platform_device *dsidev)@@ -4317,9 +4318,9 @@ static int dsi_display_init_dsi(struct platform_device *dsidev)if (r) goto err1; -dss_select_dsi_clk_source (dsi->module_id, dsi->module_id ==0 ? -DSS_CLK_SRC_PLL1_2 : -DSS_CLK_SRC_PLL2_2 ); +dss_select_dsi_clk_source (dsi->dss, dsi->module_id, + dsi->module_id ==0 ? +DSS_CLK_SRC_PLL1_2 :DSS_CLK_SRC_PLL2_2 );DSSDBG ("PLL OK\n" );@@ -4351,7 +4352,7 @@ static int dsi_display_init_dsi(struct platform_device *dsidev) err3:dsi_cio_uninit (dsidev); err2: -dss_select_dsi_clk_source (dsi->module_id,DSS_CLK_SRC_FCK ); +dss_select_dsi_clk_source (dsi->dss, dsi->module_id,DSS_CLK_SRC_FCK ); err1:dss_pll_disable (&dsi->pll); err0:@@ -4373,7 +4374,7 @@ static void dsi_display_uninit_dsi(struct platform_device *dsidev,dsi_vc_enable (dsidev,2 ,0 );dsi_vc_enable (dsidev,3 ,0 ); -dss_select_dsi_clk_source (dsi->module_id,DSS_CLK_SRC_FCK ); +dss_select_dsi_clk_source (dsi->dss, dsi->module_id,DSS_CLK_SRC_FCK );dsi_cio_uninit (dsidev);dsi_pll_uninit (dsidev, disconnect_lanes); }@@ -5443,6 +5444,7 @@ static int dsi_bind(struct device *dev, struct device *master, void *data)if (!dsi)return -ENOMEM ; + dsi->dss = dss; dsi->pdev = dsidev;dev_set_drvdata (&dsidev->dev, dsi);drivers/gpu/drm/omapdrm/dss/dss.c +40
-28@@ -74,9 +74,11 @@ struct dss_reg { dss_write_reg(idx, FLD_MOD(dss_read_reg(idx), val, start, end))struct dss_ops { -int (*dpi_select_source)(int port,enum omap_channel channel); -int (*select_lcd_source)(enum omap_channel channel, -enum dss_clk_source clk_src); +int (*dpi_select_source)(struct dss_device *dss,int port, +enum omap_channel channel); +int (*select_lcd_source)(struct dss_device *dss, +enum omap_channel channel, +enum dss_clk_source clk_src); };struct dss_features {@@ -472,8 +474,8 @@ static void dss_select_dispc_clk_source(enum dss_clk_source clk_src) dss.dispc_clk_source = clk_src; } -void dss_select_dsi_clk_source (int dsi_module, -enum dss_clk_source clk_src) +void dss_select_dsi_clk_source (struct dss_device *dss,int dsi_module, +enum dss_clk_source clk_src) {int b, pos;@@ -497,11 +499,12 @@ void dss_select_dsi_clk_source(int dsi_module, pos = dsi_module ==0 ?1 :10 ;REG_FLD_MOD (DSS_CONTROL , b, pos, pos);/* DSIx_CLK_SWITCH */ - dss.dsi_clk_source[dsi_module] = clk_src; + dss->dsi_clk_source[dsi_module] = clk_src; } -static int dss_lcd_clk_mux_dra7 (enum omap_channel channel, -enum dss_clk_source clk_src) +static int dss_lcd_clk_mux_dra7 (struct dss_device *dss, +enum omap_channel channel, +enum dss_clk_source clk_src) {const u8 ctrl_bits[] = { [OMAP_DSS_CHANNEL_LCD ] =0 ,@@ -527,8 +530,9 @@ static int dss_lcd_clk_mux_dra7(enum omap_channel channel,return 0 ; } -static int dss_lcd_clk_mux_omap5 (enum omap_channel channel, -enum dss_clk_source clk_src) +static int dss_lcd_clk_mux_omap5 (struct dss_device *dss, +enum omap_channel channel, +enum dss_clk_source clk_src) {const u8 ctrl_bits[] = { [OMAP_DSS_CHANNEL_LCD ] =0 ,@@ -557,8 +561,9 @@ static int dss_lcd_clk_mux_omap5(enum omap_channel channel,return 0 ; } -static int dss_lcd_clk_mux_omap4 (enum omap_channel channel, -enum dss_clk_source clk_src) +static int dss_lcd_clk_mux_omap4 (struct dss_device *dss, +enum omap_channel channel, +enum dss_clk_source clk_src) {const u8 ctrl_bits[] = { [OMAP_DSS_CHANNEL_LCD ] =0 ,@@ -585,23 +590,24 @@ static int dss_lcd_clk_mux_omap4(enum omap_channel channel,return 0 ; } -void dss_select_lcd_clk_source (enum omap_channel channel, -enum dss_clk_source clk_src) +void dss_select_lcd_clk_source (struct dss_device *dss, +enum omap_channel channel, +enum dss_clk_source clk_src) {int idx =dss_get_channel_index (channel);int r; -if (!dss.feat->has_lcd_clk_src) { +if (!dss->feat->has_lcd_clk_src) {dss_select_dispc_clk_source (clk_src); - dss.lcd_clk_source[idx] = clk_src; + dss->lcd_clk_source[idx] = clk_src;return ; } - r = dss.feat->ops->select_lcd_source (channel, clk_src); + r = dss->feat->ops->select_lcd_source (dss, channel, clk_src);if (r)return ; - dss.lcd_clk_source[idx] = clk_src; + dss->lcd_clk_source[idx] = clk_src; }enum dss_clk_source dss_get_dispc_clk_source (void )@@ -750,11 +756,12 @@ void dss_set_dac_pwrdn_bgz(bool enable)REG_FLD_MOD (DSS_CONTROL , enable,5 ,5 );/* DAC Power-Down Control */ } -void dss_select_hdmi_venc_clk_source (enum dss_hdmi_venc_clk_source_select src) +void dss_select_hdmi_venc_clk_source (struct dss_device *dss, +enum dss_hdmi_venc_clk_source_select src) {enum omap_dss_output_id outputs; - outputs = dss.feat->outputs[OMAP_DSS_CHANNEL_DIGIT ]; + outputs = dss->feat->outputs[OMAP_DSS_CHANNEL_DIGIT ];/* Complain about invalid selections */ WARN_ON ((src ==DSS_VENC_TV_CLK ) && !(outputs &OMAP_DSS_OUTPUT_VENC ));@@ -780,7 +787,8 @@ enum dss_hdmi_venc_clk_source_select dss_get_hdmi_venc_clk_source(void)return REG_GET (DSS_CONTROL ,15 ,15 ); } -static int dss_dpi_select_source_omap2_omap3 (int port,enum omap_channel channel) +static int dss_dpi_select_source_omap2_omap3 (struct dss_device *dss,int port, +enum omap_channel channel) {if (channel !=OMAP_DSS_CHANNEL_LCD )return -EINVAL ;@@ -788,7 +796,8 @@ static int dss_dpi_select_source_omap2_omap3(int port, enum omap_channel channelreturn 0 ; } -static int dss_dpi_select_source_omap4 (int port,enum omap_channel channel) +static int dss_dpi_select_source_omap4 (struct dss_device *dss,int port, +enum omap_channel channel) {int val;@@ -808,7 +817,8 @@ static int dss_dpi_select_source_omap4(int port, enum omap_channel channel)return 0 ; } -static int dss_dpi_select_source_omap5 (int port,enum omap_channel channel) +static int dss_dpi_select_source_omap5 (struct dss_device *dss,int port, +enum omap_channel channel) {int val;@@ -834,11 +844,12 @@ static int dss_dpi_select_source_omap5(int port, enum omap_channel channel)return 0 ; } -static int dss_dpi_select_source_dra7xx (int port,enum omap_channel channel) +static int dss_dpi_select_source_dra7xx (struct dss_device *dss,int port, +enum omap_channel channel) {switch (port) {case 0 : -return dss_dpi_select_source_omap5 (port, channel); +return dss_dpi_select_source_omap5 (dss, port, channel);case 1 :if (channel !=OMAP_DSS_CHANNEL_LCD2 )return -EINVAL ;@@ -854,9 +865,10 @@ static int dss_dpi_select_source_dra7xx(int port, enum omap_channel channel)return 0 ; } -int dss_dpi_select_source (int port,enum omap_channel channel) +int dss_dpi_select_source (struct dss_device *dss,int port, +enum omap_channel channel) { -return dss.feat->ops->dpi_select_source (port, channel); +return dss->feat->ops->dpi_select_source (dss, port, channel); }static int dss_get_clocks (void )@@ -1223,7 +1235,7 @@ static int dss_init_ports(struct platform_device *pdev)switch (dss.feat->ports[i]) {case OMAP_DISPLAY_TYPE_DPI : -dpi_init_port (pdev, port, dss.feat->model); +dpi_init_port (&dss, pdev, port, dss.feat->model);break ;case OMAP_DISPLAY_TYPE_SDI :sdi_init_port (&dss, pdev, port);drivers/gpu/drm/omapdrm/dss/dss.h +15
-10@@ -287,8 +287,10 @@ void dss_runtime_put(struct dss_device *dss);unsigned long dss_get_dispc_clk_rate (void );unsigned long dss_get_max_fck_rate (void );enum omap_dss_output_id dss_get_supported_outputs (enum omap_channel channel); -int dss_dpi_select_source (int port,enum omap_channel channel); -void dss_select_hdmi_venc_clk_source (enum dss_hdmi_venc_clk_source_select ); +int dss_dpi_select_source (struct dss_device *dss,int port, +enum omap_channel channel); +void dss_select_hdmi_venc_clk_source (struct dss_device *dss, +enum dss_hdmi_venc_clk_source_select src);enum dss_hdmi_venc_clk_source_select dss_get_hdmi_venc_clk_source (void );const char *dss_get_clk_source_name (enum dss_clk_source clk_src);@@ -304,10 +306,11 @@ void dss_sdi_init(struct dss_device *dss, int datapairs);int dss_sdi_enable (struct dss_device *dss);void dss_sdi_disable (struct dss_device *dss); -void dss_select_dsi_clk_source (int dsi_module, -enum dss_clk_source clk_src); -void dss_select_lcd_clk_source (enum omap_channel channel, -enum dss_clk_source clk_src); +void dss_select_dsi_clk_source (struct dss_device *dss,int dsi_module, +enum dss_clk_source clk_src); +void dss_select_lcd_clk_source (struct dss_device *dss, +enum omap_channel channel, +enum dss_clk_source clk_src);enum dss_clk_source dss_get_dispc_clk_source (void );enum dss_clk_source dss_get_dsi_clk_source (int dsi_module);enum dss_clk_source dss_get_lcd_clk_source (enum omap_channel channel);@@ -353,12 +356,14 @@ void dsi_irq_handler(void);/* DPI */ #ifdef CONFIG_OMAP2_DSS_DPI -int dpi_init_port (struct platform_device *pdev,struct device_node *port, -enum dss_model dss_model); +int dpi_init_port (struct dss_device *dss,struct platform_device *pdev, +struct device_node *port,enum dss_model dss_model);void dpi_uninit_port (struct device_node *port);#else -static inline int dpi_init_port (struct platform_device *pdev, -struct device_node *port,enum dss_model dss_model) +static inline int dpi_init_port (struct dss_device *port, +struct platform_device *pdev, +struct device_node *port, +enum dss_model dss_model) {return 0 ; }drivers/gpu/drm/omapdrm/dss/hdmi.h +1
-0@@ -359,6 +359,7 @@ static inline bool hdmi_mode_has_audio(struct hdmi_config *cfg)struct omap_hdmi {struct mutex lock;struct platform_device *pdev; +struct dss_device *dss;struct dss_debugfs_entry *debugfs;drivers/gpu/drm/omapdrm/dss/hdmi4.c +2
-1@@ -147,7 +147,7 @@ static int hdmi_power_on_core(struct omap_dss_device *dssdev)hdmi4_core_powerdown_disable (&hdmi.core);/* Make selection of HDMI in DSS */ -dss_select_hdmi_venc_clk_source (DSS_HDMI_M_PCLK ); +dss_select_hdmi_venc_clk_source (hdmi.dss,DSS_HDMI_M_PCLK ); hdmi.core_enabled = true;@@ -722,6 +722,7 @@ static int hdmi4_bind(struct device *dev, struct device *master, void *data)int irq; hdmi.pdev = pdev; + hdmi.dss = dss;dev_set_drvdata (&pdev->dev, &hdmi);mutex_init (&hdmi.lock);drivers/gpu/drm/omapdrm/dss/hdmi5.c +2
-1@@ -149,7 +149,7 @@ static int hdmi_power_on_core(struct omap_dss_device *dssdev) goto err_runtime_get;/* Make selection of HDMI in DSS */ -dss_select_hdmi_venc_clk_source (DSS_HDMI_M_PCLK ); +dss_select_hdmi_venc_clk_source (hdmi.dss,DSS_HDMI_M_PCLK ); hdmi.core_enabled = true;@@ -724,6 +724,7 @@ static int hdmi5_bind(struct device *dev, struct device *master, void *data)int irq; hdmi.pdev = pdev; + hdmi.dss = dss;dev_set_drvdata (&pdev->dev, &hdmi);mutex_init (&hdmi.lock);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 26/48 drm: omapdrm: dss: Pass DSS pointer to dss_get_*_clk_source()
In reply to Laurent PinchartThis removes the need to access the global DSS private data in those functions (both for the current accesses and the future ones that will be introduced when allocating the DSS device dynamically).
--- drivers/gpu/drm/omapdrm/dss/dispc.c | 11 +++++++---- drivers/gpu/drm/omapdrm/dss/dsi.c | 8 +++++--- drivers/gpu/drm/omapdrm/dss/dss.c | 18 ++++++++++-------- drivers/gpu/drm/omapdrm/dss/dss.h | 8 +++++--- 4 files changed, 27 insertions(+), 18 deletions(-)
drivers/gpu/drm/omapdrm/dss/dispc.c +7 -4
@@ -167,6 +167,7 @@ struct dispc_features { static struct { struct platform_device *pdev; void __iomem *base; + struct dss_device *dss; struct dss_debugfs_entry *debugfs;
@@ -3116,7 +3117,7 @@ static unsigned long dispc_fclk_rate(void)unsigned long r;enum dss_clk_source src; - src =dss_get_dispc_clk_source (); + src =dss_get_dispc_clk_source (dispc.dss);if (src ==DSS_CLK_SRC_FCK ) { r =dss_get_dispc_clk_rate ();
@@ -3143,7 +3144,7 @@ static unsigned long dispc_mgr_lclk_rate(enum omap_channel channel)if (!dss_mgr_is_lcd (channel))return dispc_fclk_rate (); - src =dss_get_lcd_clk_source (channel); + src =dss_get_lcd_clk_source (dispc.dss, channel);if (src ==DSS_CLK_SRC_FCK ) { r =dss_get_dispc_clk_rate ();
@@ -3223,7 +3224,7 @@ static void dispc_dump_clocks_channel(struct seq_file *s, enum omap_channel chanseq_printf (s,"- %s -\n" , mgr_desc[channel].name); - lcd_clk_src =dss_get_lcd_clk_source (channel); + lcd_clk_src =dss_get_lcd_clk_source (dispc.dss, channel);seq_printf (s,"%s clk source = %s\n" , mgr_desc[channel].name,dss_get_clk_source_name (lcd_clk_src));
@@ -3240,7 +3241,7 @@ void dispc_dump_clocks(struct seq_file *s) {int lcd;u32 l; -enum dss_clk_source dispc_clk_src =dss_get_dispc_clk_source (); +enum dss_clk_source dispc_clk_src =dss_get_dispc_clk_source (dispc.dss);if (dispc_runtime_get ())return ;
@@ -4542,12 +4543,14 @@ static int dispc_bind(struct device *dev, struct device *master, void *data) {struct platform_device *pdev =to_platform_device (dev);const struct soc_device_attribute *soc; +struct dss_device *dss =dss_get_device (master);u32 rev;int r =0 ;struct resource *dispc_mem;struct device_node *np = pdev->dev.of_node; dispc.pdev = pdev; + dispc.dss = dss;spin_lock_init (&dispc.control_lock);
drivers/gpu/drm/omapdrm/dss/dsi.c +5 -3
@@ -1292,8 +1292,10 @@ static unsigned long dsi_fclk_rate(struct platform_device *dsidev) {unsigned long r;struct dsi_data *dsi =dsi_get_dsidrv_data (dsidev); +enum dss_clk_source source; -if (dss_get_dsi_clk_source (dsi->module_id) ==DSS_CLK_SRC_FCK ) { + source =dss_get_dsi_clk_source (dsi->dss, dsi->module_id); +if (source ==DSS_CLK_SRC_FCK ) {/* DSI FCLK source is DSS_CLK_FCK */ r =clk_get_rate (dsi->dss_clk); }else {
@@ -1512,8 +1514,8 @@ static void dsi_dump_dsidev_clocks(struct platform_device *dsidev,int dsi_module = dsi->module_id;struct dss_pll *pll = &dsi->pll; - dispc_clk_src =dss_get_dispc_clk_source (); - dsi_clk_src =dss_get_dsi_clk_source (dsi_module); + dispc_clk_src =dss_get_dispc_clk_source (dsi->dss); + dsi_clk_src =dss_get_dsi_clk_source (dsi->dss, dsi_module);if (dsi_runtime_get (dsidev))return ;
drivers/gpu/drm/omapdrm/dss/dss.c +10 -8
@@ -610,25 +610,27 @@ void dss_select_lcd_clk_source(struct dss_device *dss, dss->lcd_clk_source[idx] = clk_src; } -enum dss_clk_source dss_get_dispc_clk_source (void ) +enum dss_clk_source dss_get_dispc_clk_source (struct dss_device *dss) { -return dss.dispc_clk_source; +return dss->dispc_clk_source; } -enum dss_clk_source dss_get_dsi_clk_source (int dsi_module) +enum dss_clk_source dss_get_dsi_clk_source (struct dss_device *dss, +int dsi_module) { -return dss.dsi_clk_source[dsi_module]; +return dss->dsi_clk_source[dsi_module]; } -enum dss_clk_source dss_get_lcd_clk_source (enum omap_channel channel) +enum dss_clk_source dss_get_lcd_clk_source (struct dss_device *dss, +enum omap_channel channel) { -if (dss.feat->has_lcd_clk_src) { +if (dss->feat->has_lcd_clk_src) {int idx =dss_get_channel_index (channel); -return dss.lcd_clk_source[idx]; +return dss->lcd_clk_source[idx]; }else {/* LCD_CLK source is the same as DISPC_FCLK source for * OMAP2 and OMAP3 */ -return dss.dispc_clk_source; +return dss->dispc_clk_source; } }
drivers/gpu/drm/omapdrm/dss/dss.h +5 -3
@@ -311,9 +311,11 @@ void dss_select_dsi_clk_source(struct dss_device *dss, int dsi_module,void dss_select_lcd_clk_source (struct dss_device *dss,enum omap_channel channel,enum dss_clk_source clk_src); -enum dss_clk_source dss_get_dispc_clk_source (void ); -enum dss_clk_source dss_get_dsi_clk_source (int dsi_module); -enum dss_clk_source dss_get_lcd_clk_source (enum omap_channel channel); +enum dss_clk_source dss_get_dispc_clk_source (struct dss_device *dss); +enum dss_clk_source dss_get_dsi_clk_source (struct dss_device *dss, +int dsi_module); +enum dss_clk_source dss_get_lcd_clk_source (struct dss_device *dss, +enum omap_channel channel);void dss_set_venc_output (enum omap_dss_venc_type type);void dss_set_dac_pwrdn_bgz (bool enable);
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 26/48] drm: omapdrm: dss: Pass DSS pointer to dss_get_*_clk_source()
Hi,
Quoted 6 lines · Laurent Pinchart
This removes the need to access the global DSS private data in those functions (both for the current accesses and the future ones that will be introduced when allocating the DSS device dynamically).
Signed-off-by Laurent Pinchart <[email protected]>---
-- Sebastian
Quoted 164 lines
drivers/gpu/drm/omapdrm/dss/dispc.c | 11 +++++++---- drivers/gpu/drm/omapdrm/dss/dsi.c | 8 +++++--- drivers/gpu/drm/omapdrm/dss/dss.c | 18 ++++++++++-------- drivers/gpu/drm/omapdrm/dss/dss.h | 8 +++++--- 4 files changed, 27 insertions(+), 18 deletions(-)drivers/gpu/drm/omapdrm/dss/dispc.c +7
-4@@ -167,6 +167,7 @@ struct dispc_features { static struct { struct platform_device *pdev; void __iomem *base; + struct dss_device *dss; struct dss_debugfs_entry *debugfs;@@ -3116,7 +3117,7 @@ static unsigned long dispc_fclk_rate(void)unsigned long r;enum dss_clk_source src; - src =dss_get_dispc_clk_source (); + src =dss_get_dispc_clk_source (dispc.dss);if (src ==DSS_CLK_SRC_FCK ) { r =dss_get_dispc_clk_rate ();@@ -3143,7 +3144,7 @@ static unsigned long dispc_mgr_lclk_rate(enum omap_channel channel)if (!dss_mgr_is_lcd (channel))return dispc_fclk_rate (); - src =dss_get_lcd_clk_source (channel); + src =dss_get_lcd_clk_source (dispc.dss, channel);if (src ==DSS_CLK_SRC_FCK ) { r =dss_get_dispc_clk_rate ();@@ -3223,7 +3224,7 @@ static void dispc_dump_clocks_channel(struct seq_file *s, enum omap_channel chanseq_printf (s,"- %s -\n" , mgr_desc[channel].name); - lcd_clk_src =dss_get_lcd_clk_source (channel); + lcd_clk_src =dss_get_lcd_clk_source (dispc.dss, channel);seq_printf (s,"%s clk source = %s\n" , mgr_desc[channel].name,dss_get_clk_source_name (lcd_clk_src));@@ -3240,7 +3241,7 @@ void dispc_dump_clocks(struct seq_file *s) {int lcd;u32 l; -enum dss_clk_source dispc_clk_src =dss_get_dispc_clk_source (); +enum dss_clk_source dispc_clk_src =dss_get_dispc_clk_source (dispc.dss);if (dispc_runtime_get ())return ;@@ -4542,12 +4543,14 @@ static int dispc_bind(struct device *dev, struct device *master, void *data) {struct platform_device *pdev =to_platform_device (dev);const struct soc_device_attribute *soc; +struct dss_device *dss =dss_get_device (master);u32 rev;int r =0 ;struct resource *dispc_mem;struct device_node *np = pdev->dev.of_node; dispc.pdev = pdev; + dispc.dss = dss;spin_lock_init (&dispc.control_lock);drivers/gpu/drm/omapdrm/dss/dsi.c +5
-3@@ -1292,8 +1292,10 @@ static unsigned long dsi_fclk_rate(struct platform_device *dsidev) {unsigned long r;struct dsi_data *dsi =dsi_get_dsidrv_data (dsidev); +enum dss_clk_source source; -if (dss_get_dsi_clk_source (dsi->module_id) ==DSS_CLK_SRC_FCK ) { + source =dss_get_dsi_clk_source (dsi->dss, dsi->module_id); +if (source ==DSS_CLK_SRC_FCK ) {/* DSI FCLK source is DSS_CLK_FCK */ r =clk_get_rate (dsi->dss_clk); }else {@@ -1512,8 +1514,8 @@ static void dsi_dump_dsidev_clocks(struct platform_device *dsidev,int dsi_module = dsi->module_id;struct dss_pll *pll = &dsi->pll; - dispc_clk_src =dss_get_dispc_clk_source (); - dsi_clk_src =dss_get_dsi_clk_source (dsi_module); + dispc_clk_src =dss_get_dispc_clk_source (dsi->dss); + dsi_clk_src =dss_get_dsi_clk_source (dsi->dss, dsi_module);if (dsi_runtime_get (dsidev))return ;drivers/gpu/drm/omapdrm/dss/dss.c +10
-8@@ -610,25 +610,27 @@ void dss_select_lcd_clk_source(struct dss_device *dss, dss->lcd_clk_source[idx] = clk_src; } -enum dss_clk_source dss_get_dispc_clk_source (void ) +enum dss_clk_source dss_get_dispc_clk_source (struct dss_device *dss) { -return dss.dispc_clk_source; +return dss->dispc_clk_source; } -enum dss_clk_source dss_get_dsi_clk_source (int dsi_module) +enum dss_clk_source dss_get_dsi_clk_source (struct dss_device *dss, +int dsi_module) { -return dss.dsi_clk_source[dsi_module]; +return dss->dsi_clk_source[dsi_module]; } -enum dss_clk_source dss_get_lcd_clk_source (enum omap_channel channel) +enum dss_clk_source dss_get_lcd_clk_source (struct dss_device *dss, +enum omap_channel channel) { -if (dss.feat->has_lcd_clk_src) { +if (dss->feat->has_lcd_clk_src) {int idx =dss_get_channel_index (channel); -return dss.lcd_clk_source[idx]; +return dss->lcd_clk_source[idx]; }else {/* LCD_CLK source is the same as DISPC_FCLK source for * OMAP2 and OMAP3 */ -return dss.dispc_clk_source; +return dss->dispc_clk_source; } }drivers/gpu/drm/omapdrm/dss/dss.h +5
-3@@ -311,9 +311,11 @@ void dss_select_dsi_clk_source(struct dss_device *dss, int dsi_module,void dss_select_lcd_clk_source (struct dss_device *dss,enum omap_channel channel,enum dss_clk_source clk_src); -enum dss_clk_source dss_get_dispc_clk_source (void ); -enum dss_clk_source dss_get_dsi_clk_source (int dsi_module); -enum dss_clk_source dss_get_lcd_clk_source (enum omap_channel channel); +enum dss_clk_source dss_get_dispc_clk_source (struct dss_device *dss); +enum dss_clk_source dss_get_dsi_clk_source (struct dss_device *dss, +int dsi_module); +enum dss_clk_source dss_get_lcd_clk_source (struct dss_device *dss, +enum omap_channel channel);void dss_set_venc_output (enum omap_dss_venc_type type);void dss_set_dac_pwrdn_bgz (bool enable);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 27/48 drm: omapdrm: dss: Pass DSS pointer to dss clock functions
In reply to Laurent PinchartThis removes the need to access the global DSS private data in those functions (both for the current accesses and the future ones that will be introduced when allocating the DSS device dynamically).
--- drivers/gpu/drm/omapdrm/dss/dispc.c | 8 ++++---- drivers/gpu/drm/omapdrm/dss/dpi.c | 14 ++++++++------ drivers/gpu/drm/omapdrm/dss/dss.c | 37 ++++++++++++++++++------------------- drivers/gpu/drm/omapdrm/dss/dss.h | 10 +++++----- drivers/gpu/drm/omapdrm/dss/sdi.c | 5 +++-- 5 files changed, 38 insertions(+), 36 deletions(-)
drivers/gpu/drm/omapdrm/dss/dispc.c +4 -4
@@ -3120,7 +3120,7 @@ static unsigned long dispc_fclk_rate(void) src =dss_get_dispc_clk_source (dispc.dss);if (src ==DSS_CLK_SRC_FCK ) { - r =dss_get_dispc_clk_rate (); + r =dss_get_dispc_clk_rate (dispc.dss); }else {struct dss_pll *pll;unsigned int clkout_idx;
@@ -3147,7 +3147,7 @@ static unsigned long dispc_mgr_lclk_rate(enum omap_channel channel) src =dss_get_lcd_clk_source (dispc.dss, channel);if (src ==DSS_CLK_SRC_FCK ) { - r =dss_get_dispc_clk_rate (); + r =dss_get_dispc_clk_rate (dispc.dss); }else {struct dss_pll *pll;unsigned int clkout_idx;
@@ -3505,7 +3505,7 @@ bool dispc_div_calc(unsigned long dispc_freq, pckd_hw_min = dispc.feat->min_pcd; pckd_hw_max =255 ; - lck_max =dss_get_max_fck_rate (); + lck_max =dss_get_max_fck_rate (dispc.dss); pck_min = pck_min ? pck_min :1 ; pck_max = pck_max ? pck_max :ULONG_MAX ;
@@ -4455,7 +4455,7 @@ static void dispc_errata_i734_wa(void)/* Set up and enable display manager for LCD1 */ dispc_mgr_setup (OMAP_DSS_CHANNEL_LCD , &i734.mgri); -dispc_calc_clock_rates (dss_get_dispc_clk_rate (), +dispc_calc_clock_rates (dss_get_dispc_clk_rate (dispc.dss), &lcd_conf.clock_info);dispc_mgr_set_lcd_config (OMAP_DSS_CHANNEL_LCD , &lcd_conf);dispc_mgr_set_timings (OMAP_DSS_CHANNEL_LCD , &i734.vm);
drivers/gpu/drm/omapdrm/dss/dpi.c +8 -6
@@ -209,7 +209,7 @@ static bool dpi_calc_pll_cb(int n, int m, unsigned long fint, ctx->pll_cinfo.clkdco = clkdco;return dss_pll_hsdiv_calc_a (ctx->pll, clkdco, - ctx->pck_min,dss_get_max_fck_rate (), + ctx->pck_min,dss_get_max_fck_rate (ctx->pll->dss), dpi_calc_hsdiv_cb, ctx); }
@@ -258,7 +258,8 @@ static bool dpi_pll_clk_calc(struct dpi_data *dpi, unsigned long pck, } } -static bool dpi_dss_clk_calc (unsigned long pck,struct dpi_clk_calc_ctx *ctx) +static bool dpi_dss_clk_calc (struct dpi_data *dpi,unsigned long pck, +struct dpi_clk_calc_ctx *ctx) {int i;
@@ -279,7 +280,8 @@ static bool dpi_dss_clk_calc(unsigned long pck, struct dpi_clk_calc_ctx *ctx) ctx->pck_min =0 ; ctx->pck_max = pck +1000 * i * i * i; - ok =dss_div_calc (pck, ctx->pck_min, dpi_calc_dss_cb, ctx); + ok =dss_div_calc (dpi->dss, pck, ctx->pck_min, + dpi_calc_dss_cb, ctx);if (ok)return ok; }
@@ -323,11 +325,11 @@ static int dpi_set_dispc_clk(struct dpi_data *dpi, unsigned long pck_req,int r;bool ok; - ok =dpi_dss_clk_calc (pck_req, &ctx); + ok =dpi_dss_clk_calc (dpi, pck_req, &ctx);if (!ok)return -EINVAL ; - r =dss_set_fck_rate (ctx.fck); + r =dss_set_fck_rate (dpi->dss, ctx.fck);if (r)return r;
@@ -532,7 +534,7 @@ static int dpi_check_timings(struct omap_dss_device *dssdev, fck = ctx.pll_cinfo.clkout[ctx.clkout_idx]; }else { - ok =dpi_dss_clk_calc (vm->pixelclock, &ctx); + ok =dpi_dss_clk_calc (dpi, vm->pixelclock, &ctx);if (!ok)return -EINVAL ;
drivers/gpu/drm/omapdrm/dss/dss.c +18 -19
@@ -634,8 +634,8 @@ enum dss_clk_source dss_get_lcd_clk_source(struct dss_device *dss, } } -bool dss_div_calc (unsigned long pck,unsigned long fck_min, -dss_div_calc_func func,void *data) +bool dss_div_calc (struct dss_device *dss,unsigned long pck, +unsigned long fck_min,dss_div_calc_func func,void *data) {int fckd, fckd_start, fckd_stop;unsigned long fck;
@@ -644,24 +644,24 @@ bool dss_div_calc(unsigned long pck, unsigned long fck_min,unsigned long prate;unsigned int m; - fck_hw_max = dss.feat->fck_freq_max; + fck_hw_max = dss->feat->fck_freq_max; -if (dss.parent_clk ==NULL ) { +if (dss->parent_clk ==NULL ) {unsigned int pckd; pckd = fck_hw_max / pck; fck = pck * pckd; - fck =clk_round_rate (dss.dss_clk, fck); + fck =clk_round_rate (dss->dss_clk, fck);return func (fck, data); } - fckd_hw_max = dss.feat->fck_div_max; + fckd_hw_max = dss->feat->fck_div_max; - m = dss.feat->dss_fck_multiplier; - prate =clk_get_rate (dss.parent_clk); + m = dss->feat->dss_fck_multiplier; + prate =clk_get_rate (dss->parent_clk); fck_min = fck_min ? fck_min :1 ;
@@ -678,33 +678,32 @@ bool dss_div_calc(unsigned long pck, unsigned long fck_min,return false; } -int dss_set_fck_rate (unsigned long rate) +int dss_set_fck_rate (struct dss_device *dss,unsigned long rate) {int r;DSSDBG ("set fck to %lu\n" , rate); - r =clk_set_rate (dss.dss_clk, rate); + r =clk_set_rate (dss->dss_clk, rate);if (r)return r; - dss.dss_clk_rate =clk_get_rate (dss.dss_clk); + dss->dss_clk_rate =clk_get_rate (dss->dss_clk); -WARN_ONCE (dss.dss_clk_rate != rate, -"clk rate mismatch: %lu != %lu" , dss.dss_clk_rate, - rate); +WARN_ONCE (dss->dss_clk_rate != rate,"clk rate mismatch: %lu != %lu" , + dss->dss_clk_rate, rate);return 0 ; } -unsigned long dss_get_dispc_clk_rate (void ) +unsigned long dss_get_dispc_clk_rate (struct dss_device *dss) { -return dss.dss_clk_rate; +return dss->dss_clk_rate; } -unsigned long dss_get_max_fck_rate (void ) +unsigned long dss_get_max_fck_rate (struct dss_device *dss) { -return dss.feat->fck_freq_max; +return dss->feat->fck_freq_max; }enum omap_dss_output_id dss_get_supported_outputs (enum omap_channel channel)
@@ -731,7 +730,7 @@ static int dss_setup_default_clock(void) fck =DIV_ROUND_UP (prate, fck_div) * dss.feat->dss_fck_multiplier; } - r =dss_set_fck_rate (fck); + r =dss_set_fck_rate (&dss, fck);if (r)return r;
drivers/gpu/drm/omapdrm/dss/dss.h +5 -5
@@ -284,8 +284,8 @@ struct dss_device *dss_get_device(struct device *dev);int dss_runtime_get (struct dss_device *dss);void dss_runtime_put (struct dss_device *dss); -unsigned long dss_get_dispc_clk_rate (void ); -unsigned long dss_get_max_fck_rate (void ); +unsigned long dss_get_dispc_clk_rate (struct dss_device *dss); +unsigned long dss_get_max_fck_rate (struct dss_device *dss);enum omap_dss_output_id dss_get_supported_outputs (enum omap_channel channel);int dss_dpi_select_source (struct dss_device *dss,int port,enum omap_channel channel);
@@ -320,11 +320,11 @@ enum dss_clk_source dss_get_lcd_clk_source(struct dss_device *dss,void dss_set_venc_output (enum omap_dss_venc_type type);void dss_set_dac_pwrdn_bgz (bool enable); -int dss_set_fck_rate (unsigned long rate); +int dss_set_fck_rate (struct dss_device *dss,unsigned long rate);typedef bool (*dss_div_calc_func )(unsigned long fck,void *data); -bool dss_div_calc (unsigned long pck,unsigned long fck_min, -dss_div_calc_func func,void *data); +bool dss_div_calc (struct dss_device *dss,unsigned long pck, +unsigned long fck_min,dss_div_calc_func func,void *data);/* SDI */ #ifdef CONFIG_OMAP2_DSS_SDI
drivers/gpu/drm/omapdrm/dss/sdi.c +3 -2
@@ -101,7 +101,8 @@ static int sdi_calc_clock_div(unsigned long pclk, ctx.pck_min =0 ; ctx.pck_max = pclk +1000 * i * i * i; - ok =dss_div_calc (pclk, ctx.pck_min, dpi_calc_dss_cb, &ctx); + ok =dss_div_calc (sdi.dss, pclk, ctx.pck_min, + dpi_calc_dss_cb, &ctx);if (ok) { *fck = ctx.fck; *dispc_cinfo = ctx.dispc_cinfo;
@@ -171,7 +172,7 @@ static int sdi_display_enable(struct omap_dss_device *dssdev)dss_mgr_set_timings (channel, vm); - r =dss_set_fck_rate (fck); + r =dss_set_fck_rate (sdi.dss, fck);if (r) goto err_set_dss_clock_div;
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 27/48] drm: omapdrm: dss: Pass DSS pointer to dss clock functions
Hi,
Quoted 6 lines · Laurent Pinchart
This removes the need to access the global DSS private data in those functions (both for the current accesses and the future ones that will be introduced when allocating the DSS device dynamically).
Signed-off-by Laurent Pinchart <[email protected]>---
-- Sebastian
Quoted 263 lines
drivers/gpu/drm/omapdrm/dss/dispc.c | 8 ++++---- drivers/gpu/drm/omapdrm/dss/dpi.c | 14 ++++++++------ drivers/gpu/drm/omapdrm/dss/dss.c | 37 ++++++++++++++++++------------------- drivers/gpu/drm/omapdrm/dss/dss.h | 10 +++++----- drivers/gpu/drm/omapdrm/dss/sdi.c | 5 +++-- 5 files changed, 38 insertions(+), 36 deletions(-)drivers/gpu/drm/omapdrm/dss/dispc.c +4
-4@@ -3120,7 +3120,7 @@ static unsigned long dispc_fclk_rate(void) src =dss_get_dispc_clk_source (dispc.dss);if (src ==DSS_CLK_SRC_FCK ) { - r =dss_get_dispc_clk_rate (); + r =dss_get_dispc_clk_rate (dispc.dss); }else {struct dss_pll *pll;unsigned int clkout_idx;@@ -3147,7 +3147,7 @@ static unsigned long dispc_mgr_lclk_rate(enum omap_channel channel) src =dss_get_lcd_clk_source (dispc.dss, channel);if (src ==DSS_CLK_SRC_FCK ) { - r =dss_get_dispc_clk_rate (); + r =dss_get_dispc_clk_rate (dispc.dss); }else {struct dss_pll *pll;unsigned int clkout_idx;@@ -3505,7 +3505,7 @@ bool dispc_div_calc(unsigned long dispc_freq, pckd_hw_min = dispc.feat->min_pcd; pckd_hw_max =255 ; - lck_max =dss_get_max_fck_rate (); + lck_max =dss_get_max_fck_rate (dispc.dss); pck_min = pck_min ? pck_min :1 ; pck_max = pck_max ? pck_max :ULONG_MAX ;@@ -4455,7 +4455,7 @@ static void dispc_errata_i734_wa(void)/* Set up and enable display manager for LCD1 */ dispc_mgr_setup (OMAP_DSS_CHANNEL_LCD , &i734.mgri); -dispc_calc_clock_rates (dss_get_dispc_clk_rate (), +dispc_calc_clock_rates (dss_get_dispc_clk_rate (dispc.dss), &lcd_conf.clock_info);dispc_mgr_set_lcd_config (OMAP_DSS_CHANNEL_LCD , &lcd_conf);dispc_mgr_set_timings (OMAP_DSS_CHANNEL_LCD , &i734.vm);drivers/gpu/drm/omapdrm/dss/dpi.c +8
-6@@ -209,7 +209,7 @@ static bool dpi_calc_pll_cb(int n, int m, unsigned long fint, ctx->pll_cinfo.clkdco = clkdco;return dss_pll_hsdiv_calc_a (ctx->pll, clkdco, - ctx->pck_min,dss_get_max_fck_rate (), + ctx->pck_min,dss_get_max_fck_rate (ctx->pll->dss), dpi_calc_hsdiv_cb, ctx); }@@ -258,7 +258,8 @@ static bool dpi_pll_clk_calc(struct dpi_data *dpi, unsigned long pck, } } -static bool dpi_dss_clk_calc (unsigned long pck,struct dpi_clk_calc_ctx *ctx) +static bool dpi_dss_clk_calc (struct dpi_data *dpi,unsigned long pck, +struct dpi_clk_calc_ctx *ctx) {int i;@@ -279,7 +280,8 @@ static bool dpi_dss_clk_calc(unsigned long pck, struct dpi_clk_calc_ctx *ctx) ctx->pck_min =0 ; ctx->pck_max = pck +1000 * i * i * i; - ok =dss_div_calc (pck, ctx->pck_min, dpi_calc_dss_cb, ctx); + ok =dss_div_calc (dpi->dss, pck, ctx->pck_min, + dpi_calc_dss_cb, ctx);if (ok)return ok; }@@ -323,11 +325,11 @@ static int dpi_set_dispc_clk(struct dpi_data *dpi, unsigned long pck_req,int r;bool ok; - ok =dpi_dss_clk_calc (pck_req, &ctx); + ok =dpi_dss_clk_calc (dpi, pck_req, &ctx);if (!ok)return -EINVAL ; - r =dss_set_fck_rate (ctx.fck); + r =dss_set_fck_rate (dpi->dss, ctx.fck);if (r)return r;@@ -532,7 +534,7 @@ static int dpi_check_timings(struct omap_dss_device *dssdev, fck = ctx.pll_cinfo.clkout[ctx.clkout_idx]; }else { - ok =dpi_dss_clk_calc (vm->pixelclock, &ctx); + ok =dpi_dss_clk_calc (dpi, vm->pixelclock, &ctx);if (!ok)return -EINVAL ;drivers/gpu/drm/omapdrm/dss/dss.c +18
-19@@ -634,8 +634,8 @@ enum dss_clk_source dss_get_lcd_clk_source(struct dss_device *dss, } } -bool dss_div_calc (unsigned long pck,unsigned long fck_min, -dss_div_calc_func func,void *data) +bool dss_div_calc (struct dss_device *dss,unsigned long pck, +unsigned long fck_min,dss_div_calc_func func,void *data) {int fckd, fckd_start, fckd_stop;unsigned long fck;@@ -644,24 +644,24 @@ bool dss_div_calc(unsigned long pck, unsigned long fck_min,unsigned long prate;unsigned int m; - fck_hw_max = dss.feat->fck_freq_max; + fck_hw_max = dss->feat->fck_freq_max; -if (dss.parent_clk ==NULL ) { +if (dss->parent_clk ==NULL ) {unsigned int pckd; pckd = fck_hw_max / pck; fck = pck * pckd; - fck =clk_round_rate (dss.dss_clk, fck); + fck =clk_round_rate (dss->dss_clk, fck);return func (fck, data); } - fckd_hw_max = dss.feat->fck_div_max; + fckd_hw_max = dss->feat->fck_div_max; - m = dss.feat->dss_fck_multiplier; - prate =clk_get_rate (dss.parent_clk); + m = dss->feat->dss_fck_multiplier; + prate =clk_get_rate (dss->parent_clk); fck_min = fck_min ? fck_min :1 ;@@ -678,33 +678,32 @@ bool dss_div_calc(unsigned long pck, unsigned long fck_min,return false; } -int dss_set_fck_rate (unsigned long rate) +int dss_set_fck_rate (struct dss_device *dss,unsigned long rate) {int r;DSSDBG ("set fck to %lu\n" , rate); - r =clk_set_rate (dss.dss_clk, rate); + r =clk_set_rate (dss->dss_clk, rate);if (r)return r; - dss.dss_clk_rate =clk_get_rate (dss.dss_clk); + dss->dss_clk_rate =clk_get_rate (dss->dss_clk); -WARN_ONCE (dss.dss_clk_rate != rate, -"clk rate mismatch: %lu != %lu" , dss.dss_clk_rate, - rate); +WARN_ONCE (dss->dss_clk_rate != rate,"clk rate mismatch: %lu != %lu" , + dss->dss_clk_rate, rate);return 0 ; } -unsigned long dss_get_dispc_clk_rate (void ) +unsigned long dss_get_dispc_clk_rate (struct dss_device *dss) { -return dss.dss_clk_rate; +return dss->dss_clk_rate; } -unsigned long dss_get_max_fck_rate (void ) +unsigned long dss_get_max_fck_rate (struct dss_device *dss) { -return dss.feat->fck_freq_max; +return dss->feat->fck_freq_max; }enum omap_dss_output_id dss_get_supported_outputs (enum omap_channel channel)@@ -731,7 +730,7 @@ static int dss_setup_default_clock(void) fck =DIV_ROUND_UP (prate, fck_div) * dss.feat->dss_fck_multiplier; } - r =dss_set_fck_rate (fck); + r =dss_set_fck_rate (&dss, fck);if (r)return r;drivers/gpu/drm/omapdrm/dss/dss.h +5
-5@@ -284,8 +284,8 @@ struct dss_device *dss_get_device(struct device *dev);int dss_runtime_get (struct dss_device *dss);void dss_runtime_put (struct dss_device *dss); -unsigned long dss_get_dispc_clk_rate (void ); -unsigned long dss_get_max_fck_rate (void ); +unsigned long dss_get_dispc_clk_rate (struct dss_device *dss); +unsigned long dss_get_max_fck_rate (struct dss_device *dss);enum omap_dss_output_id dss_get_supported_outputs (enum omap_channel channel);int dss_dpi_select_source (struct dss_device *dss,int port,enum omap_channel channel);@@ -320,11 +320,11 @@ enum dss_clk_source dss_get_lcd_clk_source(struct dss_device *dss,void dss_set_venc_output (enum omap_dss_venc_type type);void dss_set_dac_pwrdn_bgz (bool enable); -int dss_set_fck_rate (unsigned long rate); +int dss_set_fck_rate (struct dss_device *dss,unsigned long rate);typedef bool (*dss_div_calc_func )(unsigned long fck,void *data); -bool dss_div_calc (unsigned long pck,unsigned long fck_min, -dss_div_calc_func func,void *data); +bool dss_div_calc (struct dss_device *dss,unsigned long pck, +unsigned long fck_min,dss_div_calc_func func,void *data);/* SDI */ #ifdef CONFIG_OMAP2_DSS_SDI drivers/gpu/drm/omapdrm/dss/sdi.c +3
-2@@ -101,7 +101,8 @@ static int sdi_calc_clock_div(unsigned long pclk, ctx.pck_min =0 ; ctx.pck_max = pclk +1000 * i * i * i; - ok =dss_div_calc (pclk, ctx.pck_min, dpi_calc_dss_cb, &ctx); + ok =dss_div_calc (sdi.dss, pclk, ctx.pck_min, + dpi_calc_dss_cb, &ctx);if (ok) { *fck = ctx.fck; *dispc_cinfo = ctx.dispc_cinfo;@@ -171,7 +172,7 @@ static int sdi_display_enable(struct omap_dss_device *dssdev)dss_mgr_set_timings (channel, vm); - r =dss_set_fck_rate (fck); + r =dss_set_fck_rate (sdi.dss, fck);if (r) goto err_set_dss_clock_div;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 28/48 drm: omapdrm: dss: Pass DSS pointer to remaining dss functions
In reply to Laurent PinchartThis removes the need to access the global DSS private data in those functions (both for the current accesses and the future ones that will be introduced when allocating the DSS device dynamically).
--- drivers/gpu/drm/omapdrm/dss/dispc.c | 2 +- drivers/gpu/drm/omapdrm/dss/dss.c | 9 +++++---- drivers/gpu/drm/omapdrm/dss/dss.h | 7 ++++--- drivers/gpu/drm/omapdrm/dss/venc.c | 11 +++++++---- 4 files changed, 17 insertions(+), 12 deletions(-)
drivers/gpu/drm/omapdrm/dss/dispc.c +1 -1
@@ -2737,7 +2737,7 @@ static int dispc_ovl_enable(enum omap_plane_id plane, bool enable)static enum omap_dss_output_id dispc_mgr_get_supported_outputs (enum omap_channel channel) { -return dss_get_supported_outputs (channel); +return dss_get_supported_outputs (dispc.dss, channel); }static void dispc_lcd_enable_signal_polarity (bool act_high)
drivers/gpu/drm/omapdrm/dss/dss.c +5 -4
@@ -706,9 +706,10 @@ unsigned long dss_get_max_fck_rate(struct dss_device *dss)return dss->feat->fck_freq_max; } -enum omap_dss_output_id dss_get_supported_outputs (enum omap_channel channel) +enum omap_dss_output_id dss_get_supported_outputs (struct dss_device *dss, +enum omap_channel channel) { -return dss.feat->outputs[channel]; +return dss->feat->outputs[channel]; }static int dss_setup_default_clock (void )
@@ -737,7 +738,7 @@ static int dss_setup_default_clock(void)return 0 ; } -void dss_set_venc_output (enum omap_dss_venc_type type) +void dss_set_venc_output (struct dss_device *dss,enum omap_dss_venc_type type) {int l =0 ;
@@ -752,7 +753,7 @@ void dss_set_venc_output(enum omap_dss_venc_type type)REG_FLD_MOD (DSS_CONTROL , l,6 ,6 ); } -void dss_set_dac_pwrdn_bgz (bool enable) +void dss_set_dac_pwrdn_bgz (struct dss_device *dss,bool enable) {REG_FLD_MOD (DSS_CONTROL , enable,5 ,5 );/* DAC Power-Down Control */ }
drivers/gpu/drm/omapdrm/dss/dss.h +4 -3
@@ -286,7 +286,8 @@ void dss_runtime_put(struct dss_device *dss);unsigned long dss_get_dispc_clk_rate (struct dss_device *dss);unsigned long dss_get_max_fck_rate (struct dss_device *dss); -enum omap_dss_output_id dss_get_supported_outputs (enum omap_channel channel); +enum omap_dss_output_id dss_get_supported_outputs (struct dss_device *dss, +enum omap_channel channel);int dss_dpi_select_source (struct dss_device *dss,int port,enum omap_channel channel); void dss_select_hdmi_venc_clk_source(struct dss_device *dss,
@@ -317,8 +318,8 @@ enum dss_clk_source dss_get_dsi_clk_source(struct dss_device *dss,enum dss_clk_source dss_get_lcd_clk_source (struct dss_device *dss,enum omap_channel channel); -void dss_set_venc_output (enum omap_dss_venc_type type); -void dss_set_dac_pwrdn_bgz (bool enable); +void dss_set_venc_output (struct dss_device *dss,enum omap_dss_venc_type type); +void dss_set_dac_pwrdn_bgz (struct dss_device *dss,bool enable);int dss_set_fck_rate (struct dss_device *dss,unsigned long rate);
drivers/gpu/drm/omapdrm/dss/venc.c +7 -4
@@ -327,6 +327,7 @@ static struct {struct mutex venc_lock;u32 wss_data;struct regulator *vdda_dac_reg; +struct dss_device *dss;struct dss_debugfs_entry *debugfs;
@@ -472,8 +473,8 @@ static int venc_power_on(struct omap_dss_device *dssdev)venc_reset ();venc_write_config (venc_timings_to_config (&venc.vm)); -dss_set_venc_output (venc.type); -dss_set_dac_pwrdn_bgz (1 ); +dss_set_venc_output (venc.dss, venc.type); +dss_set_dac_pwrdn_bgz (venc.dss,1 ); l =0 ;
@@ -503,7 +504,7 @@ static int venc_power_on(struct omap_dss_device *dssdev)regulator_disable (venc.vdda_dac_reg); err1:venc_write_reg (VENC_OUTPUT_CONTROL ,0 ); -dss_set_dac_pwrdn_bgz (0 ); +dss_set_dac_pwrdn_bgz (venc.dss,0 );venc_runtime_put (); err0:
@@ -515,7 +516,7 @@ static void venc_power_off(struct omap_dss_device *dssdev)enum omap_channel channel = dssdev->dispc_channel;venc_write_reg (VENC_OUTPUT_CONTROL ,0 ); -dss_set_dac_pwrdn_bgz (0 ); +dss_set_dac_pwrdn_bgz (venc.dss,0 );dss_mgr_disable (channel);
@@ -876,11 +877,13 @@ static const struct soc_device_attribute venc_soc_devices[] = {static int venc_bind (struct device *dev,struct device *master,void *data) {struct platform_device *pdev =to_platform_device (dev); +struct dss_device *dss =dss_get_device (master);u8 rev_id;struct resource *venc_mem;int r; venc.pdev = pdev; + venc.dss = dss;/* The OMAP34xx, OMAP35xx and AM35xx VENC require the TV DAC clock. */ if (soc_device_match (venc_soc_devices))
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 28/48] drm: omapdrm: dss: Pass DSS pointer to remaining dss functions
Hi,
Quoted 6 lines · Laurent Pinchart
This removes the need to access the global DSS private data in those functions (both for the current accesses and the future ones that will be introduced when allocating the DSS device dynamically).
Signed-off-by Laurent Pinchart <[email protected]>---
-- Sebastian
Quoted 143 lines
drivers/gpu/drm/omapdrm/dss/dispc.c | 2 +- drivers/gpu/drm/omapdrm/dss/dss.c | 9 +++++---- drivers/gpu/drm/omapdrm/dss/dss.h | 7 ++++--- drivers/gpu/drm/omapdrm/dss/venc.c | 11 +++++++---- 4 files changed, 17 insertions(+), 12 deletions(-)drivers/gpu/drm/omapdrm/dss/dispc.c +1
-1@@ -2737,7 +2737,7 @@ static int dispc_ovl_enable(enum omap_plane_id plane, bool enable)static enum omap_dss_output_id dispc_mgr_get_supported_outputs (enum omap_channel channel) { -return dss_get_supported_outputs (channel); +return dss_get_supported_outputs (dispc.dss, channel); }static void dispc_lcd_enable_signal_polarity (bool act_high)drivers/gpu/drm/omapdrm/dss/dss.c +5
-4@@ -706,9 +706,10 @@ unsigned long dss_get_max_fck_rate(struct dss_device *dss)return dss->feat->fck_freq_max; } -enum omap_dss_output_id dss_get_supported_outputs (enum omap_channel channel) +enum omap_dss_output_id dss_get_supported_outputs (struct dss_device *dss, +enum omap_channel channel) { -return dss.feat->outputs[channel]; +return dss->feat->outputs[channel]; }static int dss_setup_default_clock (void )@@ -737,7 +738,7 @@ static int dss_setup_default_clock(void)return 0 ; } -void dss_set_venc_output (enum omap_dss_venc_type type) +void dss_set_venc_output (struct dss_device *dss,enum omap_dss_venc_type type) {int l =0 ;@@ -752,7 +753,7 @@ void dss_set_venc_output(enum omap_dss_venc_type type)REG_FLD_MOD (DSS_CONTROL , l,6 ,6 ); } -void dss_set_dac_pwrdn_bgz (bool enable) +void dss_set_dac_pwrdn_bgz (struct dss_device *dss,bool enable) {REG_FLD_MOD (DSS_CONTROL , enable,5 ,5 );/* DAC Power-Down Control */ }drivers/gpu/drm/omapdrm/dss/dss.h +4
-3@@ -286,7 +286,8 @@ void dss_runtime_put(struct dss_device *dss);unsigned long dss_get_dispc_clk_rate (struct dss_device *dss);unsigned long dss_get_max_fck_rate (struct dss_device *dss); -enum omap_dss_output_id dss_get_supported_outputs (enum omap_channel channel); +enum omap_dss_output_id dss_get_supported_outputs (struct dss_device *dss, +enum omap_channel channel);int dss_dpi_select_source (struct dss_device *dss,int port,enum omap_channel channel); void dss_select_hdmi_venc_clk_source(struct dss_device *dss,@@ -317,8 +318,8 @@ enum dss_clk_source dss_get_dsi_clk_source(struct dss_device *dss,enum dss_clk_source dss_get_lcd_clk_source (struct dss_device *dss,enum omap_channel channel); -void dss_set_venc_output (enum omap_dss_venc_type type); -void dss_set_dac_pwrdn_bgz (bool enable); +void dss_set_venc_output (struct dss_device *dss,enum omap_dss_venc_type type); +void dss_set_dac_pwrdn_bgz (struct dss_device *dss,bool enable);int dss_set_fck_rate (struct dss_device *dss,unsigned long rate);drivers/gpu/drm/omapdrm/dss/venc.c +7
-4@@ -327,6 +327,7 @@ static struct {struct mutex venc_lock;u32 wss_data;struct regulator *vdda_dac_reg; +struct dss_device *dss;struct dss_debugfs_entry *debugfs;@@ -472,8 +473,8 @@ static int venc_power_on(struct omap_dss_device *dssdev)venc_reset ();venc_write_config (venc_timings_to_config (&venc.vm)); -dss_set_venc_output (venc.type); -dss_set_dac_pwrdn_bgz (1 ); +dss_set_venc_output (venc.dss, venc.type); +dss_set_dac_pwrdn_bgz (venc.dss,1 ); l =0 ;@@ -503,7 +504,7 @@ static int venc_power_on(struct omap_dss_device *dssdev)regulator_disable (venc.vdda_dac_reg); err1:venc_write_reg (VENC_OUTPUT_CONTROL ,0 ); -dss_set_dac_pwrdn_bgz (0 ); +dss_set_dac_pwrdn_bgz (venc.dss,0 );venc_runtime_put (); err0:@@ -515,7 +516,7 @@ static void venc_power_off(struct omap_dss_device *dssdev)enum omap_channel channel = dssdev->dispc_channel;venc_write_reg (VENC_OUTPUT_CONTROL ,0 ); -dss_set_dac_pwrdn_bgz (0 ); +dss_set_dac_pwrdn_bgz (venc.dss,0 );dss_mgr_disable (channel);@@ -876,11 +877,13 @@ static const struct soc_device_attribute venc_soc_devices[] = {static int venc_bind (struct device *dev,struct device *master,void *data) {struct platform_device *pdev =to_platform_device (dev); +struct dss_device *dss =dss_get_device (master);u8 rev_id;struct resource *venc_mem;int r; venc.pdev = pdev; + venc.dss = dss;/* The OMAP34xx, OMAP35xx and AM35xx VENC require the TV DAC clock. */ if (soc_device_match (venc_soc_devices))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 29/48 drm: omapdrm: dss: Remove dss_get_hdmi_venc_clk_source() function
In reply to Laurent PinchartThe function is unused, remove it.
--- drivers/gpu/drm/omapdrm/dss/dss.c | 14 -------------- drivers/gpu/drm/omapdrm/dss/dss.h | 1 - 2 files changed, 15 deletions(-)
drivers/gpu/drm/omapdrm/dss/dss.c +0 -14
@@ -775,20 +775,6 @@ void dss_select_hdmi_venc_clk_source(struct dss_device *dss,REG_FLD_MOD (DSS_CONTROL , src,15 ,15 );/* VENC_HDMI_SWITCH */ } -enum dss_hdmi_venc_clk_source_select dss_get_hdmi_venc_clk_source (void ) -{ -enum omap_dss_output_id outputs; - - outputs = dss.feat->outputs[OMAP_DSS_CHANNEL_DIGIT ]; -if ((outputs &OMAP_DSS_OUTPUT_HDMI ) ==0 ) -return DSS_VENC_TV_CLK ; - -if ((outputs &OMAP_DSS_OUTPUT_VENC ) ==0 ) -return DSS_HDMI_M_PCLK ; - -return REG_GET (DSS_CONTROL ,15 ,15 ); -} -static int dss_dpi_select_source_omap2_omap3 (struct dss_device *dss,int port,enum omap_channel channel) {
drivers/gpu/drm/omapdrm/dss/dss.h +0 -1
@@ -292,7 +292,6 @@ int dss_dpi_select_source(struct dss_device *dss, int port, enum omap_channel channel);void dss_select_hdmi_venc_clk_source (struct dss_device *dss,enum dss_hdmi_venc_clk_source_select src); -enum dss_hdmi_venc_clk_source_select dss_get_hdmi_venc_clk_source (void );const char *dss_get_clk_source_name (enum dss_clk_source clk_src);/* DSS VIDEO PLL */
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 29/48] drm: omapdrm: dss: Remove dss_get_hdmi_venc_clk_source() function
Hi,
Quoted 4 lines · Laurent Pinchart
The function is unused, remove it.
Signed-off-by Laurent Pinchart <[email protected]>---
-- Sebastian
Quoted 50 lines
drivers/gpu/drm/omapdrm/dss/dss.c | 14 -------------- drivers/gpu/drm/omapdrm/dss/dss.h | 1 - 2 files changed, 15 deletions(-)drivers/gpu/drm/omapdrm/dss/dss.c +0
-14@@ -775,20 +775,6 @@ void dss_select_hdmi_venc_clk_source(struct dss_device *dss,REG_FLD_MOD (DSS_CONTROL , src,15 ,15 );/* VENC_HDMI_SWITCH */ } -enum dss_hdmi_venc_clk_source_select dss_get_hdmi_venc_clk_source (void ) -{ -enum omap_dss_output_id outputs; - - outputs = dss.feat->outputs[OMAP_DSS_CHANNEL_DIGIT ]; -if ((outputs &OMAP_DSS_OUTPUT_HDMI ) ==0 ) -return DSS_VENC_TV_CLK ; - -if ((outputs &OMAP_DSS_OUTPUT_VENC ) ==0 ) -return DSS_HDMI_M_PCLK ; - -return REG_GET (DSS_CONTROL ,15 ,15 ); -} -static int dss_dpi_select_source_omap2_omap3 (struct dss_device *dss,int port,enum omap_channel channel) {drivers/gpu/drm/omapdrm/dss/dss.h +0
-1@@ -292,7 +292,6 @@ int dss_dpi_select_source(struct dss_device *dss, int port, enum omap_channel channel);void dss_select_hdmi_venc_clk_source (struct dss_device *dss,enum dss_hdmi_venc_clk_source_select src); -enum dss_hdmi_venc_clk_source_select dss_get_hdmi_venc_clk_source (void );const char *dss_get_clk_source_name (enum dss_clk_source clk_src);/* DSS VIDEO PLL */ 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