drm/exynos: few patches to enhance bridge chip support
Subsystems (9)
v8 cover drm/exynos: few patches to enhance bridge chip support
This series is based on master branch of Linus tree at:git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Changes since V2:
-- Address comments from Jingoo Han for ps8622 driver -- Address comments from Daniel, Rob and Thierry regarding
bridge chaining
-- Address comments from Thierry regarding the names for
new drm_panel functions
Changes since V3:
-- Remove hotplug based initialization of exynos_dp -- Make exynos_dp work directly with drm_panel, remove
dependency on panel_binder
-- Minor cleanups in panel_binder and panel_lvds driver
Changes since V4:
-- Use gpiod interface for panel-lvds and ps8622 drivers. -- Address comments from Javier.
-- Fix compilation issues when PANEL_BINDER is selected as module. -- Split Documentation patches from driver patches.
-- Rebase on top of the tree.
Changes since V5:
-- Modify bridge drivers to support driver model.
-- Drop the concept of bridge chain(sincle there are no 2 real bridges)
Hence drop bridge-panel_binder layer.
-- Drop panel-lvds driver and accomodate the required changes in
panel-simple driver.
-- Use gpiod interface in ptn3460 driver.
-- Address all comments by Thierry Reding for V5 series. -- Address comments from Sean Paul for exynos_dp_commit issue.
Changes since V6:
-- Panel patches were seperated and they are merged already. -- Fix few issues with ptn3460, before modifying the bridge core. -- Modify drm_bridge as per Thierry's comments for V6 series. -- Add drm_bridge changes minimally without breaking existing code. -- Add new features for ptn3460, step-by-step.
-- Address comments from Thierry and Andreas for ptn3460 and ps8622. -- Split documentation patches from driver patches.
Changes since V7:
-- Address comments from Tomi and Laurent:
-- Use videoports and endpoints to represent the connection between
encoder, bridge and the panel, instead of using phandles.
-- Address comments from Daniel:
-- Make the patch description more descriptive.
-- remove device pointer from drm_bridge, and just use
device_node instead.
-- don't pass encoder pointer to bridge_attach.
-- Address comments from Sean Paul:
-- Remove bridge from mode_config, and pull out drm_bridge
functions from drm_crtc.c to drm_bridge.c
Note: This patchset creates the following Kconfig ambiguity.
Any pointers to fix the same are welcome.
drivers/video/fbdev/Kconfig:5:error: recursive dependency detected!drivers/video/fbdev/Kconfig:5: symbol FB is selected by DRM_KMS_FB_HELPERdrivers/gpu/drm/Kconfig:34: symbol DRM_KMS_FB_HELPER depends on DRM_KMS_HELPERdrivers/gpu/drm/Kconfig:28: symbol DRM_KMS_HELPER is selected by DRM_PTN3460drivers/gpu/drm/bridge/Kconfig:1: symbol DRM_PTN3460 depends on I2Cdrivers/i2c/Kconfig:7: symbol I2C is selected by FB_DDCdrivers/video/fbdev/Kconfig:59: symbol FB_DDC is selected by FB_CYBER2000_DDCdrivers/video/fbdev/Kconfig:374: symbol FB_CYBER2000_DDC depends on FB_CYBER2000drivers/video/fbdev/Kconfig:362: symbol FB_CYBER2000 depends on FB
Ajay Kumar (13):
[PATCH V8 1/14] drm/bridge: ptn3460: Few trivial cleanups
[PATCH V8 2/14] drm/bridge: do not pass drm_bridge_funcs to drm_bridge_init [PATCH V8 3/14] drm/bridge: make bridge registration independent of drm flow [PATCH V8 4/14] drm/bridge: ptn3460: Convert to i2c driver model [PATCH V8 5/14] drm/exynos: dp: support drm_bridge
[PATCH V8 6/14] drm/bridge: ptn3460: support drm_panel
[PATCH V8 7/14] drm/bridge: ptn3460: probe connector at the end of bridge attach [PATCH V8 8/14] drm/bridge: ptn3460: use gpiod interface
[PATCH V8 9/14] Documentation: drm: bridge: move to video/bridge [PATCH V8 10/14] Documentation: devicetree: Add vendor prefix for parade [PATCH V8 11/14] Documentation: bridge: Add documentation for ps8622 DT properties [PATCH V8 13/14] ARM: dts: snow: represent the connection between bridge and panel
using videoport and endpoints
[PATCH V8 14/14] ARM: dts: peach-pit: represent the connection between bridge and
panel using videoport and endpoints
Vincent Palatin (1):
[PATCH V8 12/14] drm/bridge: Add i2c based driver for ps8622/ps8625 bridge
.../devicetree/bindings/drm/bridge/ptn3460.txt | 27 - .../devicetree/bindings/vendor-prefixes.txt | 1 + .../devicetree/bindings/video/bridge/ps8622.txt | 31 + .../devicetree/bindings/video/bridge/ptn3460.txt | 39 ++ .../devicetree/bindings/video/exynos_dp.txt | 12 + arch/arm/boot/dts/exynos5250-snow.dts | 30 +- arch/arm/boot/dts/exynos5420-peach-pit.dts | 31 +- drivers/gpu/drm/Makefile | 2 +- drivers/gpu/drm/bridge/Kconfig | 12 + drivers/gpu/drm/bridge/Makefile | 1 + drivers/gpu/drm/bridge/ps8622.c | 684 ++++++++++++++++++++ drivers/gpu/drm/bridge/ptn3460.c | 310 +++++---- drivers/gpu/drm/drm_bridge.c | 91 +++ drivers/gpu/drm/drm_crtc.c | 68 -- drivers/gpu/drm/exynos/exynos_dp_core.c | 53 +- drivers/gpu/drm/exynos/exynos_dp_core.h | 1 + drivers/gpu/drm/msm/hdmi/hdmi.c | 7 +- drivers/gpu/drm/msm/hdmi/hdmi.h | 1 + drivers/gpu/drm/msm/hdmi/hdmi_bridge.c | 8 +- drivers/gpu/drm/sti/sti_hda.c | 11 +- drivers/gpu/drm/sti/sti_hdmi.c | 11 +- include/drm/bridge/ptn3460.h | 8 + include/drm/drm_crtc.h | 27 +- 23 files changed, 1184 insertions(+), 282 deletions(-) delete mode 100644 Documentation/devicetree/bindings/drm/bridge/ptn3460.txt create mode 100644 Documentation/devicetree/bindings/video/bridge/ps8622.txt create mode 100644 Documentation/devicetree/bindings/video/bridge/ptn3460.txt create mode 100644 drivers/gpu/drm/bridge/ps8622.c create mode 100644 drivers/gpu/drm/drm_bridge.c
Signature · 1 line
1.7.9.5
PATCH v8 1/14 drm/bridge: ptn3460: Few trivial cleanups
This patch does the following changes:
-- Use usleep_range instead of udelay.
-- Remove driver_private member from ptn3460 structure. -- Make all possible functions and structures static. -- Use dev_err for non-DRM errors.
-- Arrange header files alphabetically.
-- s/edid/EDID in all error messages.
--- drivers/gpu/drm/bridge/ptn3460.c | 95 +++++++++++++++++++------------------- 1 file changed, 48 insertions(+), 47 deletions(-)
drivers/gpu/drm/bridge/ptn3460.c +48 -47
@@ -13,19 +13,19 @@* GNU General Public License for more details. */ +#include <linux/delay.h> +#include <linux/gpio.h> +#include <linux/i2c.h> #include <linux/module.h> #include <linux/of.h> #include <linux/of_gpio.h> -#include <linux/i2c.h> -#include <linux/gpio.h> -#include <linux/delay.h> -#include "drmP.h" -#include "drm_edid.h" +#include "bridge/ptn3460.h" +#include "drm_crtc.h" #include "drm_crtc_helper.h" - -#include "bridge/ptn3460.h" +#include "drm_edid.h" +#include "drmP.h" #define PTN3460_EDID_ADDR 0x0#define PTN3460_EDID_EMULATION_ADDR 0x84
@@ -37,7 +37,7 @@ struct ptn3460_bridge {struct drm_connector connector;struct i2c_client *client;struct drm_encoder *encoder; -struct drm_bridge *bridge; +struct drm_bridge bridge;struct edid *edid;int gpio_pd_n;int gpio_rst_n;
@@ -45,6 +45,18 @@ struct ptn3460_bridge {bool enabled; }; +static inline struct ptn3460_bridge * +bridge_to_ptn3460 (struct drm_bridge *bridge) +{ + return container_of(bridge, struct ptn3460_bridge, bridge); +} + +static inline struct ptn3460_bridge * +connector_to_ptn3460 (struct drm_connector *connector) +{ + return container_of(connector, struct ptn3460_bridge, connector); +} +static int ptn3460_read_bytes (struct ptn3460_bridge *ptn_bridge,char addr,u8 *buf,int len) {
@@ -92,7 +104,7 @@ static int ptn3460_select_edid(struct ptn3460_bridge *ptn_bridge) ret =ptn3460_write_byte (ptn_bridge,PTN3460_EDID_SRAM_LOAD_ADDR , ptn_bridge->edid_emulation);if (ret) { -DRM_ERROR ("Failed to transfer edid to sram, ret=%d\n" , ret); +DRM_ERROR ("Failed to transfer EDID to sram, ret=%d\n" , ret);return ret; }
@@ -102,7 +114,7 @@ static int ptn3460_select_edid(struct ptn3460_bridge *ptn_bridge) ret =ptn3460_write_byte (ptn_bridge,PTN3460_EDID_EMULATION_ADDR , val);if (ret) { -DRM_ERROR ("Failed to write edid value, ret=%d\n" , ret); +DRM_ERROR ("Failed to write EDID value, ret=%d\n" , ret);return ret; }
@@ -111,7 +123,7 @@ static int ptn3460_select_edid(struct ptn3460_bridge *ptn_bridge)static void ptn3460_pre_enable (struct drm_bridge *bridge) { -struct ptn3460_bridge *ptn_bridge = bridge->driver_private; +struct ptn3460_bridge *ptn_bridge =bridge_to_ptn3460 (bridge);int ret;if (ptn_bridge->enabled)
@@ -122,7 +134,7 @@ static void ptn3460_pre_enable(struct drm_bridge *bridge)if (gpio_is_valid (ptn_bridge->gpio_rst_n)) {gpio_set_value (ptn_bridge->gpio_rst_n,0 ); -udelay (10 ); +usleep_range (10 ,20 );gpio_set_value (ptn_bridge->gpio_rst_n,1 ); }
@@ -135,7 +147,7 @@ static void ptn3460_pre_enable(struct drm_bridge *bridge) ret =ptn3460_select_edid (ptn_bridge);if (ret) -DRM_ERROR ("Select edid failed ret=%d\n" , ret); +DRM_ERROR ("Select EDID failed ret=%d\n" , ret); ptn_bridge->enabled = true; }
@@ -146,7 +158,7 @@ static void ptn3460_enable(struct drm_bridge *bridge)static void ptn3460_disable (struct drm_bridge *bridge) { -struct ptn3460_bridge *ptn_bridge = bridge->driver_private; +struct ptn3460_bridge *ptn_bridge =bridge_to_ptn3460 (bridge);if (!ptn_bridge->enabled)return ;
@@ -164,9 +176,9 @@ static void ptn3460_post_disable(struct drm_bridge *bridge) { } -void ptn3460_bridge_destroy (struct drm_bridge *bridge) +static void ptn3460_bridge_destroy (struct drm_bridge *bridge) { -struct ptn3460_bridge *ptn_bridge = bridge->driver_private; +struct ptn3460_bridge *ptn_bridge =bridge_to_ptn3460 (bridge);drm_bridge_cleanup (bridge);if (gpio_is_valid (ptn_bridge->gpio_pd_n))
@@ -176,7 +188,7 @@ void ptn3460_bridge_destroy(struct drm_bridge *bridge)/* Nothing else to free, we've got devm allocated memory */ } -struct drm_bridge_funcs ptn3460_bridge_funcs = { +static struct drm_bridge_funcs ptn3460_bridge_funcs = { .pre_enable = ptn3460_pre_enable, .enable = ptn3460_enable, .disable = ptn3460_disable,
@@ -184,24 +196,24 @@ struct drm_bridge_funcs ptn3460_bridge_funcs = { .destroy = ptn3460_bridge_destroy, }; -int ptn3460_get_modes (struct drm_connector *connector) +static int ptn3460_get_modes (struct drm_connector *connector) {struct ptn3460_bridge *ptn_bridge;u8 *edid; -int ret, num_modes; +int ret, num_modes =0 ;bool power_off; - ptn_bridge = container_of(connector, struct ptn3460_bridge, connector); + ptn_bridge =connector_to_ptn3460 (connector);if (ptn_bridge->edid)return drm_add_edid_modes (connector, ptn_bridge->edid); power_off = !ptn_bridge->enabled; -ptn3460_pre_enable (ptn_bridge->bridge); +ptn3460_pre_enable (&ptn_bridge->bridge); edid =kmalloc (EDID_LENGTH ,GFP_KERNEL );if (!edid) { -DRM_ERROR ("Failed to allocate edid\n" ); +DRM_ERROR ("Failed to allocate EDID\n" );return 0 ; }
@@ -209,7 +221,6 @@ int ptn3460_get_modes(struct drm_connector *connector) EDID_LENGTH);if (ret) {kfree (edid); - num_modes =0 ; goto out; }
@@ -220,37 +231,35 @@ int ptn3460_get_modes(struct drm_connector *connector) out:if (power_off) -ptn3460_disable (ptn_bridge->bridge); +ptn3460_disable (&ptn_bridge->bridge);return num_modes; } -struct drm_encoder *ptn3460_best_encoder (struct drm_connector *connector) +static struct drm_encoder *ptn3460_best_encoder (struct drm_connector *connector) { -struct ptn3460_bridge *ptn_bridge; - - ptn_bridge = container_of(connector, struct ptn3460_bridge, connector); +struct ptn3460_bridge *ptn_bridge =connector_to_ptn3460 (connector);return ptn_bridge->encoder; } -struct drm_connector_helper_funcs ptn3460_connector_helper_funcs = { +static struct drm_connector_helper_funcs ptn3460_connector_helper_funcs = { .get_modes = ptn3460_get_modes, .best_encoder = ptn3460_best_encoder, }; -enum drm_connector_status ptn3460_detect (struct drm_connector *connector, +static enum drm_connector_status ptn3460_detect (struct drm_connector *connector,bool force) {return connector_status_connected; } -void ptn3460_connector_destroy (struct drm_connector *connector) +static void ptn3460_connector_destroy (struct drm_connector *connector) {drm_connector_cleanup (connector); } -struct drm_connector_funcs ptn3460_connector_funcs = { +static struct drm_connector_funcs ptn3460_connector_funcs = { .dpms = drm_helper_connector_dpms, .fill_modes = drm_helper_probe_single_connector_modes, .detect = ptn3460_detect,
@@ -261,30 +270,22 @@ int ptn3460_init(struct drm_device *dev, struct drm_encoder *encoder, struct i2c_client *client, struct device_node *node) { int ret; -struct drm_bridge *bridge;struct ptn3460_bridge *ptn_bridge; - bridge =devm_kzalloc (dev->dev,sizeof (*bridge),GFP_KERNEL ); -if (!bridge) { -DRM_ERROR ("Failed to allocate drm bridge\n" ); -return -ENOMEM ; - } - ptn_bridge =devm_kzalloc (dev->dev,sizeof (*ptn_bridge),GFP_KERNEL );if (!ptn_bridge) { -DRM_ERROR ("Failed to allocate ptn bridge\n" );return -ENOMEM ; } ptn_bridge->client = client; ptn_bridge->encoder = encoder; - ptn_bridge->bridge = bridge; ptn_bridge->gpio_pd_n =of_get_named_gpio (node,"powerdown-gpio" ,0 );if (gpio_is_valid (ptn_bridge->gpio_pd_n)) { ret =gpio_request_one (ptn_bridge->gpio_pd_n,GPIOF_OUT_INIT_HIGH ,"PTN3460_PD_N" );if (ret) { -DRM_ERROR ("Request powerdown-gpio failed (%d)\n" , ret); +dev_err (&client->dev, +"Request powerdown-gpio failed (%d)\n" , ret);return ret; } }
@@ -298,7 +299,8 @@ int ptn3460_init(struct drm_device *dev, struct drm_encoder *encoder, ret =gpio_request_one (ptn_bridge->gpio_rst_n,GPIOF_OUT_INIT_LOW ,"PTN3460_RST_N" );if (ret) { -DRM_ERROR ("Request reset-gpio failed (%d)\n" , ret); +dev_err (&client->dev, +"Request reset-gpio failed (%d)\n" , ret);gpio_free (ptn_bridge->gpio_pd_n);return ret; }
@@ -307,18 +309,17 @@ int ptn3460_init(struct drm_device *dev, struct drm_encoder *encoder, ret =of_property_read_u32 (node,"edid-emulation" , &ptn_bridge->edid_emulation);if (ret) { -DRM_ERROR ("Can't read edid emulation value\n" ); +dev_err (&client->dev,"Can't read EDID emulation value\n" ); goto err; } - ret =drm_bridge_init (dev, bridge, &ptn3460_bridge_funcs); + ret =drm_bridge_init (dev, &ptn_bridge->bridge, &ptn3460_bridge_funcs);if (ret) {DRM_ERROR ("Failed to initialize bridge with drm\n" ); goto err; } - bridge->driver_private = ptn_bridge; - encoder->bridge = bridge; + encoder->bridge = &ptn_bridge->bridge; ret =drm_connector_init (dev, &ptn_bridge->connector, &ptn3460_connector_funcs,DRM_MODE_CONNECTOR_LVDS );
Signature · 1 line
1.7.9.5
PATCH v8 2/14 drm/bridge: do not pass drm_bridge_funcs to drm_bridge_init
In reply to Ajay KumarAssign the pointer to bridge ops structure(drm_bridge_funcs) in the bridge driver itself, instead of passing it to drm_bridge_init.
This will allow bridge driver developer to pack bridge private information inside the bridge object and pass only the drm-relevant information to drm_bridge_init.
--- drivers/gpu/drm/bridge/ptn3460.c | 3 ++- drivers/gpu/drm/drm_crtc.c | 5 +---- drivers/gpu/drm/msm/hdmi/hdmi_bridge.c | 3 ++- drivers/gpu/drm/sti/sti_hda.c | 3 ++- drivers/gpu/drm/sti/sti_hdmi.c | 3 ++- include/drm/drm_crtc.h | 3 +-- 6 files changed, 10 insertions(+), 10 deletions(-)
drivers/gpu/drm/bridge/ptn3460.c +2 -1
@@ -313,7 +313,8 @@ int ptn3460_init(struct drm_device *dev, struct drm_encoder *encoder, goto err; } - ret =drm_bridge_init (dev, &ptn_bridge->bridge, &ptn3460_bridge_funcs); + ptn_bridge->bridge.funcs = &ptn3460_bridge_funcs; + ret =drm_bridge_init (dev, &ptn_bridge->bridge);if (ret) {DRM_ERROR ("Failed to initialize bridge with drm\n" ); goto err;
drivers/gpu/drm/drm_crtc.c +1 -4
@@ -1011,7 +1011,6 @@ EXPORT_SYMBOL(drm_connector_unplug_all);* drm_bridge_init - initialize a drm transcoder/bridge * @dev: drm device * @bridge: transcoder/bridge to set up -* @funcs: bridge function table * * Initialises a preallocated bridge. Bridges should be * subclassed as part of driver connector objects.
@@ -1019,8 +1018,7 @@ EXPORT_SYMBOL(drm_connector_unplug_all);* Returns: * Zero on success, error code on failure. */ -int drm_bridge_init (struct drm_device *dev,struct drm_bridge *bridge, -const struct drm_bridge_funcs *funcs) +int drm_bridge_init (struct drm_device *dev,struct drm_bridge *bridge) {int ret;
@@ -1031,7 +1029,6 @@ int drm_bridge_init(struct drm_device *dev, struct drm_bridge *bridge, goto out; bridge->dev = dev; - bridge->funcs = funcs;list_add_tail (&bridge->head, &dev->mode_config.bridge_list); dev->mode_config.num_bridge++;
drivers/gpu/drm/msm/hdmi/hdmi_bridge.c +2 -1
@@ -221,8 +221,9 @@ struct drm_bridge *hdmi_bridge_init(struct hdmi *hdmi) hdmi_bridge->hdmi =hdmi_reference (hdmi); bridge = &hdmi_bridge->base; + bridge->funcs = &hdmi_bridge_funcs; -drm_bridge_init (hdmi->dev, bridge, &hdmi_bridge_funcs); +drm_bridge_init (hdmi->dev, bridge);return bridge;
drivers/gpu/drm/sti/sti_hda.c +2 -1
@@ -664,7 +664,8 @@ static int sti_hda_bind(struct device *dev, struct device *master, void *data)return -ENOMEM ; bridge->driver_private = hda; -drm_bridge_init (drm_dev, bridge, &sti_hda_bridge_funcs); + bridge->funcs = &sti_hda_bridge_funcs; +drm_bridge_init (drm_dev, bridge); encoder->bridge = bridge; connector->encoder = encoder;
drivers/gpu/drm/sti/sti_hdmi.c +2 -1
@@ -628,7 +628,8 @@ static int sti_hdmi_bind(struct device *dev, struct device *master, void *data)return -ENOMEM ; bridge->driver_private = hdmi; -drm_bridge_init (drm_dev, bridge, &sti_hdmi_bridge_funcs); + bridge->funcs = &sti_hdmi_bridge_funcs; +drm_bridge_init (drm_dev, bridge); encoder->bridge = bridge; connector->encoder = encoder;
include/drm/drm_crtc.h +1 -2
@@ -912,8 +912,7 @@ extern unsigned int drm_connector_index(struct drm_connector *connector);/* helper to unplug all connectors from sysfs for device */ extern void drm_connector_unplug_all (struct drm_device *dev); -extern int drm_bridge_init (struct drm_device *dev,struct drm_bridge *bridge, -const struct drm_bridge_funcs *funcs); +extern int drm_bridge_init (struct drm_device *dev,struct drm_bridge *bridge);extern void drm_bridge_cleanup (struct drm_bridge *bridge); extern int drm_encoder_init(struct drm_device *dev,
Signature · 1 line
1.7.9.5
PATCH v8 3/14 drm/bridge: make bridge registration independent of drm flow
In reply to Ajay KumarCurrently, third party bridge drivers(ptn3460) are dependent on the corresponding encoder driver init, since bridge driver needs a drm_device pointer to finish drm initializations. The encoder driver passes the drm_device pointer to the bridge driver. Because of this dependency, third party drivers like ptn3460 doesn't adhere to the driver model.
In this patch, we reframe the bridge registration framework so that bridge initialization is split into 2 steps, and bridge registration happens independent of drm flow:
--Step 1: gather all the bridge settings independent of drm and
add the bridge onto a global list of bridges.
--Step 2: when the encoder driver is probed, call drm_bridge_attach
for the corresponding bridge so that the bridge receives drm_device pointer and continues with connector and other drm initializations.
The old set of bridge helpers are removed, and a set of new helpers are added to accomplish the 2 step initialization.
The bridge devices register themselves onto global list of bridges when they get probed by calling "drm_bridge_add".
The parent encoder driver waits till the bridge is available in the lookup table(by calling "of_drm_find_bridge") and then continues with its initialization.
The encoder driver should also call "drm_bridge_attach" to pass on the drm_device to the bridge object.
drm_bridge_attach inturn calls "bridge->funcs->attach" so that bridge can continue with drm related initializations.
--- drivers/gpu/drm/Makefile | 2 +- drivers/gpu/drm/bridge/ptn3460.c | 27 +++++----- drivers/gpu/drm/drm_bridge.c | 91 ++++++++++++++++++++++++++++++++ drivers/gpu/drm/drm_crtc.c | 65 ----------------------- drivers/gpu/drm/msm/hdmi/hdmi.c | 7 +-- drivers/gpu/drm/msm/hdmi/hdmi.h | 1 + drivers/gpu/drm/msm/hdmi/hdmi_bridge.c | 7 ++- drivers/gpu/drm/sti/sti_hda.c | 10 +--- drivers/gpu/drm/sti/sti_hdmi.c | 10 +--- include/drm/bridge/ptn3460.h | 8 +++ include/drm/drm_crtc.h | 26 ++++----- 11 files changed, 136 insertions(+), 118 deletions(-) create mode 100644 drivers/gpu/drm/drm_bridge.c
drivers/gpu/drm/Makefile +1 -1
@@ -14,7 +14,7 @@ drm-y := drm_auth.o drm_bufs.o drm_cache.o \ drm_info.o drm_debugfs.o drm_encoder_slave.o \ drm_trace_points.o drm_global.o drm_prime.o \ drm_rect.o drm_vma_manager.o drm_flip_work.o \ - drm_modeset_lock.o + drm_modeset_lock.o drm_bridge.o drm-$(CONFIG_COMPAT) += drm_ioc32.o drm-$(CONFIG_DRM_GEM_CMA_HELPER) += drm_gem_cma_helper.o
drivers/gpu/drm/bridge/ptn3460.c +13 -14
@@ -176,24 +176,11 @@ static void ptn3460_post_disable(struct drm_bridge *bridge) { } -static void ptn3460_bridge_destroy (struct drm_bridge *bridge) -{ -struct ptn3460_bridge *ptn_bridge =bridge_to_ptn3460 (bridge); - -drm_bridge_cleanup (bridge); -if (gpio_is_valid (ptn_bridge->gpio_pd_n)) -gpio_free (ptn_bridge->gpio_pd_n); -if (gpio_is_valid (ptn_bridge->gpio_rst_n)) -gpio_free (ptn_bridge->gpio_rst_n); -/* Nothing else to free, we've got devm allocated memory */ -} -static struct drm_bridge_funcs ptn3460_bridge_funcs = { .pre_enable = ptn3460_pre_enable, .enable = ptn3460_enable, .disable = ptn3460_disable, .post_disable = ptn3460_post_disable, - .destroy = ptn3460_bridge_destroy, };static int ptn3460_get_modes (struct drm_connector *connector)
@@ -314,7 +301,7 @@ int ptn3460_init(struct drm_device *dev, struct drm_encoder *encoder, } ptn_bridge->bridge.funcs = &ptn3460_bridge_funcs; - ret =drm_bridge_init (dev, &ptn_bridge->bridge); + ret =drm_bridge_attach (dev, &ptn_bridge->bridge);if (ret) {DRM_ERROR ("Failed to initialize bridge with drm\n" ); goto err;
@@ -343,3 +330,15 @@ err:return ret; }EXPORT_SYMBOL (ptn3460_init); + +void ptn3460_destroy (struct drm_bridge *bridge) +{ +struct ptn3460_bridge *ptn_bridge = bridge->driver_private; + +if (gpio_is_valid (ptn_bridge->gpio_pd_n)) +gpio_free (ptn_bridge->gpio_pd_n); +if (gpio_is_valid (ptn_bridge->gpio_rst_n)) +gpio_free (ptn_bridge->gpio_rst_n); +/* Nothing else to free, we've got devm allocated memory */ +} +EXPORT_SYMBOL (ptn3460_destroy);
drivers/gpu/drm/drm_bridge.c new file +91 -0
91 lines not on this page · raw message
drivers/gpu/drm/drm_crtc.c +0 -65
113 lines not on this page · raw message
drivers/gpu/drm/msm/hdmi/hdmi.c +4 -3
@@ -65,6 +65,9 @@ void hdmi_destroy(struct kref *kref)if (hdmi->i2c)hdmi_i2c_destroy (hdmi->i2c); +if (hdmi->bridge) +hdmi_bridge_destroy (hdmi->bridge); +platform_set_drvdata (hdmi->pdev,NULL ); }
@@ -234,9 +237,7 @@ struct hdmi *hdmi_init(struct drm_device *dev, struct drm_encoder *encoder) fail:if (hdmi) { -/* bridge/connector are normally destroyed by drm: */ -if (hdmi->bridge) - hdmi->bridge->funcs->destroy (hdmi->bridge); +/* bridge is normally destroyed by drm: */ if (hdmi->connector) hdmi->connector->funcs->destroy (hdmi->connector);hdmi_destroy (&hdmi->refcount);
drivers/gpu/drm/msm/hdmi/hdmi.h +1 -0
@@ -163,6 +163,7 @@ void hdmi_audio_set_sample_rate(struct hdmi *hdmi, int rate);*/ struct drm_bridge *hdmi_bridge_init (struct hdmi *hdmi); +void hdmi_bridge_destroy (struct drm_bridge *bridge);/* * hdmi connector:
drivers/gpu/drm/msm/hdmi/hdmi_bridge.c +3 -4
@@ -23,11 +23,11 @@ struct hdmi_bridge { };#define to_hdmi_bridge (x) container_of(x, struct hdmi_bridge, base) -static void hdmi_bridge_destroy (struct drm_bridge *bridge) +void hdmi_bridge_destroy (struct drm_bridge *bridge) {struct hdmi_bridge *hdmi_bridge =to_hdmi_bridge (bridge); +hdmi_unreference (hdmi_bridge->hdmi); -drm_bridge_cleanup (bridge);kfree (hdmi_bridge); }
@@ -201,7 +201,6 @@ static const struct drm_bridge_funcs hdmi_bridge_funcs = { .disable = hdmi_bridge_disable, .post_disable = hdmi_bridge_post_disable, .mode_set = hdmi_bridge_mode_set, - .destroy = hdmi_bridge_destroy, };
@@ -223,7 +222,7 @@ struct drm_bridge *hdmi_bridge_init(struct hdmi *hdmi) bridge = &hdmi_bridge->base; bridge->funcs = &hdmi_bridge_funcs; -drm_bridge_init (hdmi->dev, bridge); +drm_bridge_attach (hdmi->dev, bridge);return bridge;
drivers/gpu/drm/sti/sti_hda.c +1 -9
@@ -508,19 +508,12 @@ static void sti_hda_bridge_nope(struct drm_bridge *bridge)/* do nothing */ } -static void sti_hda_brigde_destroy (struct drm_bridge *bridge) -{ -drm_bridge_cleanup (bridge); -kfree (bridge); -} -static const struct drm_bridge_funcs sti_hda_bridge_funcs = { .pre_enable = sti_hda_pre_enable, .enable = sti_hda_bridge_nope, .disable = sti_hda_disable, .post_disable = sti_hda_bridge_nope, .mode_set = sti_hda_set_mode, - .destroy = sti_hda_brigde_destroy, };static int sti_hda_connector_get_modes (struct drm_connector *connector)
@@ -665,7 +658,7 @@ static int sti_hda_bind(struct device *dev, struct device *master, void *data) bridge->driver_private = hda; bridge->funcs = &sti_hda_bridge_funcs; -drm_bridge_init (drm_dev, bridge); +drm_bridge_attach (drm_dev, bridge); encoder->bridge = bridge; connector->encoder = encoder;
@@ -694,7 +687,6 @@ static int sti_hda_bind(struct device *dev, struct device *master, void *data) err_sysfs:drm_connector_unregister (drm_connector); err_connector: -drm_bridge_cleanup (bridge);drm_connector_cleanup (drm_connector);return -EINVAL ; }
drivers/gpu/drm/sti/sti_hdmi.c +1 -9
@@ -463,19 +463,12 @@ static void sti_hdmi_bridge_nope(struct drm_bridge *bridge)/* do nothing */ } -static void sti_hdmi_brigde_destroy (struct drm_bridge *bridge) -{ -drm_bridge_cleanup (bridge); -kfree (bridge); -} -static const struct drm_bridge_funcs sti_hdmi_bridge_funcs = { .pre_enable = sti_hdmi_pre_enable, .enable = sti_hdmi_bridge_nope, .disable = sti_hdmi_disable, .post_disable = sti_hdmi_bridge_nope, .mode_set = sti_hdmi_set_mode, - .destroy = sti_hdmi_brigde_destroy, };static int sti_hdmi_connector_get_modes (struct drm_connector *connector)
@@ -629,7 +622,7 @@ static int sti_hdmi_bind(struct device *dev, struct device *master, void *data) bridge->driver_private = hdmi; bridge->funcs = &sti_hdmi_bridge_funcs; -drm_bridge_init (drm_dev, bridge); +drm_bridge_attach (drm_dev, bridge); encoder->bridge = bridge; connector->encoder = encoder;
@@ -661,7 +654,6 @@ static int sti_hdmi_bind(struct device *dev, struct device *master, void *data) err_sysfs:drm_connector_unregister (drm_connector); err_connector: -drm_bridge_cleanup (bridge);drm_connector_cleanup (drm_connector);return -EINVAL ; }
include/drm/bridge/ptn3460.h +8 -0
@@ -15,6 +15,7 @@#define _DRM_BRIDGE_PTN3460_H_struct drm_device ; +struct drm_bridge ;struct drm_encoder ;struct i2c_client ;struct device_node ;
@@ -23,6 +24,9 @@ struct device_node;int ptn3460_init (struct drm_device *dev,struct drm_encoder *encoder,struct i2c_client *client,struct device_node *node); + +void ptn3460_destroy (struct drm_bridge *bridge); +#else static inline int ptn3460_init(struct drm_device *dev,
@@ -32,6 +36,10 @@ static inline int ptn3460_init(struct drm_device *dev,return 0 ; } +static inline void ptn3460_destroy (struct drm_bridge *bridge) +{ +} +#endif #endif
include/drm/drm_crtc.h +13 -13
@@ -633,15 +633,16 @@ struct drm_plane {/** * drm_bridge_funcs - drm_bridge control functions +* @attach: Called during drm_bridge_attach * @mode_fixup: Try to fixup (or reject entirely) proposed mode for this bridge * @disable: Called right before encoder prepare, disables the bridge * @post_disable: Called right after encoder prepare, for lockstepped disable * @mode_set: Set this mode to the bridge * @pre_enable: Called right before encoder commit, for lockstepped commit * @enable: Called right after encoder commit, enables the bridge -* @destroy: make object go away */ struct drm_bridge_funcs { +int (*attach)(struct drm_bridge *bridge);bool (*mode_fixup)(struct drm_bridge *bridge,const struct drm_display_mode *mode,struct drm_display_mode *adjusted_mode);
@@ -652,22 +653,24 @@ struct drm_bridge_funcs { struct drm_display_mode *adjusted_mode);void (*pre_enable)(struct drm_bridge *bridge);void (*enable)(struct drm_bridge *bridge); -void (*destroy)(struct drm_bridge *bridge); };/** * drm_bridge - central DRM bridge control structure * @dev: DRM device this bridge belongs to -* @head: list management +* @of_node: device node pointer to the bridge +* @list: to keep track of all added bridges * @base: base mode object * @funcs: control functions * @driver_private: pointer to the bridge driver's internal context */ struct drm_bridge {struct drm_device *dev; -struct list_head head; - -struct drm_mode_object base; +struct drm_encoder *encoder; +#ifdef CONFIG_OF +struct device_node *of_node; +#endif +struct list_head list;const struct drm_bridge_funcs *funcs;void *driver_private;
@@ -733,7 +736,6 @@ struct drm_mode_group {uint32_t num_crtcs;uint32_t num_encoders;uint32_t num_connectors; -uint32_t num_bridges;/* list of object IDs for this group */ uint32_t *id_list;
@@ -748,8 +750,6 @@ struct drm_mode_group {* @fb_list: list of framebuffers available * @num_connector: number of connectors on this device * @connector_list: list of connector objects -* @num_bridge: number of bridges on this device -* @bridge_list: list of bridge objects * @num_encoder: number of encoders on this device * @encoder_list: list of encoder objects * @num_crtc: number of CRTCs on this device
@@ -789,8 +789,6 @@ struct drm_mode_config {int num_connector;struct list_head connector_list; -int num_bridge; -struct list_head bridge_list;int num_encoder;struct list_head encoder_list;
@@ -912,8 +910,10 @@ extern unsigned int drm_connector_index(struct drm_connector *connector);/* helper to unplug all connectors from sysfs for device */ extern void drm_connector_unplug_all (struct drm_device *dev); -extern int drm_bridge_init (struct drm_device *dev,struct drm_bridge *bridge); -extern void drm_bridge_cleanup (struct drm_bridge *bridge); +extern int drm_bridge_add (struct drm_bridge *bridge); +extern void drm_bridge_remove (struct drm_bridge *bridge); +extern struct drm_bridge *of_drm_find_bridge (struct device_node *np); +extern int drm_bridge_attach (struct drm_device *dev,struct drm_bridge *bridge); extern int drm_encoder_init(struct drm_device *dev, struct drm_encoder *encoder,
Signature · 1 line
1.7.9.5
Re: [PATCH V8 03/14] drm/bridge: make bridge registration independent of drm flow
Quoted 619 lines · Ajay Kumar
Currently, third party bridge drivers(ptn3460) are dependent on the corresponding encoder driver init, since bridge driver needs a
drm_devicepointer to finish drm initializations. The encoder driver passes thedrm_devicepointer to the bridge driver. Because of this dependency, third party drivers like ptn3460 doesn't adhere to the driver model.In this patch, we reframe the bridge registration framework so that bridge initialization is split into 2 steps, and bridge registration happens independent of drm flow:
--Step 1: gather all the bridge settings independent of drm and
add the bridge onto a global list of bridges.
--Step 2: when the encoder driver is probed, calldrm_bridge_attach
for the corresponding bridge so that the bridge receivesdrm_devicepointer and continues with connector and other drm initializations.The old set of bridge helpers are removed, and a set of new helpers are added to accomplish the 2 step initialization.
The bridge devices register themselves onto global list of bridges when they get probed by calling "
drm_bridge_add".The parent encoder driver waits till the bridge is available in the lookup
table(by calling "of_drm_find_bridge")and then continues with its initialization.The encoder driver should also call "
drm_bridge_attach" to pass on thedrm_deviceto the bridge object.
drm_bridge_attachinturn calls "bridge->funcs->attach" so that bridge can continue with drm related initializations.Signed-off-by Ajay Kumar <[email protected]>--- drivers/gpu/drm/Makefile | 2 +- drivers/gpu/drm/bridge/ptn3460.c | 27 +++++----- drivers/gpu/drm/drm_bridge.c | 91 ++++++++++++++++++++++++++++++++ drivers/gpu/drm/drm_crtc.c | 65 ----------------------- drivers/gpu/drm/msm/hdmi/hdmi.c | 7 +-- drivers/gpu/drm/msm/hdmi/hdmi.h | 1 + drivers/gpu/drm/msm/hdmi/hdmi_bridge.c | 7 ++- drivers/gpu/drm/sti/sti_hda.c | 10 +--- drivers/gpu/drm/sti/sti_hdmi.c | 10 +--- include/drm/bridge/ptn3460.h | 8 +++ include/drm/drm_crtc.h | 26 ++++----- 11 files changed, 136 insertions(+), 118 deletions(-) create mode 100644 drivers/gpu/drm/drm_bridge.cdrivers/gpu/drm/Makefile +1
-1@@ -14,7 +14,7 @@ drm-y := drm_auth.o drm_bufs.o drm_cache.o \ drm_info.o drm_debugfs.o drm_encoder_slave.o \ drm_trace_points.o drm_global.o drm_prime.o \ drm_rect.o drm_vma_manager.o drm_flip_work.o \ - drm_modeset_lock.o + drm_modeset_lock.o drm_bridge.o drm-$(CONFIG_COMPAT) += drm_ioc32.o drm-$(CONFIG_DRM_GEM_CMA_HELPER) += drm_gem_cma_helper.odrivers/gpu/drm/bridge/ptn3460.c +13
-14@@ -176,24 +176,11 @@ static void ptn3460_post_disable(struct drm_bridge *bridge) { } -static void ptn3460_bridge_destroy (struct drm_bridge *bridge) -{ -struct ptn3460_bridge *ptn_bridge =bridge_to_ptn3460 (bridge); - -drm_bridge_cleanup (bridge); -if (gpio_is_valid (ptn_bridge->gpio_pd_n)) -gpio_free (ptn_bridge->gpio_pd_n); -if (gpio_is_valid (ptn_bridge->gpio_rst_n)) -gpio_free (ptn_bridge->gpio_rst_n); -/* Nothing else to free, we've got devm allocated memory */ -} -static struct drm_bridge_funcs ptn3460_bridge_funcs = { .pre_enable = ptn3460_pre_enable, .enable = ptn3460_enable, .disable = ptn3460_disable, .post_disable = ptn3460_post_disable, - .destroy = ptn3460_bridge_destroy, };static int ptn3460_get_modes (struct drm_connector *connector)@@ -314,7 +301,7 @@ int ptn3460_init(struct drm_device *dev, struct drm_encoder *encoder, } ptn_bridge->bridge.funcs = &ptn3460_bridge_funcs; - ret =drm_bridge_init (dev, &ptn_bridge->bridge); + ret =drm_bridge_attach (dev, &ptn_bridge->bridge);if (ret) {DRM_ERROR ("Failed to initialize bridge with drm\n" ); goto err;@@ -343,3 +330,15 @@ err:return ret; }EXPORT_SYMBOL (ptn3460_init); + +void ptn3460_destroy (struct drm_bridge *bridge) +{ +struct ptn3460_bridge *ptn_bridge = bridge->driver_private; + +if (gpio_is_valid (ptn_bridge->gpio_pd_n)) +gpio_free (ptn_bridge->gpio_pd_n); +if (gpio_is_valid (ptn_bridge->gpio_rst_n)) +gpio_free (ptn_bridge->gpio_rst_n); +/* Nothing else to free, we've got devm allocated memory */ +} +EXPORT_SYMBOL (ptn3460_destroy);drivers/gpu/drm/drm_bridge.c new file +91
-0@@ -0,0 +1,91 @@ +/* +* Copyright (c) 2014 Samsung Electronics Co., Ltd +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sub license, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice (including the +* next paragraph) shall be included in all copies or substantial portions +* of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +*/ + +#include <linux/err.h> +#include <linux/module.h> + +#include <drm/drm_crtc.h> + +#include "drm/drmP.h" + +static DEFINE_MUTEX (bridge_lock); +static LIST_HEAD (bridge_list); + +int drm_bridge_add (struct drm_bridge *bridge) +{ +mutex_lock (&bridge_lock); +list_add_tail (&bridge->list, &bridge_list); +mutex_unlock (&bridge_lock); + +return 0 ; +} +EXPORT_SYMBOL (drm_bridge_add); + +void drm_bridge_remove (struct drm_bridge *bridge) +{ +mutex_lock (&bridge_lock); +list_del_init (&bridge->list); +mutex_unlock (&bridge_lock); +} +EXPORT_SYMBOL (drm_bridge_remove); + +extern int drm_bridge_attach (struct drm_device *dev,struct drm_bridge *bridge) +{ +if (!dev || !bridge) +return -EINVAL ; + +if (bridge->dev) +return -EBUSY ; + + bridge->dev = dev; + +if (bridge->funcs->attach) +return bridge->funcs->attach (bridge); + +return 0 ; +} +EXPORT_SYMBOL (drm_bridge_attach); + +#ifdef CONFIG_OF +struct drm_bridge *of_drm_find_bridge (struct device_node *np) +{ +struct drm_bridge *bridge; + +mutex_lock (&bridge_lock); + +list_for_each_entry (bridge, &bridge_list, list) { +if (bridge->of_node == np) { +mutex_unlock (&bridge_lock); +return bridge; + } + } + +mutex_unlock (&bridge_lock); +return NULL ; +} +EXPORT_SYMBOL (of_drm_find_bridge); +#endif + +MODULE_AUTHOR ("Ajay Kumar <[email protected]>" ); +MODULE_DESCRIPTION ("DRM bridge infrastructure" ); +MODULE_LICENSE ("GPL and additional rights" );drivers/gpu/drm/drm_crtc.c +0
-65@@ -1008,56 +1008,6 @@ void drm_connector_unplug_all(struct drm_device *dev)EXPORT_SYMBOL (drm_connector_unplug_all);/** -* drm_bridge_init - initialize a drm transcoder/bridge -* @dev: drm device -* @bridge: transcoder/bridge to set up -* -* Initialises a preallocated bridge. Bridges should be -* subclassed as part of driver connector objects. -* -* Returns: -* Zero on success, error code on failure. -*/ -int drm_bridge_init (struct drm_device *dev,struct drm_bridge *bridge) -{ -int ret; - -drm_modeset_lock_all (dev); - - ret =drm_mode_object_get (dev, &bridge->base,DRM_MODE_OBJECT_BRIDGE ); -if (ret) - goto out; - - bridge->dev = dev; - -list_add_tail (&bridge->head, &dev->mode_config.bridge_list); - dev->mode_config.num_bridge++; - - out: -drm_modeset_unlock_all (dev); -return ret; -} -EXPORT_SYMBOL (drm_bridge_init); - -/** -* drm_bridge_cleanup - cleans up an initialised bridge -* @bridge: bridge to cleanup -* -* Cleans up the bridge but doesn't free the object. -*/ -void drm_bridge_cleanup (struct drm_bridge *bridge) -{ -struct drm_device *dev = bridge->dev; - -drm_modeset_lock_all (dev); -drm_mode_object_put (dev, &bridge->base); -list_del (&bridge->head); - dev->mode_config.num_bridge--; -drm_modeset_unlock_all (dev); -} -EXPORT_SYMBOL (drm_bridge_cleanup); - -/** * drm_encoder_init - Init a preallocated encoder * @dev: drm device * @encoder: the encoder to init @@ -1539,7 +1489,6 @@ static int drm_mode_group_init(struct drm_device *dev, struct drm_mode_group *gr total_objects += dev->mode_config.num_crtc; total_objects += dev->mode_config.num_connector; total_objects += dev->mode_config.num_encoder; - total_objects += dev->mode_config.num_bridge; group->id_list =kzalloc (total_objects *sizeof (uint32_t ),GFP_KERNEL );if (!group->id_list)@@ -1548,7 +1497,6 @@ static int drm_mode_group_init(struct drm_device *dev, struct drm_mode_group *gr group->num_crtcs =0 ; group->num_connectors =0 ; group->num_encoders =0 ; - group->num_bridges =0 ;return 0 ; }@@ -1568,7 +1516,6 @@ int drm_mode_group_init_legacy_group(struct drm_device *dev,struct drm_crtc *crtc;struct drm_encoder *encoder;struct drm_connector *connector; -struct drm_bridge *bridge;int ret;if ((ret =drm_mode_group_init (dev, group)))@@ -1585,11 +1532,6 @@ int drm_mode_group_init_legacy_group(struct drm_device *dev, group->id_list[group->num_crtcs + group->num_encoders + group->num_connectors++] = connector->base.id; -list_for_each_entry (bridge, &dev->mode_config.bridge_list, head) - group->id_list[group->num_crtcs + group->num_encoders + - group->num_connectors + group->num_bridges++] = - bridge->base.id; -return 0 ; }EXPORT_SYMBOL (drm_mode_group_init_legacy_group);@@ -5088,7 +5030,6 @@ void drm_mode_config_init(struct drm_device *dev)INIT_LIST_HEAD (&dev->mode_config.fb_list);INIT_LIST_HEAD (&dev->mode_config.crtc_list);INIT_LIST_HEAD (&dev->mode_config.connector_list); -INIT_LIST_HEAD (&dev->mode_config.bridge_list);INIT_LIST_HEAD (&dev->mode_config.encoder_list);INIT_LIST_HEAD (&dev->mode_config.property_list);INIT_LIST_HEAD (&dev->mode_config.property_blob_list);@@ -5128,7 +5069,6 @@ void drm_mode_config_cleanup(struct drm_device *dev)struct drm_connector *connector, *ot;struct drm_crtc *crtc, *ct;struct drm_encoder *encoder, *enct; -struct drm_bridge *bridge, *brt;struct drm_framebuffer *fb, *fbt;struct drm_property *property, *pt;struct drm_property_blob *blob, *bt;@@ -5139,11 +5079,6 @@ void drm_mode_config_cleanup(struct drm_device *dev) encoder->funcs->destroy (encoder); } -list_for_each_entry_safe (bridge, brt, - &dev->mode_config.bridge_list, head) { - bridge->funcs->destroy (bridge); - } -list_for_each_entry_safe (connector, ot, &dev->mode_config.connector_list, head) { connector->funcs->destroy (connector);drivers/gpu/drm/msm/hdmi/hdmi.c +4
-3@@ -65,6 +65,9 @@ void hdmi_destroy(struct kref *kref)if (hdmi->i2c)hdmi_i2c_destroy (hdmi->i2c); +if (hdmi->bridge) +hdmi_bridge_destroy (hdmi->bridge); +platform_set_drvdata (hdmi->pdev,NULL ); }@@ -234,9 +237,7 @@ struct hdmi *hdmi_init(struct drm_device *dev, struct drm_encoder *encoder) fail:if (hdmi) { -/* bridge/connector are normally destroyed by drm: */ -if (hdmi->bridge) - hdmi->bridge->funcs->destroy (hdmi->bridge); +/* bridge is normally destroyed by drm: */ if (hdmi->connector) hdmi->connector->funcs->destroy (hdmi->connector);hdmi_destroy (&hdmi->refcount);drivers/gpu/drm/msm/hdmi/hdmi.h +1
-0@@ -163,6 +163,7 @@ void hdmi_audio_set_sample_rate(struct hdmi *hdmi, int rate);*/ struct drm_bridge *hdmi_bridge_init (struct hdmi *hdmi); +void hdmi_bridge_destroy (struct drm_bridge *bridge);/* * hdmi connector: drivers/gpu/drm/msm/hdmi/hdmi_bridge.c +3
-4@@ -23,11 +23,11 @@ struct hdmi_bridge { };#define to_hdmi_bridge (x) container_of(x, struct hdmi_bridge, base) -static void hdmi_bridge_destroy (struct drm_bridge *bridge) +void hdmi_bridge_destroy (struct drm_bridge *bridge) {struct hdmi_bridge *hdmi_bridge =to_hdmi_bridge (bridge); +hdmi_unreference (hdmi_bridge->hdmi); -drm_bridge_cleanup (bridge);kfree (hdmi_bridge); }@@ -201,7 +201,6 @@ static const struct drm_bridge_funcs hdmi_bridge_funcs = { .disable = hdmi_bridge_disable, .post_disable = hdmi_bridge_post_disable, .mode_set = hdmi_bridge_mode_set, - .destroy = hdmi_bridge_destroy, };@@ -223,7 +222,7 @@ struct drm_bridge *hdmi_bridge_init(struct hdmi *hdmi) bridge = &hdmi_bridge->base; bridge->funcs = &hdmi_bridge_funcs; -drm_bridge_init (hdmi->dev, bridge); +drm_bridge_attach (hdmi->dev, bridge);return bridge;drivers/gpu/drm/sti/sti_hda.c +1
-9@@ -508,19 +508,12 @@ static void sti_hda_bridge_nope(struct drm_bridge *bridge)/* do nothing */ } -static void sti_hda_brigde_destroy (struct drm_bridge *bridge) -{ -drm_bridge_cleanup (bridge); -kfree (bridge); -} -static const struct drm_bridge_funcs sti_hda_bridge_funcs = { .pre_enable = sti_hda_pre_enable, .enable = sti_hda_bridge_nope, .disable = sti_hda_disable, .post_disable = sti_hda_bridge_nope, .mode_set = sti_hda_set_mode, - .destroy = sti_hda_brigde_destroy, };static int sti_hda_connector_get_modes (struct drm_connector *connector)@@ -665,7 +658,7 @@ static int sti_hda_bind(struct device *dev, struct device *master, void *data) bridge->driver_private = hda; bridge->funcs = &sti_hda_bridge_funcs; -drm_bridge_init (drm_dev, bridge); +drm_bridge_attach (drm_dev, bridge); encoder->bridge = bridge; connector->encoder = encoder;@@ -694,7 +687,6 @@ static int sti_hda_bind(struct device *dev, struct device *master, void *data) err_sysfs:drm_connector_unregister (drm_connector); err_connector: -drm_bridge_cleanup (bridge);drm_connector_cleanup (drm_connector);return -EINVAL ; }drivers/gpu/drm/sti/sti_hdmi.c +1
-9@@ -463,19 +463,12 @@ static void sti_hdmi_bridge_nope(struct drm_bridge *bridge)/* do nothing */ } -static void sti_hdmi_brigde_destroy (struct drm_bridge *bridge) -{ -drm_bridge_cleanup (bridge); -kfree (bridge); -} -static const struct drm_bridge_funcs sti_hdmi_bridge_funcs = { .pre_enable = sti_hdmi_pre_enable, .enable = sti_hdmi_bridge_nope, .disable = sti_hdmi_disable, .post_disable = sti_hdmi_bridge_nope, .mode_set = sti_hdmi_set_mode, - .destroy = sti_hdmi_brigde_destroy, };static int sti_hdmi_connector_get_modes (struct drm_connector *connector)@@ -629,7 +622,7 @@ static int sti_hdmi_bind(struct device *dev, struct device *master, void *data) bridge->driver_private = hdmi; bridge->funcs = &sti_hdmi_bridge_funcs; -drm_bridge_init (drm_dev, bridge); +drm_bridge_attach (drm_dev, bridge); encoder->bridge = bridge; connector->encoder = encoder;@@ -661,7 +654,6 @@ static int sti_hdmi_bind(struct device *dev, struct device *master, void *data) err_sysfs:drm_connector_unregister (drm_connector); err_connector: -drm_bridge_cleanup (bridge);drm_connector_cleanup (drm_connector);return -EINVAL ; }include/drm/bridge/ptn3460.h +8
-0@@ -15,6 +15,7 @@#define _DRM_BRIDGE_PTN3460_H_struct drm_device ; +struct drm_bridge ;struct drm_encoder ;struct i2c_client ;struct device_node ;@@ -23,6 +24,9 @@ struct device_node;int ptn3460_init (struct drm_device *dev,struct drm_encoder *encoder,struct i2c_client *client,struct device_node *node); + +void ptn3460_destroy (struct drm_bridge *bridge); +#else static inline int ptn3460_init(struct drm_device *dev,@@ -32,6 +36,10 @@ static inline int ptn3460_init(struct drm_device *dev,return 0 ; } +static inline void ptn3460_destroy (struct drm_bridge *bridge) +{ +} +#endif #endif include/drm/drm_crtc.h +13
-14@@ -633,15 +633,16 @@ struct drm_plane {/** * drm_bridge_funcs - drm_bridge control functions +* @attach: Called during drm_bridge_attach * @mode_fixup: Try to fixup (or reject entirely) proposed mode for this bridge * @disable: Called right before encoder prepare, disables the bridge * @post_disable: Called right after encoder prepare, for lockstepped disable * @mode_set: Set this mode to the bridge * @pre_enable: Called right before encoder commit, for lockstepped commit * @enable: Called right after encoder commit, enables the bridge -* @destroy: make object go away */ struct drm_bridge_funcs { +int (*attach)(struct drm_bridge *bridge);bool (*mode_fixup)(struct drm_bridge *bridge,const struct drm_display_mode *mode,struct drm_display_mode *adjusted_mode);@@ -652,22 +653,24 @@ struct drm_bridge_funcs { struct drm_display_mode *adjusted_mode);void (*pre_enable)(struct drm_bridge *bridge);void (*enable)(struct drm_bridge *bridge); -void (*destroy)(struct drm_bridge *bridge); };/** * drm_bridge - central DRM bridge control structure * @dev: DRM device this bridge belongs to -* @head: list management +* @of_node: device node pointer to the bridge +* @list: to keep track of all added bridges * @base: base mode object * @funcs: control functions * @driver_private: pointer to the bridge driver's internal context */ struct drm_bridge {struct drm_device *dev; -struct list_head head; - -struct drm_mode_object base; +struct drm_encoder *encoder; +#ifdef CONFIG_OF +struct device_node *of_node; +#endif +struct list_head list;const struct drm_bridge_funcs *funcs;void *driver_private;@@ -733,7 +736,6 @@ struct drm_mode_group {uint32_t num_crtcs;uint32_t num_encoders;uint32_t num_connectors; -uint32_t num_bridges;/* list of object IDs for this group */ uint32_t *id_list;@@ -748,8 +750,6 @@ struct drm_mode_group {* @fb_list: list of framebuffers available * @num_connector: number of connectors on this device * @connector_list: list of connector objects -* @num_bridge: number of bridges on this device -* @bridge_list: list of bridge objects * @num_encoder: number of encoders on this device * @encoder_list: list of encoder objects * @num_crtc: number of CRTCs on this device @@ -789,8 +789,6 @@ struct drm_mode_config {int num_connector;struct list_head connector_list; -int num_bridge; -struct list_head bridge_list;int num_encoder;struct list_head encoder_list;@@ -912,8 +910,10 @@ extern unsigned int drm_connector_index(struct drm_connector *connector);/* helper to unplug all connectors from sysfs for device */ extern void drm_connector_unplug_all (struct drm_device *dev); -extern int drm_bridge_init (struct drm_device *dev,struct drm_bridge *bridge); -extern void drm_bridge_cleanup (struct drm_bridge *bridge); +extern int drm_bridge_add (struct drm_bridge *bridge); +extern void drm_bridge_remove (struct drm_bridge *bridge); +extern struct drm_bridge *of_drm_find_bridge (struct device_node *np); +extern int drm_bridge_attach (struct drm_device *dev,struct drm_bridge *bridge); extern int drm_encoder_init(struct drm_device *dev, struct drm_encoder *encoder, --1.7.9.5
Re: [PATCH V8 03/14] drm/bridge: make bridge registration independent of drm flow
Quoted 620 lines · Ajay kumar
Quoted 619 lines · Ajay Kumar
Currently, third party bridge drivers(ptn3460) are dependent on the corresponding encoder driver init, since bridge driver needs a
drm_devicepointer to finish drm initializations. The encoder driver passes thedrm_devicepointer to the bridge driver. Because of this dependency, third party drivers like ptn3460 doesn't adhere to the driver model.In this patch, we reframe the bridge registration framework so that bridge initialization is split into 2 steps, and bridge registration happens independent of drm flow:
--Step 1: gather all the bridge settings independent of drm and
add the bridge onto a global list of bridges.
--Step 2: when the encoder driver is probed, calldrm_bridge_attach
for the corresponding bridge so that the bridge receivesdrm_devicepointer and continues with connector and other drm initializations.The old set of bridge helpers are removed, and a set of new helpers are added to accomplish the 2 step initialization.
The bridge devices register themselves onto global list of bridges when they get probed by calling "
drm_bridge_add".The parent encoder driver waits till the bridge is available in the lookup
table(by calling "of_drm_find_bridge")and then continues with its initialization.The encoder driver should also call "
drm_bridge_attach" to pass on thedrm_deviceto the bridge object.
drm_bridge_attachinturn calls "bridge->funcs->attach" so that bridge can continue with drm related initializations.Signed-off-by Ajay Kumar <[email protected]>--- drivers/gpu/drm/Makefile | 2 +- drivers/gpu/drm/bridge/ptn3460.c | 27 +++++----- drivers/gpu/drm/drm_bridge.c | 91 ++++++++++++++++++++++++++++++++ drivers/gpu/drm/drm_crtc.c | 65 ----------------------- drivers/gpu/drm/msm/hdmi/hdmi.c | 7 +-- drivers/gpu/drm/msm/hdmi/hdmi.h | 1 + drivers/gpu/drm/msm/hdmi/hdmi_bridge.c | 7 ++- drivers/gpu/drm/sti/sti_hda.c | 10 +--- drivers/gpu/drm/sti/sti_hdmi.c | 10 +--- include/drm/bridge/ptn3460.h | 8 +++ include/drm/drm_crtc.h | 26 ++++----- 11 files changed, 136 insertions(+), 118 deletions(-) create mode 100644 drivers/gpu/drm/drm_bridge.cdrivers/gpu/drm/Makefile +1
-1@@ -14,7 +14,7 @@ drm-y := drm_auth.o drm_bufs.o drm_cache.o \ drm_info.o drm_debugfs.o drm_encoder_slave.o \ drm_trace_points.o drm_global.o drm_prime.o \ drm_rect.o drm_vma_manager.o drm_flip_work.o \ - drm_modeset_lock.o + drm_modeset_lock.o drm_bridge.o drm-$(CONFIG_COMPAT) += drm_ioc32.o drm-$(CONFIG_DRM_GEM_CMA_HELPER) += drm_gem_cma_helper.odrivers/gpu/drm/bridge/ptn3460.c +13
-14@@ -176,24 +176,11 @@ static void ptn3460_post_disable(struct drm_bridge *bridge) { } -static void ptn3460_bridge_destroy (struct drm_bridge *bridge) -{ -struct ptn3460_bridge *ptn_bridge =bridge_to_ptn3460 (bridge); - -drm_bridge_cleanup (bridge); -if (gpio_is_valid (ptn_bridge->gpio_pd_n)) -gpio_free (ptn_bridge->gpio_pd_n); -if (gpio_is_valid (ptn_bridge->gpio_rst_n)) -gpio_free (ptn_bridge->gpio_rst_n); -/* Nothing else to free, we've got devm allocated memory */ -} -static struct drm_bridge_funcs ptn3460_bridge_funcs = { .pre_enable = ptn3460_pre_enable, .enable = ptn3460_enable, .disable = ptn3460_disable, .post_disable = ptn3460_post_disable, - .destroy = ptn3460_bridge_destroy, };static int ptn3460_get_modes (struct drm_connector *connector)@@ -314,7 +301,7 @@ int ptn3460_init(struct drm_device *dev, struct drm_encoder *encoder, } ptn_bridge->bridge.funcs = &ptn3460_bridge_funcs; - ret =drm_bridge_init (dev, &ptn_bridge->bridge); + ret =drm_bridge_attach (dev, &ptn_bridge->bridge);if (ret) {DRM_ERROR ("Failed to initialize bridge with drm\n" ); goto err;@@ -343,3 +330,15 @@ err:return ret; }EXPORT_SYMBOL (ptn3460_init); + +void ptn3460_destroy (struct drm_bridge *bridge) +{ +struct ptn3460_bridge *ptn_bridge = bridge->driver_private; + +if (gpio_is_valid (ptn_bridge->gpio_pd_n)) +gpio_free (ptn_bridge->gpio_pd_n); +if (gpio_is_valid (ptn_bridge->gpio_rst_n)) +gpio_free (ptn_bridge->gpio_rst_n); +/* Nothing else to free, we've got devm allocated memory */ +} +EXPORT_SYMBOL (ptn3460_destroy);drivers/gpu/drm/drm_bridge.c new file +91
-0@@ -0,0 +1,91 @@ +/* +* Copyright (c) 2014 Samsung Electronics Co., Ltd +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sub license, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice (including the +* next paragraph) shall be included in all copies or substantial portions +* of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +*/ + +#include <linux/err.h> +#include <linux/module.h> + +#include <drm/drm_crtc.h> + +#include "drm/drmP.h" + +static DEFINE_MUTEX (bridge_lock); +static LIST_HEAD (bridge_list); + +int drm_bridge_add (struct drm_bridge *bridge) +{ +mutex_lock (&bridge_lock); +list_add_tail (&bridge->list, &bridge_list); +mutex_unlock (&bridge_lock); + +return 0 ; +} +EXPORT_SYMBOL (drm_bridge_add); + +void drm_bridge_remove (struct drm_bridge *bridge) +{ +mutex_lock (&bridge_lock); +list_del_init (&bridge->list); +mutex_unlock (&bridge_lock); +} +EXPORT_SYMBOL (drm_bridge_remove); + +extern int drm_bridge_attach (struct drm_device *dev,struct drm_bridge *bridge) +{ +if (!dev || !bridge) +return -EINVAL ; + +if (bridge->dev) +return -EBUSY ; + + bridge->dev = dev; + +if (bridge->funcs->attach) +return bridge->funcs->attach (bridge); + +return 0 ; +} +EXPORT_SYMBOL (drm_bridge_attach); + +#ifdef CONFIG_OF +struct drm_bridge *of_drm_find_bridge (struct device_node *np) +{ +struct drm_bridge *bridge; + +mutex_lock (&bridge_lock); + +list_for_each_entry (bridge, &bridge_list, list) { +if (bridge->of_node == np) { +mutex_unlock (&bridge_lock); +return bridge; + } + } + +mutex_unlock (&bridge_lock); +return NULL ; +} +EXPORT_SYMBOL (of_drm_find_bridge); +#endif + +MODULE_AUTHOR ("Ajay Kumar <[email protected]>" ); +MODULE_DESCRIPTION ("DRM bridge infrastructure" ); +MODULE_LICENSE ("GPL and additional rights" );drivers/gpu/drm/drm_crtc.c +0
-65@@ -1008,56 +1008,6 @@ void drm_connector_unplug_all(struct drm_device *dev)EXPORT_SYMBOL (drm_connector_unplug_all);/** -* drm_bridge_init - initialize a drm transcoder/bridge -* @dev: drm device -* @bridge: transcoder/bridge to set up -* -* Initialises a preallocated bridge. Bridges should be -* subclassed as part of driver connector objects. -* -* Returns: -* Zero on success, error code on failure. -*/ -int drm_bridge_init (struct drm_device *dev,struct drm_bridge *bridge) -{ -int ret; - -drm_modeset_lock_all (dev); - - ret =drm_mode_object_get (dev, &bridge->base,DRM_MODE_OBJECT_BRIDGE ); -if (ret) - goto out; - - bridge->dev = dev; - -list_add_tail (&bridge->head, &dev->mode_config.bridge_list); - dev->mode_config.num_bridge++; - - out: -drm_modeset_unlock_all (dev); -return ret; -} -EXPORT_SYMBOL (drm_bridge_init); - -/** -* drm_bridge_cleanup - cleans up an initialised bridge -* @bridge: bridge to cleanup -* -* Cleans up the bridge but doesn't free the object. -*/ -void drm_bridge_cleanup (struct drm_bridge *bridge) -{ -struct drm_device *dev = bridge->dev; - -drm_modeset_lock_all (dev); -drm_mode_object_put (dev, &bridge->base); -list_del (&bridge->head); - dev->mode_config.num_bridge--; -drm_modeset_unlock_all (dev); -} -EXPORT_SYMBOL (drm_bridge_cleanup); - -/** * drm_encoder_init - Init a preallocated encoder * @dev: drm device * @encoder: the encoder to init @@ -1539,7 +1489,6 @@ static int drm_mode_group_init(struct drm_device *dev, struct drm_mode_group *gr total_objects += dev->mode_config.num_crtc; total_objects += dev->mode_config.num_connector; total_objects += dev->mode_config.num_encoder; - total_objects += dev->mode_config.num_bridge; group->id_list =kzalloc (total_objects *sizeof (uint32_t ),GFP_KERNEL );if (!group->id_list)@@ -1548,7 +1497,6 @@ static int drm_mode_group_init(struct drm_device *dev, struct drm_mode_group *gr group->num_crtcs =0 ; group->num_connectors =0 ; group->num_encoders =0 ; - group->num_bridges =0 ;return 0 ; }@@ -1568,7 +1516,6 @@ int drm_mode_group_init_legacy_group(struct drm_device *dev,struct drm_crtc *crtc;struct drm_encoder *encoder;struct drm_connector *connector; -struct drm_bridge *bridge;int ret;if ((ret =drm_mode_group_init (dev, group)))@@ -1585,11 +1532,6 @@ int drm_mode_group_init_legacy_group(struct drm_device *dev, group->id_list[group->num_crtcs + group->num_encoders + group->num_connectors++] = connector->base.id; -list_for_each_entry (bridge, &dev->mode_config.bridge_list, head) - group->id_list[group->num_crtcs + group->num_encoders + - group->num_connectors + group->num_bridges++] = - bridge->base.id; -return 0 ; }EXPORT_SYMBOL (drm_mode_group_init_legacy_group);@@ -5088,7 +5030,6 @@ void drm_mode_config_init(struct drm_device *dev)INIT_LIST_HEAD (&dev->mode_config.fb_list);INIT_LIST_HEAD (&dev->mode_config.crtc_list);INIT_LIST_HEAD (&dev->mode_config.connector_list); -INIT_LIST_HEAD (&dev->mode_config.bridge_list);INIT_LIST_HEAD (&dev->mode_config.encoder_list);INIT_LIST_HEAD (&dev->mode_config.property_list);INIT_LIST_HEAD (&dev->mode_config.property_blob_list);@@ -5128,7 +5069,6 @@ void drm_mode_config_cleanup(struct drm_device *dev)struct drm_connector *connector, *ot;struct drm_crtc *crtc, *ct;struct drm_encoder *encoder, *enct; -struct drm_bridge *bridge, *brt;struct drm_framebuffer *fb, *fbt;struct drm_property *property, *pt;struct drm_property_blob *blob, *bt;@@ -5139,11 +5079,6 @@ void drm_mode_config_cleanup(struct drm_device *dev) encoder->funcs->destroy (encoder); } -list_for_each_entry_safe (bridge, brt, - &dev->mode_config.bridge_list, head) { - bridge->funcs->destroy (bridge); - } -list_for_each_entry_safe (connector, ot, &dev->mode_config.connector_list, head) { connector->funcs->destroy (connector);drivers/gpu/drm/msm/hdmi/hdmi.c +4
-3@@ -65,6 +65,9 @@ void hdmi_destroy(struct kref *kref)if (hdmi->i2c)hdmi_i2c_destroy (hdmi->i2c); +if (hdmi->bridge) +hdmi_bridge_destroy (hdmi->bridge); +platform_set_drvdata (hdmi->pdev,NULL ); }@@ -234,9 +237,7 @@ struct hdmi *hdmi_init(struct drm_device *dev, struct drm_encoder *encoder) fail:if (hdmi) { -/* bridge/connector are normally destroyed by drm: */ -if (hdmi->bridge) - hdmi->bridge->funcs->destroy (hdmi->bridge); +/* bridge is normally destroyed by drm: */ if (hdmi->connector) hdmi->connector->funcs->destroy (hdmi->connector);hdmi_destroy (&hdmi->refcount);drivers/gpu/drm/msm/hdmi/hdmi.h +1
-0@@ -163,6 +163,7 @@ void hdmi_audio_set_sample_rate(struct hdmi *hdmi, int rate);*/ struct drm_bridge *hdmi_bridge_init (struct hdmi *hdmi); +void hdmi_bridge_destroy (struct drm_bridge *bridge);/* * hdmi connector: drivers/gpu/drm/msm/hdmi/hdmi_bridge.c +3
-4@@ -23,11 +23,11 @@ struct hdmi_bridge { };#define to_hdmi_bridge (x) container_of(x, struct hdmi_bridge, base) -static void hdmi_bridge_destroy (struct drm_bridge *bridge) +void hdmi_bridge_destroy (struct drm_bridge *bridge) {struct hdmi_bridge *hdmi_bridge =to_hdmi_bridge (bridge); +hdmi_unreference (hdmi_bridge->hdmi); -drm_bridge_cleanup (bridge);kfree (hdmi_bridge); }@@ -201,7 +201,6 @@ static const struct drm_bridge_funcs hdmi_bridge_funcs = { .disable = hdmi_bridge_disable, .post_disable = hdmi_bridge_post_disable, .mode_set = hdmi_bridge_mode_set, - .destroy = hdmi_bridge_destroy, };@@ -223,7 +222,7 @@ struct drm_bridge *hdmi_bridge_init(struct hdmi *hdmi) bridge = &hdmi_bridge->base; bridge->funcs = &hdmi_bridge_funcs; -drm_bridge_init (hdmi->dev, bridge); +drm_bridge_attach (hdmi->dev, bridge);return bridge;drivers/gpu/drm/sti/sti_hda.c +1
-9@@ -508,19 +508,12 @@ static void sti_hda_bridge_nope(struct drm_bridge *bridge)/* do nothing */ } -static void sti_hda_brigde_destroy (struct drm_bridge *bridge) -{ -drm_bridge_cleanup (bridge); -kfree (bridge); -} -static const struct drm_bridge_funcs sti_hda_bridge_funcs = { .pre_enable = sti_hda_pre_enable, .enable = sti_hda_bridge_nope, .disable = sti_hda_disable, .post_disable = sti_hda_bridge_nope, .mode_set = sti_hda_set_mode, - .destroy = sti_hda_brigde_destroy, };static int sti_hda_connector_get_modes (struct drm_connector *connector)@@ -665,7 +658,7 @@ static int sti_hda_bind(struct device *dev, struct device *master, void *data) bridge->driver_private = hda; bridge->funcs = &sti_hda_bridge_funcs; -drm_bridge_init (drm_dev, bridge); +drm_bridge_attach (drm_dev, bridge); encoder->bridge = bridge; connector->encoder = encoder;@@ -694,7 +687,6 @@ static int sti_hda_bind(struct device *dev, struct device *master, void *data) err_sysfs:drm_connector_unregister (drm_connector); err_connector: -drm_bridge_cleanup (bridge);drm_connector_cleanup (drm_connector);return -EINVAL ; }drivers/gpu/drm/sti/sti_hdmi.c +1
-9@@ -463,19 +463,12 @@ static void sti_hdmi_bridge_nope(struct drm_bridge *bridge)/* do nothing */ } -static void sti_hdmi_brigde_destroy (struct drm_bridge *bridge) -{ -drm_bridge_cleanup (bridge); -kfree (bridge); -} -static const struct drm_bridge_funcs sti_hdmi_bridge_funcs = { .pre_enable = sti_hdmi_pre_enable, .enable = sti_hdmi_bridge_nope, .disable = sti_hdmi_disable, .post_disable = sti_hdmi_bridge_nope, .mode_set = sti_hdmi_set_mode, - .destroy = sti_hdmi_brigde_destroy, };static int sti_hdmi_connector_get_modes (struct drm_connector *connector)@@ -629,7 +622,7 @@ static int sti_hdmi_bind(struct device *dev, struct device *master, void *data) bridge->driver_private = hdmi; bridge->funcs = &sti_hdmi_bridge_funcs; -drm_bridge_init (drm_dev, bridge); +drm_bridge_attach (drm_dev, bridge); encoder->bridge = bridge; connector->encoder = encoder;@@ -661,7 +654,6 @@ static int sti_hdmi_bind(struct device *dev, struct device *master, void *data) err_sysfs:drm_connector_unregister (drm_connector); err_connector: -drm_bridge_cleanup (bridge);drm_connector_cleanup (drm_connector);return -EINVAL ; }include/drm/bridge/ptn3460.h +8
-0@@ -15,6 +15,7 @@#define _DRM_BRIDGE_PTN3460_H_struct drm_device ; +struct drm_bridge ;struct drm_encoder ;struct i2c_client ;struct device_node ;@@ -23,6 +24,9 @@ struct device_node;int ptn3460_init (struct drm_device *dev,struct drm_encoder *encoder,struct i2c_client *client,struct device_node *node); + +void ptn3460_destroy (struct drm_bridge *bridge); +#else static inline int ptn3460_init(struct drm_device *dev,@@ -32,6 +36,10 @@ static inline int ptn3460_init(struct drm_device *dev,return 0 ; } +static inline void ptn3460_destroy (struct drm_bridge *bridge) +{ +} +#endif #endif include/drm/drm_crtc.h +13
-14@@ -633,15 +633,16 @@ struct drm_plane {/** * drm_bridge_funcs - drm_bridge control functions +* @attach: Called during drm_bridge_attach * @mode_fixup: Try to fixup (or reject entirely) proposed mode for this bridge * @disable: Called right before encoder prepare, disables the bridge * @post_disable: Called right after encoder prepare, for lockstepped disable * @mode_set: Set this mode to the bridge * @pre_enable: Called right before encoder commit, for lockstepped commit * @enable: Called right after encoder commit, enables the bridge -* @destroy: make object go away */ struct drm_bridge_funcs { +int (*attach)(struct drm_bridge *bridge);bool (*mode_fixup)(struct drm_bridge *bridge,const struct drm_display_mode *mode,struct drm_display_mode *adjusted_mode);@@ -652,22 +653,24 @@ struct drm_bridge_funcs { struct drm_display_mode *adjusted_mode);void (*pre_enable)(struct drm_bridge *bridge);void (*enable)(struct drm_bridge *bridge); -void (*destroy)(struct drm_bridge *bridge); };/** * drm_bridge - central DRM bridge control structure * @dev: DRM device this bridge belongs to -* @head: list management +* @of_node: device node pointer to the bridge +* @list: to keep track of all added bridges * @base: base mode object * @funcs: control functions * @driver_private: pointer to the bridge driver's internal context */ struct drm_bridge {struct drm_device *dev; -struct list_head head; - -struct drm_mode_object base; +struct drm_encoder *encoder; +#ifdef CONFIG_OF +struct device_node *of_node; +#endif +struct list_head list;const struct drm_bridge_funcs *funcs;void *driver_private;@@ -733,7 +736,6 @@ struct drm_mode_group {uint32_t num_crtcs;uint32_t num_encoders;uint32_t num_connectors; -uint32_t num_bridges;/* list of object IDs for this group */ uint32_t *id_list;@@ -748,8 +750,6 @@ struct drm_mode_group {* @fb_list: list of framebuffers available * @num_connector: number of connectors on this device * @connector_list: list of connector objects -* @num_bridge: number of bridges on this device -* @bridge_list: list of bridge objects * @num_encoder: number of encoders on this device * @encoder_list: list of encoder objects * @num_crtc: number of CRTCs on this device @@ -789,8 +789,6 @@ struct drm_mode_config {int num_connector;struct list_head connector_list; -int num_bridge; -struct list_head bridge_list;int num_encoder;struct list_head encoder_list;@@ -912,8 +910,10 @@ extern unsigned int drm_connector_index(struct drm_connector *connector);/* helper to unplug all connectors from sysfs for device */ extern void drm_connector_unplug_all (struct drm_device *dev); -extern int drm_bridge_init (struct drm_device *dev,struct drm_bridge *bridge); -extern void drm_bridge_cleanup (struct drm_bridge *bridge); +extern int drm_bridge_add (struct drm_bridge *bridge); +extern void drm_bridge_remove (struct drm_bridge *bridge); +extern struct drm_bridge *of_drm_find_bridge (struct device_node *np); +extern int drm_bridge_attach (struct drm_device *dev,struct drm_bridge *bridge); extern int drm_encoder_init(struct drm_device *dev, struct drm_encoder *encoder, --1.7.9.5
PATCH v8 4/14 drm/bridge: ptn3460: Convert to i2c driver model
In reply to Ajay KumarUse drm_bridge helpers to modify the driver to support i2c driver model.
--- drivers/gpu/drm/bridge/Kconfig | 2 + drivers/gpu/drm/bridge/ptn3460.c | 124 +++++++++++++++++++++---------- drivers/gpu/drm/exynos/exynos_dp_core.c | 22 ------ 3 files changed, 86 insertions(+), 62 deletions(-)
drivers/gpu/drm/bridge/Kconfig +2 -0
@@ -1,5 +1,7 @@ config DRM_PTN3460 tristate "PTN3460 DP/LVDS bridge" depends on DRM + depends on OF && I2C select DRM_KMS_HELPER ---help--- + ptn3460 eDP-LVDS bridge chip driver.
drivers/gpu/drm/bridge/ptn3460.c +84 -40
197 lines not on this page · raw message
drivers/gpu/drm/exynos/exynos_dp_core.c +0 -22
@@ -988,32 +988,10 @@ static struct drm_connector_helper_funcs exynos_dp_connector_helper_funcs = { .best_encoder = exynos_dp_best_encoder, }; -static bool find_bridge (const char *compat,struct bridge_init *bridge) -{ - bridge->client =NULL ; - bridge->node =of_find_compatible_node (NULL ,NULL , compat); -if (!bridge->node) -return false; - - bridge->client =of_find_i2c_device_by_node (bridge->node); -if (!bridge->client) -return false; - -return true; -} -/* returns the number of bridges attached */ static int exynos_drm_attach_lcd_bridge (struct drm_device *dev,struct drm_encoder *encoder) { -struct bridge_init bridge; -int ret; - -if (find_bridge ("nxp,ptn3460" , &bridge)) { - ret =ptn3460_init (dev, encoder, bridge.client, bridge.node); -if (!ret) -return 1 ; - }return 0 ; }
Signature · 1 line
1.7.9.5
PATCH v8 5/14 drm/exynos: dp: support drm_bridge
In reply to Ajay KumarModify driver to support drm_bridge.
--- .../devicetree/bindings/video/exynos_dp.txt | 12 +++++++ drivers/gpu/drm/exynos/exynos_dp_core.c | 37 ++++++++++++++++---- drivers/gpu/drm/exynos/exynos_dp_core.h | 1 + 3 files changed, 44 insertions(+), 6 deletions(-)
Documentation/devicetree/bindings/video/exynos_dp.txt +12 -0
@@ -66,6 +66,10 @@ Optional properties for dp-controller: Hotplug detect GPIO. Indicates which GPIO should be used for hotplug detection + -video interfaces: Device node can contain video interface port + nodes according to [1]. + +[1]: Documentation/devicetree/bindings/media/video-interfaces.txt Example:
@@ -105,4 +109,12 @@ Board Specific portion: vsync-len = <6>; }; }; + + ports { + port@0 { + dp_out: endpoint { + remote-endpoint = <&bridge_in>; + }; + }; + }; };
drivers/gpu/drm/exynos/exynos_dp_core.c +31 -6
@@ -18,6 +18,7 @@#include <linux/interrupt.h> #include <linux/of.h> #include <linux/of_gpio.h> +#include <linux/of_graph.h> #include <linux/gpio.h> #include <linux/component.h> #include <linux/phy/phy.h>
@@ -989,9 +990,19 @@ static struct drm_connector_helper_funcs exynos_dp_connector_helper_funcs = { };/* returns the number of bridges attached */ -static int exynos_drm_attach_lcd_bridge (struct drm_device *dev, +static int exynos_drm_attach_lcd_bridge (struct exynos_dp_device *dp,struct drm_encoder *encoder) { +int ret; + + encoder->bridge = dp->bridge; + dp->bridge->encoder = encoder; + ret =drm_bridge_attach (encoder->dev, dp->bridge); +if (ret) { +DRM_ERROR ("Failed to attach bridge to drm\n" ); +return ret; + } +return 0 ; }
@@ -1005,9 +1016,11 @@ static int exynos_dp_create_connector(struct exynos_drm_display *display, dp->encoder = encoder;/* Pre-empt DP connector creation if there's a bridge */ - ret =exynos_drm_attach_lcd_bridge (dp->drm_dev, encoder); -if (ret) -return 0 ; +if (dp->bridge) { + ret =exynos_drm_attach_lcd_bridge (dp, encoder); +if (!ret) +return 0 ; + } connector->polled =DRM_CONNECTOR_POLL_HPD ;
@@ -1259,7 +1272,7 @@ static int exynos_dp_bind(struct device *dev, struct device *master, void *data)if (ret)return ret; -if (!dp->panel) { +if (!dp->panel && !dp->bridge) { ret =exynos_dp_dt_parse_panel (dp);if (ret)return ret;
@@ -1345,7 +1358,7 @@ static const struct component_ops exynos_dp_ops = {static int exynos_dp_probe (struct platform_device *pdev) {struct device *dev = &pdev->dev; -struct device_node *panel_node; +struct device_node *panel_node, *bridge_node, *endpoint;struct exynos_dp_device *dp;int ret;
@@ -1367,6 +1380,18 @@ static int exynos_dp_probe(struct platform_device *pdev)return -EPROBE_DEFER ; } + endpoint =of_graph_get_next_endpoint (dev->of_node,NULL ); +if (endpoint) { + bridge_node =of_graph_get_remote_port_parent (endpoint); +if (bridge_node) { + dp->bridge =of_drm_find_bridge (bridge_node); +of_node_put (bridge_node); +if (!dp->bridge) +return -EPROBE_DEFER ; + }else +return -EPROBE_DEFER ; + } + exynos_dp_display.ctx = dp; ret =component_add (&pdev->dev, &exynos_dp_ops);
drivers/gpu/drm/exynos/exynos_dp_core.h +1 -0
@@ -150,6 +150,7 @@ struct exynos_dp_device {struct drm_connector connector;struct drm_encoder *encoder;struct drm_panel *panel; +struct drm_bridge *bridge;struct clk *clock;unsigned int irq;void __iomem *reg_base;
Signature · 1 line
1.7.9.5
PATCH v8 6/14 drm/bridge: ptn3460: support drm_panel
In reply to Ajay KumarAdd drm_panel calls to the driver to make the panel and bridge work together in tandem.
--- .../devicetree/bindings/drm/bridge/ptn3460.txt | 12 ++++++ drivers/gpu/drm/bridge/Kconfig | 1 + drivers/gpu/drm/bridge/ptn3460.c | 42 ++++++++++++++++++++ 3 files changed, 55 insertions(+)
Documentation/devicetree/bindings/drm/bridge/ptn3460.txt +12 -0
@@ -17,6 +17,11 @@ Required properties: | 6 | 1600x900 | ChiMei M215HGE | +-------+------------+------------------+ + - video interfaces: Device node can contain video interface port + nodes for panel according to [1]. + +[1]: Documentation/devicetree/bindings/media/video-interfaces.txt + Example: lvds-bridge@20 { compatible = "nxp,ptn3460";
@@ -24,4 +29,11 @@ Example: powerdown-gpio = <&gpy2 5 1 0 0>; reset-gpio = <&gpx1 5 1 0 0>; edid-emulation = <5>; + ports { + port@0 { + bridge_out: endpoint { + remote-endpoint = <&panel_in>; + }; + }; + }; };
drivers/gpu/drm/bridge/Kconfig +1 -0
@@ -3,5 +3,6 @@ config DRM_PTN3460 depends on DRM depends on OF && I2C select DRM_KMS_HELPER + select DRM_PANEL ---help--- ptn3460 eDP-LVDS bridge chip driver.
drivers/gpu/drm/bridge/ptn3460.c +42 -0
102 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH v8 7/14 drm/bridge: ptn3460: probe connector at the end of bridge attach
In reply to Ajay KumarForce bridge connector detection at the end of the bridge attach. This is needed to detect the bridge connector early.
--- drivers/gpu/drm/bridge/ptn3460.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/bridge/ptn3460.c +3 -0
@@ -281,6 +281,7 @@ int ptn3460_bridge_attach(struct drm_bridge *bridge)return -ENODEV ; } + ptn_bridge->connector.polled =DRM_CONNECTOR_POLL_HPD ; ret =drm_connector_init (bridge->dev, &ptn_bridge->connector, &ptn3460_connector_funcs,DRM_MODE_CONNECTOR_LVDS );if (ret) {
@@ -296,6 +297,8 @@ int ptn3460_bridge_attach(struct drm_bridge *bridge)if (ptn_bridge->panel)drm_panel_attach (ptn_bridge->panel, &ptn_bridge->connector); +drm_helper_hpd_irq_event (ptn_bridge->connector.dev); +return ret; }
Signature · 1 line
1.7.9.5
PATCH v8 8/14 drm/bridge: ptn3460: use gpiod interface
In reply to Ajay KumarModify driver to support gpiod interface.
--- drivers/gpu/drm/bridge/ptn3460.c | 88 ++++++++++++++++---------------------- 1 file changed, 36 insertions(+), 52 deletions(-)
drivers/gpu/drm/bridge/ptn3460.c +36 -52
@@ -42,8 +42,8 @@ struct ptn3460_bridge {struct drm_bridge bridge;struct edid *edid;struct drm_panel *panel; -int gpio_pd_n; -int gpio_rst_n; +struct gpio_desc *gpio_pd_n; +struct gpio_desc *gpio_rst_n;u32 edid_emulation;bool enabled; };
@@ -132,14 +132,11 @@ static void ptn3460_pre_enable(struct drm_bridge *bridge)if (ptn_bridge->enabled)return ; -if (gpio_is_valid (ptn_bridge->gpio_pd_n)) -gpio_set_value (ptn_bridge->gpio_pd_n,1 ); +gpiod_set_value (ptn_bridge->gpio_pd_n,1 ); -if (gpio_is_valid (ptn_bridge->gpio_rst_n)) { -gpio_set_value (ptn_bridge->gpio_rst_n,0 ); -usleep_range (10 ,20 ); -gpio_set_value (ptn_bridge->gpio_rst_n,1 ); - } +gpiod_set_value (ptn_bridge->gpio_rst_n,0 ); +usleep_range (10 ,20 ); +gpiod_set_value (ptn_bridge->gpio_rst_n,1 );if (drm_panel_prepare (ptn_bridge->panel)) {DRM_ERROR ("failed to prepare panel\n" );
@@ -184,11 +181,8 @@ static void ptn3460_disable(struct drm_bridge *bridge)return ; } -if (gpio_is_valid (ptn_bridge->gpio_rst_n)) -gpio_set_value (ptn_bridge->gpio_rst_n,1 ); - -if (gpio_is_valid (ptn_bridge->gpio_pd_n)) -gpio_set_value (ptn_bridge->gpio_pd_n,0 ); +gpiod_set_value (ptn_bridge->gpio_rst_n,1 ); +gpiod_set_value (ptn_bridge->gpio_pd_n,0 ); }static void ptn3460_post_disable (struct drm_bridge *bridge)
@@ -335,39 +329,41 @@ static int ptn3460_probe(struct i2c_client *client, } ptn_bridge->client = client; - ptn_bridge->gpio_pd_n =of_get_named_gpio (dev->of_node, -"powerdown-gpio" ,0 ); -if (gpio_is_valid (ptn_bridge->gpio_pd_n)) { - ret =gpio_request_one (ptn_bridge->gpio_pd_n, -GPIOF_OUT_INIT_HIGH ,"PTN3460_PD_N" ); -if (ret) { -dev_err (dev,"Request powerdown-gpio failed (%d)\n" , - ret); -return ret; - } + + ptn_bridge->gpio_pd_n =devm_gpiod_get (&client->dev,"powerdown" ); +if (IS_ERR (ptn_bridge->gpio_pd_n)) { + ret =PTR_ERR (ptn_bridge->gpio_pd_n); +dev_err (dev,"cannot get gpio_pd_n %d\n" , ret); +return ret; } - ptn_bridge->gpio_rst_n =of_get_named_gpio (dev->of_node, -"reset-gpio" ,0 ); -if (gpio_is_valid (ptn_bridge->gpio_rst_n)) { -/* -* Request the reset pin low to avoid the bridge being -* initialized prematurely -*/ - ret =gpio_request_one (ptn_bridge->gpio_rst_n, -GPIOF_OUT_INIT_LOW ,"PTN3460_RST_N" ); -if (ret) { -dev_err (dev,"Request reset-gpio failed (%d)\n" , ret); -gpio_free (ptn_bridge->gpio_pd_n); -return ret; - } + ret =gpiod_direction_output (ptn_bridge->gpio_pd_n,1 ); +if (ret) { +DRM_ERROR ("cannot configure gpio_pd_n\n" ); +return ret; + } + + ptn_bridge->gpio_rst_n =devm_gpiod_get (&client->dev,"reset" ); +if (IS_ERR (ptn_bridge->gpio_rst_n)) { + ret =PTR_ERR (ptn_bridge->gpio_rst_n); +DRM_ERROR ("cannot get gpio_rst_n %d\n" , ret); +return ret; + } +/* +* Request the reset pin low to avoid the bridge being +* initialized prematurely +*/ + ret =gpiod_direction_output (ptn_bridge->gpio_rst_n,0 ); +if (ret) { +DRM_ERROR ("cannot configure gpio_rst_n\n" ); +return ret; } ret =of_property_read_u32 (dev->of_node,"edid-emulation" , &ptn_bridge->edid_emulation);if (ret) {dev_err (dev,"Can't read EDID emulation value\n" ); - goto err; +return ret; } ptn_bridge->bridge.funcs = &ptn3460_bridge_funcs;
@@ -375,19 +371,12 @@ static int ptn3460_probe(struct i2c_client *client, ret =drm_bridge_add (&ptn_bridge->bridge);if (ret) {DRM_ERROR ("Failed to add bridge\n" ); - goto err; +return ret; }i2c_set_clientdata (client, ptn_bridge);return 0 ; - -err: -if (gpio_is_valid (ptn_bridge->gpio_pd_n)) -gpio_free (ptn_bridge->gpio_pd_n); -if (gpio_is_valid (ptn_bridge->gpio_rst_n)) -gpio_free (ptn_bridge->gpio_rst_n); -return ret; }static int ptn3460_remove (struct i2c_client *client)
@@ -396,11 +385,6 @@ static int ptn3460_remove(struct i2c_client *client)drm_bridge_remove (&ptn_bridge->bridge); -if (gpio_is_valid (ptn_bridge->gpio_pd_n)) -gpio_free (ptn_bridge->gpio_pd_n); -if (gpio_is_valid (ptn_bridge->gpio_rst_n)) -gpio_free (ptn_bridge->gpio_rst_n); -return 0 ; }
Signature · 1 line
1.7.9.5
PATCH v8 9/14 Documentation: drm: bridge: move to video/bridge
In reply to Ajay KumarMove drm/bridge documentation to video/bridge. Also, add proper documentation for gpios used by ptn3460.
--- .../devicetree/bindings/drm/bridge/ptn3460.txt | 39 -------------------- .../devicetree/bindings/video/bridge/ptn3460.txt | 39 ++++++++++++++++++++ 2 files changed, 39 insertions(+), 39 deletions(-) delete mode 100644 Documentation/devicetree/bindings/drm/bridge/ptn3460.txt create mode 100644 Documentation/devicetree/bindings/video/bridge/ptn3460.txt
Documentation/devicetree/bindings/drm/bridge/ptn3460.txt deleted +0 -39
@@ -1,39 +0,0 @@ -ptn3460 bridge bindings - -Required properties: - - compatible: "nxp,ptn3460" - - reg: i2c address of the bridge - - powerdown-gpio: OF device-tree gpio specification - - reset-gpio: OF device-tree gpio specification - - edid-emulation: The EDID emulation entry to use - +-------+------------+------------------+ - | Value | Resolution | Description | - | 0 | 1024x768 | NXP Generic | - | 1 | 1920x1080 | NXP Generic | - | 2 | 1920x1080 | NXP Generic | - | 3 | 1600x900 | Samsung LTM200KT | - | 4 | 1920x1080 | Samsung LTM230HT | - | 5 | 1366x768 | NXP Generic | - | 6 | 1600x900 | ChiMei M215HGE | - +-------+------------+------------------+ - - - video interfaces: Device node can contain video interface port - nodes for panel according to [1]. - -[1]: Documentation/devicetree/bindings/media/video-interfaces.txt - -Example: - lvds-bridge@20 { - compatible = "nxp,ptn3460"; - reg = <0x20>; - powerdown-gpio = <&gpy2 5 1 0 0>; - reset-gpio = <&gpx1 5 1 0 0>; - edid-emulation = <5>; - ports { - port@0 { - bridge_out: endpoint { - remote-endpoint = <&panel_in>; - }; - }; - }; - };
Documentation/devicetree/bindings/video/bridge/ptn3460.txt new file +39 -0
@@ -0,0 +1,39 @@ +ptn3460 bridge bindings + +Required properties: + - compatible: "nxp,ptn3460" + - reg: i2c address of the bridge + - powerdown-gpio: OF device-tree gpio specification for PD_N pin. + - reset-gpio: OF device-tree gpio specification for RST_N pin. + - edid-emulation: The EDID emulation entry to use + +-------+------------+------------------+ + | Value | Resolution | Description | + | 0 | 1024x768 | NXP Generic | + | 1 | 1920x1080 | NXP Generic | + | 2 | 1920x1080 | NXP Generic | + | 3 | 1600x900 | Samsung LTM200KT | + | 4 | 1920x1080 | Samsung LTM230HT | + | 5 | 1366x768 | NXP Generic | + | 6 | 1600x900 | ChiMei M215HGE | + +-------+------------+------------------+ + + - video interfaces: Device node can contain video interface port + nodes for panel according to [1]. + +[1]: Documentation/devicetree/bindings/media/video-interfaces.txt + +Example: + lvds-bridge@20 { + compatible = "nxp,ptn3460"; + reg = <0x20>; + powerdown-gpio = <&gpy2 5 1 0 0>; + reset-gpio = <&gpx1 5 1 0 0>; + edid-emulation = <5>; + ports { + port@0 { + bridge_out: endpoint { + remote-endpoint = <&panel_in>; + }; + }; + }; + };
Signature · 1 line
1.7.9.5
PATCH v8 10/14 Documentation: devicetree: Add vendor prefix for parade
In reply to Ajay Kumarps8622 eDP-LVDS converter bridge chip is from parade technologies
--- .../devicetree/bindings/vendor-prefixes.txt | 1 + 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/vendor-prefixes.txt +1 -0
@@ -110,6 +110,7 @@ nxp NXP Semiconductors onnn ON Semiconductor Corp. opencores OpenCores.org panasonic Panasonic Corporation +parade Parade Technologies Inc. phytec PHYTEC Messtechnik GmbH picochip Picochip Ltd plathome Plat'Home Co., Ltd.
Signature · 1 line
1.7.9.5
PATCH v8 11/14 Documentation: bridge: Add documentation for ps8622 DT properties
In reply to Ajay KumarAdd documentation for DT properties supported by ps8622/ps8625 eDP-LVDS converter.
--- .../devicetree/bindings/video/bridge/ps8622.txt | 31 ++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Documentation/devicetree/bindings/video/bridge/ps8622.txt
Documentation/devicetree/bindings/video/bridge/ps8622.txt new file +31 -0
@@ -0,0 +1,31 @@ +ps8622-bridge bindings + +Required properties: + - compatible: "parade,ps8622" or "parade,ps8625" + - reg: first i2c address of the bridge + - sleep-gpios: OF device-tree gpio specification for PD_ pin. + - reset-gpios: OF device-tree gpio specification for RST_ pin. + +Optional properties: + - lane-count: number of DP lanes to use + - use-external-pwm: backlight will be controlled by an external PWM + - video interfaces: Device node can contain video interface port + nodes for panel according to [1]. + +[1]: Documentation/devicetree/bindings/media/video-interfaces.txt + +Example: + lvds-bridge@48 { + compatible = "parade,ps8622"; + reg = <0x48>; + sleep-gpios = <&gpc3 6 1 0 0>; + reset-gpios = <&gpc3 1 1 0 0>; + lane-count = <1>; + ports { + port@0 { + bridge_out: endpoint { + remote-endpoint = <&panel_in>; + }; + }; + }; + };
Signature · 1 line
1.7.9.5
PATCH v8 12/14 drm/bridge: Add i2c based driver for ps8622/ps8625 bridge
In reply to Ajay KumarFrom: Vincent Palatin <[email protected]>
This patch adds drm_bridge driver for parade DisplayPort to LVDS bridge chip.
--- drivers/gpu/drm/bridge/Kconfig | 9 + drivers/gpu/drm/bridge/Makefile | 1 + drivers/gpu/drm/bridge/ps8622.c | 684 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 694 insertions(+) create mode 100644 drivers/gpu/drm/bridge/ps8622.c
drivers/gpu/drm/bridge/Kconfig +9 -0
@@ -6,3 +6,12 @@ config DRM_PTN3460 select DRM_PANEL ---help--- ptn3460 eDP-LVDS bridge chip driver. + +config DRM_PS8622 + tristate "Parade eDP/LVDS bridge" + depends on OF && I2C + select DRM_PANEL + select BACKLIGHT_LCD_SUPPORT + select BACKLIGHT_CLASS_DEVICE + ---help--- + parade eDP-LVDS bridge chip driver.
drivers/gpu/drm/bridge/Makefile +1 -0
@@ -1,3 +1,4 @@ ccflags-y := -Iinclude/drm +obj-$(CONFIG_DRM_PS8622) += ps8622.o obj-$(CONFIG_DRM_PTN3460) += ptn3460.o
drivers/gpu/drm/bridge/ps8622.c new file +684 -0
684 lines not on this page · raw message
Signature · 1 line
1.7.9.5
PATCH v8 13/14 ARM: dts: snow: represent the connection between bridge and panel using videoport and endpoints
In reply to Ajay KumarDefine videoports and use endpoints to describe the connection between the encoder, bridge and the panel, instead of using phandles.
--- arch/arm/boot/dts/exynos5250-snow.dts | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-)
arch/arm/boot/dts/exynos5250-snow.dts +28 -2
@@ -254,7 +254,20 @@ powerdown-gpios = <&gpy2 5 GPIO_ACTIVE_HIGH>; reset-gpios = <&gpx1 5 GPIO_ACTIVE_HIGH>; edid-emulation = <5>; - panel = <&panel>; + + ports { + port@0 { + bridge_out: endpoint { + remote-endpoint = <&panel_in>; + }; + }; + + port@1 { + bridge_in: endpoint { + remote-endpoint = <&dp_out>; + }; + }; + }; }; };
@@ -328,6 +341,12 @@ compatible = "auo,b116xw03"; power-supply = <&fet6>; backlight = <&backlight>; + + port { + panel_in: endpoint { + remote-endpoint = <&bridge_out>; + }; + }; }; dp-controller@145B0000 {
@@ -341,7 +360,14 @@ samsung,link-rate = <0x0a>; samsung,lane-count = <2>; samsung,hpd-gpio = <&gpx0 7 0>; - bridge = <&ptn3460>; + + ports { + port@0 { + dp_out: endpoint { + remote-endpoint = <&bridge_in>; + }; + }; + }; }; };
Signature · 1 line
1.7.9.5
PATCH v8 14/14 ARM: dts: peach-pit: represent the connection between bridge and panel using videoport and endpoints
In reply to Ajay KumarDefine videoports and use endpoints to describe the connection between the encoder, bridge and the panel, instead of using phandles.
--- arch/arm/boot/dts/exynos5420-peach-pit.dts | 31 ++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-)
arch/arm/boot/dts/exynos5420-peach-pit.dts +29 -2
@@ -107,6 +107,12 @@ compatible = "auo,b116xw03"; power-supply = <&tps65090_fet6>; backlight = <&backlight>; + + port { + panel_in: endpoint { + remote-endpoint = <&bridge_out>; + }; + }; }; };
@@ -126,7 +132,14 @@ samsung,link-rate = <0x06>; samsung,lane-count = <2>; samsung,hpd-gpio = <&gpx2 6 0>; - bridge = <&ps8625>; + + ports { + port@0 { + dp_out: endpoint { + remote-endpoint = <&bridge_in>; + }; + }; + }; }; &fimd {
@@ -504,8 +517,22 @@ sleep-gpios = <&gpx3 5 GPIO_ACTIVE_HIGH>; reset-gpios = <&gpy7 7 GPIO_ACTIVE_HIGH>; lane-count = <2>; - panel = <&panel>; use-external-pwm; + + ports { + port@0 { + bridge_out: endpoint { + remote-endpoint = <&panel_in>; + }; + }; + + port@1 { + bridge_in: endpoint { + remote-endpoint = <&dp_out>; + }; + }; + }; + }; };
Signature · 1 line
1.7.9.5
Quoted 121 lines · Ajay Kumar
This series is based on master branch of Linus tree at:
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.gitChanges since V2:
-- Address comments from Jingoo Han for ps8622 driver -- Address comments from Daniel, Rob and Thierry regarding
bridge chaining
-- Address comments from Thierry regarding the names for
newdrm_panelfunctionsChanges since V3:
-- Remove hotplug based initialization ofexynos_dp-- Makeexynos_dpwork directly withdrm_panel, remove
dependency onpanel_binder
-- Minor cleanups inpanel_binderandpanel_lvdsdriverChanges since V4:
-- Use gpiod interface for panel-lvds and ps8622 drivers. -- Address comments from Javier.
-- Fix compilation issues whenPANEL_BINDERis selected as module. -- Split Documentation patches from driver patches.
-- Rebase on top of the tree.Changes since V5:
-- Modify bridge drivers to support driver model.
-- Drop the concept of bridge chain(sincle there are no 2 real bridges)
Hence drop bridge-panel_binder layer.
-- Drop panel-lvds driver and accomodate the required changes in
panel-simple driver.
-- Use gpiod interface in ptn3460 driver.
-- Address all comments by Thierry Reding for V5 series. -- Address comments from Sean Paul forexynos_dp_commitissue.Changes since V6:
-- Panel patches were seperated and they are merged already. -- Fix few issues with ptn3460, before modifying the bridge core. -- Modifydrm_bridgeas per Thierry's comments for V6 series. -- Adddrm_bridgechanges minimally without breaking existing code. -- Add new features for ptn3460, step-by-step.
-- Address comments from Thierry and Andreas for ptn3460 and ps8622. -- Split documentation patches from driver patches.Changes since V7:
-- Address comments from Tomi and Laurent:
-- Use videoports and endpoints to represent the connection between
encoder, bridge and the panel, instead of using phandles.
-- Address comments from Daniel:
-- Make the patch description more descriptive.
-- remove device pointer fromdrm_bridge, and just use
device_nodeinstead.
-- don't pass encoder pointer tobridge_attach.
-- Address comments from Sean Paul:
-- Remove bridge frommode_config, and pull outdrm_bridge
functions fromdrm_crtc.ctodrm_bridge.cNote: This patchset creates the following
Kconfigambiguity.
Any pointers to fix the same are welcome.drivers/video/fbdev/Kconfig:5:error: recursive dependency detected!
drivers/video/fbdev/Kconfig:5: symbol FB is selected by DRM_KMS_FB_HELPER drivers/gpu/drm/Kconfig:34: symbol DRM_KMS_FB_HELPER depends on DRM_KMS_HELPER drivers/gpu/drm/Kconfig:28: symbol DRM_KMS_HELPER is selected by DRM_PTN3460
drivers/gpu/drm/bridge/Kconfig:1: symbolDRM_PTN3460depends on I2Cdrivers/i2c/Kconfig:7: symbol I2C is selected byFB_DDCdrivers/video/fbdev/Kconfig:59: symbolFB_DDCis selected byFB_CYBER2000_DDCdrivers/video/fbdev/Kconfig:374: symbolFB_CYBER2000_DDCdepends onFB_CYBER2000drivers/video/fbdev/Kconfig:362: symbolFB_CYBER2000depends on FBAjay Kumar (13):
[PATCH V8 1/14] drm/bridge: ptn3460: Few trivial cleanups
[PATCH V8 2/14] drm/bridge: do not passdrm_bridge_funcstodrm_bridge_init[PATCH V8 3/14] drm/bridge: make bridge registration independent of drm flow [PATCH V8 4/14] drm/bridge: ptn3460: Convert to i2c driver model [PATCH V8 5/14] drm/exynos: dp: supportdrm_bridge
[PATCH V8 6/14] drm/bridge: ptn3460: supportdrm_panel
[PATCH V8 7/14] drm/bridge: ptn3460: probe connector at the end of bridge attach [PATCH V8 8/14] drm/bridge: ptn3460: use gpiod interface
[PATCH V8 9/14] Documentation: drm: bridge: move to video/bridge [PATCH V8 10/14] Documentation: devicetree: Add vendor prefix for parade [PATCH V8 11/14] Documentation: bridge: Add documentation for ps8622 DT properties [PATCH V8 13/14] ARM: dts: snow: represent the connection between bridge and panel
using videoport and endpoints
[PATCH V8 14/14] ARM: dts: peach-pit: represent the connection between bridge and
panel using videoport and endpointsVincent Palatin (1):
[PATCH V8 12/14] drm/bridge: Add i2c based driver for ps8622/ps8625 bridge.../devicetree/bindings/drm/bridge/ptn3460.txt | 27 - .../devicetree/bindings/vendor-prefixes.txt | 1 + .../devicetree/bindings/video/bridge/ps8622.txt | 31 + .../devicetree/bindings/video/bridge/ptn3460.txt | 39 ++ .../devicetree/bindings/video/exynos_dp.txt | 12 + arch/arm/boot/dts/exynos5250-snow.dts | 30 +- arch/arm/boot/dts/exynos5420-peach-pit.dts | 31 +- drivers/gpu/drm/Makefile | 2 +- drivers/gpu/drm/bridge/Kconfig | 12 + drivers/gpu/drm/bridge/Makefile | 1 + drivers/gpu/drm/bridge/ps8622.c | 684 ++++++++++++++++++++ drivers/gpu/drm/bridge/ptn3460.c | 310 +++++---- drivers/gpu/drm/drm_bridge.c | 91 +++ drivers/gpu/drm/drm_crtc.c | 68 -- drivers/gpu/drm/exynos/exynos_dp_core.c | 53 +- drivers/gpu/drm/exynos/exynos_dp_core.h | 1 + drivers/gpu/drm/msm/hdmi/hdmi.c | 7 +- drivers/gpu/drm/msm/hdmi/hdmi.h | 1 + drivers/gpu/drm/msm/hdmi/hdmi_bridge.c | 8 +- drivers/gpu/drm/sti/sti_hda.c | 11 +- drivers/gpu/drm/sti/sti_hdmi.c | 11 +- include/drm/bridge/ptn3460.h | 8 + include/drm/drm_crtc.h | 27 +- 23 files changed, 1184 insertions(+), 282 deletions(-) delete mode 100644 Documentation/devicetree/bindings/drm/bridge/ptn3460.txt create mode 100644 Documentation/devicetree/bindings/video/bridge/ps8622.txt create mode 100644 Documentation/devicetree/bindings/video/bridge/ptn3460.txt create mode 100644 drivers/gpu/drm/bridge/ps8622.c create mode 100644 drivers/gpu/drm/drm_bridge.c--
1.7.9.5
Hello Ajay,
Quoted 3 lines · Ajay kumar
Quoted 2 lines · Ajay Kumar
This series is based on master branch of Linus tree at:
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
I applied your series on top of 3.18-rc5 + linux-next's commit:
0ef76ae ("ARM: exynos_defconfig: Enable options for display panel support").
I think you should had mentioned what other patches are needed as a dependency since I spent quite a bit of time figuring out why the ps8622 bridge driver probe was always deferred due of_drm_find_panel() failing and then I noticed that a patch from linux-next was needed:
e35e305 ("drm/panel: simple: Add AUO B116XW03 panel support")
With that commit the ps8622 drm bridge driver probe succeed but I still don't have display working on an Exynos5240 Peach Pit, the kernel log shows:
platform 145b0000.dp-controller: Driver exynos-dp requests probe deferral exynos-drm exynos-drm: bound 14400000.fimd (ops fimd_component_ops) exynos-drm exynos-drm: failed to bind 145b0000.dp-controller (ops exynos_dp_ops): -517 exynos-drm exynos-drm: master bind failed: -517
platform 145b0000.dp-controller: Driver exynos-dp requests probe deferral
Any idea what else I could be missing here?
Your patches don't apply cleanly in linux-next btw, although the are many issues with the Exynos DRM currently in linux-next anyways so probably using 3.18-rc as a base makes more sense for now until all those things get fixed but you should rebase so they can be picked.
Best regards,
Javier
Hi Javier,
In the cover letter, I have mentioned that it is tested on Linus tree:
"This series is based on master branch of Linus tree at:git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git"
Kindly test the patches with that.
Ajay
Quoted 36 lines · Javier Martinez Canillas
Hello Ajay,
Quoted 3 lines · Ajay kumar
Quoted 2 lines · Ajay Kumar
This series is based on master branch of Linus tree at:
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.gitI applied your series on top of 3.18-rc5 + linux-next's commit:
0ef76ae ("ARM:
exynos_defconfig: Enable options for display panel support").I think you should had mentioned what other patches are needed as a dependency since I spent quite a bit of time figuring out why the ps8622 bridge driver probe was always deferred due
of_drm_find_panel()failing and then I noticed that a patch from linux-next was needed:e35e305 ("drm/panel: simple: Add AUO B116XW03 panel support")
With that commit the ps8622 drm bridge driver probe succeed but I still don't have display working on an Exynos5240 Peach Pit, the kernel log shows:
platform 145b0000.dp-controller: Driver exynos-dp requests probe deferral exynos-drm exynos-drm: bound 14400000.fimd (ops
fimd_component_ops) exynos-drm exynos-drm: failed to bind 145b0000.dp-controller (opsexynos_dp_ops): -517 exynos-drm exynos-drm: master bind failed: -517
platform 145b0000.dp-controller: Driver exynos-dp requests probe deferralAny idea what else I could be missing here?
Your patches don't apply cleanly in linux-next btw, although the are many issues with the Exynos DRM currently in linux-next anyways so probably using 3.18-rc as a base makes more sense for now until all those things get fixed but you should rebase so they can be picked.
Best regards,
Javier
Hello Ajay,
Quoted 9 lines · Ajay kumar
Hi Javier,
In the cover letter, I have mentioned that it is tested on Linus tree:
"This series is based on master branch of Linus tree at:
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git"Kindly test the patches with that.
That's what I did... Linus' master branch is a moving target and if you look at his current HEAD, it is commit fc14f9c1 ("Linux 3.18-rc5") but as I said before, at least two patches that are needed didn't land in Linus' tree yet. These are:
0ef76ae ("ARM: exynos_defconfig: Enable options for display panel support") e35e305 ("drm/panel: simple: Add AUO B116XW03 panel support")
IOW, linux.git master branch + this series is not enough to have display working AFAICT so I was wondering if I'm missing something else.
Do you have a public tree somewhere with the branch you are using to test?
Best regards,
Javier
Quoted 18 lines · Javier Martinez Canillas
Hello Ajay,
Quoted 3 lines · Ajay kumar
Quoted 2 lines · Ajay Kumar
This series is based on master branch of Linus tree at:
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.gitI applied your series on top of 3.18-rc5 + linux-next's commit:
0ef76ae ("ARM:
exynos_defconfig: Enable options for display panel support").I think you should had mentioned what other patches are needed as a dependency since I spent quite a bit of time figuring out why the ps8622 bridge driver probe was always deferred due
of_drm_find_panel()failing and then I noticed that a patch from linux-next was needed:e35e305 ("drm/panel: simple: Add AUO B116XW03 panel support")
Quoted 8 lines
With that commit the ps8622 drm bridge driver probe succeed but I still don't have display working on an Exynos5240 Peach Pit, the kernel log shows:
platform 145b0000.dp-controller: Driver exynos-dp requests probe deferral exynos-drm exynos-drm: bound 14400000.fimd (ops
fimd_component_ops) exynos-drm exynos-drm: failed to bind 145b0000.dp-controller (opsexynos_dp_ops): -517 exynos-drm exynos-drm: master bind failed: -517
platform 145b0000.dp-controller: Driver exynos-dp requests probe deferral
do you have this in your dmesg?
...
exynos-dp-video-phy 10040728.video-phy: Failed to lookup PMU regmap
...
to get a working framebuffer out of linus 318rc4 on my peach pi, i had to cherry pick these 3 patches:
arm: dts: Exynos5: Use pmu_system_controller phandle for dp phy drm/exynos: dp: Remove support for unused dptx-phy
ARM: exynos_defconfig: Enable options for display panel support
Check if you have those.
Signature · 2 lines
bye, p.
Javier Martinez Canillas
Tested-byHello Paolo,
Quoted 4 lines · Paolo Pisati
to get a working framebuffer out of linus 318rc4 on my peach pi, i had to cherry pick these 3 patches:
arm: dts: Exynos5: Use
pmu_system_controllerphandle for dp phy
I was missing this patch, I've display working now. Thanks for the pointer!
If someone else is interested, I've pushed a branch [0] with 3.18-rc5 + all the needed patches.
Ajay, feel free to add to your series:
Best regards,
Javier
[0]: git://git.collabora.co.uk/git/user/javier/linux.git wip/exynos/dp-integ
Quoted 4 lines · Javier Martinez Canillas
If someone else is interested, I've pushed a branch [0] with 3.18-rc5 + all the needed patches.
Quoted 8 lines
Ajay, feel free to add to your series:
Best regards,
Javier[0]:
git://git.collabora.co.uk/git/user/javier/linux.gitwip/exynos/dp-integ
doesn't peach pi require the same dts modification as peach pit/snow?
Signature · 2 lines
bye, p.
Hello Paolo,
Quoted 7 lines · Paolo Pisati
Quoted 6 lines · Javier Martinez Canillas
If someone else is interested, I've pushed a branch [0] with 3.18-rc5 + all the needed patches.
Ajay, feel free to add to your series:
Quoted 9 lines
Quoted 6 lines
Best regards,
Javier[0]:
git://git.collabora.co.uk/git/user/javier/linux.gitwip/exynos/dp-integdoesn't peach pi require the same dts modification as peach pit/snow?
No, because the Peach Pit and Snow have an eDP to LVDS bridge chip but the Peach Pi does not have a bridge. Ajay's series is to add DRM bridge support to Exynos Display Port driver and so is only relevant to Snow and Pit.
Best regards,
Javier
Am 19.11.2014 um 17:28 schrieb Javier Martinez Canillas:
Quoted 13 lines · Paolo Pisati
Quoted 12 lines · Javier Martinez Canillas
Quoted 11 lines
If someone else is interested, I've pushed a branch [0] with 3.18-rc5 + all the needed patches.
Ajay, feel free to add to your series:
Best regards,
Javier
Quoted 8 lines
Quoted 4 lines
Quoted 1 line
[0]:
git://git.collabora.co.uk/git/user/javier/linux.gitwip/exynos/dp-integdoesn't peach pi require the same dts modification as peach pit/snow?
No, because the Peach Pit and Snow have an eDP to LVDS bridge chip but the Peach Pi does not have a bridge. Ajay's series is to add DRM bridge support to Exynos Display Port driver and so is only relevant to Snow and Pit.
... and to Spring.
So, what's the timing here - is this series headed for 3.20 now or 3.19?
Regards,
Andreas
Signature · 2 lines
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 21284 AG Nürnberg
Quoted 34 lines · Paolo Pisati
Quoted 18 lines · Javier Martinez Canillas
Hello Ajay,
Quoted 3 lines · Ajay kumar
Quoted 2 lines · Ajay Kumar
This series is based on master branch of Linus tree at:
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.gitI applied your series on top of 3.18-rc5 + linux-next's commit:
0ef76ae ("ARM:
exynos_defconfig: Enable options for display panel support").I think you should had mentioned what other patches are needed as a dependency since I spent quite a bit of time figuring out why the ps8622 bridge driver probe was always deferred due
of_drm_find_panel()failing and then I noticed that a patch from linux-next was needed:e35e305 ("drm/panel: simple: Add AUO B116XW03 panel support")
Quoted 8 lines
With that commit the ps8622 drm bridge driver probe succeed but I still don't have display working on an Exynos5240 Peach Pit, the kernel log shows:
platform 145b0000.dp-controller: Driver exynos-dp requests probe deferral exynos-drm exynos-drm: bound 14400000.fimd (ops
fimd_component_ops) exynos-drm exynos-drm: failed to bind 145b0000.dp-controller (opsexynos_dp_ops): -517 exynos-drm exynos-drm: master bind failed: -517
platform 145b0000.dp-controller: Driver exynos-dp requests probe deferraldo you have this in your dmesg?
...
exynos-dp-video-phy 10040728.video-phy: Failed to lookup PMU regmap
...
Quoted 5 lines
to get a working framebuffer out of linus 318rc4 on my peach pi, i had to cherry pick these 3 patches:
arm: dts: Exynos5: Use
pmu_system_controllerphandle for dp phy drm/exynos: dp: Remove support for unused dptx-phy
Excellent, thank you for pointing these out. I've been struggling to get the display working on v3.18-rc and had missed these.
Quoted 3 lines
ARM:
exynos_defconfig: Enable options for display panel supportCheck if you have those.
With the 3 patches you mention, the display is working on my peach-pi as well.
Thanks,
Kevin
Hello,
Quoted 4 lines · Ajay kumar
Quoted 3 lines · Ajay Kumar
This series is based on master branch of Linus tree at:
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
This series has been in the mailing lists for months and have been tested by many people. What else is missing before it can be merged?
It would be great to have proper display support on platforms that have a eDP to LVDS bridge chip (e.g: Snow, Peach Pit and Spring Chromebooks) and everything is in place but this series which had been missing many kernel releases already.
Quoted 14 lines
Quoted 14 lines
Changes since V7:
-- Address comments from Tomi and Laurent:
-- Use videoports and endpoints to represent the connection between
encoder, bridge and the panel, instead of using phandles.
-- Address comments from Daniel:
-- Make the patch description more descriptive.
-- remove device pointer fromdrm_bridge, and just use
device_nodeinstead.
-- don't pass encoder pointer tobridge_attach.
-- Address comments from Sean Paul:
-- Remove bridge frommode_config, and pull outdrm_bridge
functions fromdrm_crtc.ctodrm_bridge.c
Tomi and Laurent,
You asked Ajay to change his series to use the video port and enpoints DT bindings instead of phandles, could you please review his latest version?
I guess is now too late for 3.19 since we are in the middle of the merge window but it would be great if this series can at least made it to 3.20.
Thanks a lot and best regards,
Javier
Quoted 4 lines · Javier Martinez Canillas
Tomi and Laurent,
You asked Ajay to change his series to use the video port and enpoints DT bindings instead of phandles, could you please review his latest version?
Looking only at the binding documentation patch, looks good to me.
Tomi
Laurent Pinchart
reviewerHi Javier,
Quoted 37 lines · On Friday 12 December 2014 10:51:50 Javier Martinez Canillas wrote:
Hello,
Quoted 3 lines · Ajay kumar
Quoted 2 lines · Ajay Kumar
This series is based on master branch of Linus tree at:
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.gitThis series has been in the mailing lists for months and have been tested by many people. What else is missing before it can be merged?
It would be great to have proper display support on platforms that have a eDP to LVDS bridge chip (e.g: Snow, Peach Pit and Spring Chromebooks) and everything is in place but this series which had been missing many kernel releases already.
Quoted 14 lines
Quoted 14 lines
Changes since V7:
-- Address comments from Tomi and Laurent:
-- Use videoports and endpoints to represent the connection betweenencoder, bridge and the panel, instead of using phandles.
-- Address comments from Daniel:
-- Make the patch description more descriptive. -- remove device pointer fromdrm_bridge, and just use
device_nodeinstead.Quoted 7 lines
Quoted 7 lines
-- don't pass encoder pointer to
bridge_attach.-- Address comments from Sean Paul:
-- Remove bridge frommode_config, and pull outdrm_bridgefunctions from
drm_crtc.ctodrm_bridge.c
Quoted 7 lines
Tomi and Laurent,
You asked Ajay to change his series to use the video port and enpoints DT bindings instead of phandles, could you please review his latest version?
I guess is now too late for 3.19 since we are in the middle of the merge window but it would be great if this series can at least made it to 3.20.
I don't have time to review the series in details right now, but I'm happy with the DT bindings, and have no big issue with the rest of the patches. I don't really like the of_drm_find_bridge() concept introduced in 03/14 but I won't nack it given lack of time to implement an alternative proposal. It's an internal API, it can always be reworked later anyway.
Signature · 3 lines
Regards, Laurent Pinchart
Hello Laurent and Tomi,
Quoted 6 lines · Laurent Pinchart
Hi Javier,
Quoted 5 lines
Tomi and Laurent,
You asked Ajay to change his series to use the video port and enpoints DT bindings instead of phandles, could you please review his latest version?
Quoted 9 lines
Quoted 2 lines
I guess is now too late for 3.19 since we are in the middle of the merge window but it would be great if this series can at least made it to 3.20.
I don't have time to review the series in details right now, but I'm happy with the DT bindings, and have no big issue with the rest of the patches. I don't really like the
of_drm_find_bridge()concept introduced in 03/14 but I won't nack it given lack of time to implement an alternative proposal. It's an internal API, it can always be reworked later anyway.
Thanks a lot for taking the time to look at the DT bindings, then I guess that the series are finally ready to be merged?
Ajay's series don't apply cleanly anymore because it has been a while since he posted it but he can rebase on top of 3.19-rc1 once it is released and re-resend.
Best regards,
Javier
Laurent Pinchart
reviewerHi Javier,
Quoted 11 lines · On Wednesday 17 December 2014 10:31:41 Javier Martinez Canillas wrote:
Quoted 10 lines · Laurent Pinchart
Hi Javier,
Quoted 7 lines
Tomi and Laurent,
You asked Ajay to change his series to use the video port and enpoints DT bindings instead of phandles, could you please review his latest version?
I guess is now too late for 3.19 since we are in the middle of the merge window but it would be great if this series can at least made it to 3.20.
Quoted 8 lines
Quoted 6 lines
I don't have time to review the series in details right now, but I'm happy with the DT bindings, and have no big issue with the rest of the patches. I
don't really like theof_drm_find_bridge()concept introduced in 03/14 but I won't nack it given lack of time to implement an alternative proposal. It's an internal API, it can always be reworked later anyway.Thanks a lot for taking the time to look at the DT bindings,
You're welcome. Sorry for the long delay.
Quoted 1 line
then I guess that the series are finally ready to be merged?
From my point of view, yes.
Quoted 3 lines
Ajay's series don't apply cleanly anymore because it has been a while since he posted it but he can rebase on top of 3.19-rc1 once it is released and re-resend.
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Hi Ajay,
Quoted 18 lines · Javier Martinez Canillas
Quoted 1 line · Laurent Pinchart
Quoted 1 line
You asked Ajay to change his series to use the video port and enpoints
DT
Quoted 1 line
Quoted 1 line
bindings instead of phandles, could you please review his latest
version?
Quoted 3 lines
Quoted 3 lines
I guess is now too late for 3.19 since we are in the middle of the merge window but it would be great if this series can at least made it to
3.20.
Quoted 2 lines
I don't have time to review the series in details right now, but I'm
happy
Quoted 1 line
with the DT bindings, and have no big issue with the rest of the
patches. I
Quoted 1 line
don't really like the
of_drm_find_bridge()concept introduced in 03/14but I
Quoted 1 line
won't nack it given lack of time to implement an alternative proposal.
It's an
Quoted 9 lines
Quoted 1 line
internal API, it can always be reworked later anyway.
Thanks a lot for taking the time to look at the DT bindings, then I guess that the series are finally ready to be merged?
Ajay's series don't apply cleanly anymore because it has been a while since he posted it but he can rebase on top of 3.19-rc1 once it is released and re-resend.
Do you have any plans to rebase this so it's ready for merging?
Thierry, Daniel, Dave - whose tree would this be best to merge through?
Cheers,
Daniel
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Hi Daniel,
This series is sitting out there since long without any ACKs. If people can ACK this series, I am ready to rebase and send ASAP.
Regards,
Ajay Kumar
Quoted 41 lines · Daniel Stone
Hi Ajay,
Quoted 22 lines · Javier Martinez Canillas
Quoted 10 lines · Laurent Pinchart
Quoted 9 lines
You asked Ajay to change his series to use the video port and enpoints DT
bindings instead of phandles, could you please review his latest version?I guess is now too late for 3.19 since we are in the middle of the merge
window but it would be great if this series can at least made it to 3.20.Quoted 9 lines
I don't have time to review the series in details right now, but I'm happy
with the DT bindings, and have no big issue with the rest of the patches. I
don't really like theof_drm_find_bridge()concept introduced in 03/14 but I
won't nack it given lack of time to implement an alternative proposal. It's an
internal API, it can always be reworked later anyway.Quoted 7 lines
Thanks a lot for taking the time to look at the DT bindings, then I guess that the series are finally ready to be merged?
Ajay's series don't apply cleanly anymore because it has been a while since
he posted it but he can rebase on top of 3.19-rc1 once it is released and re-resend.Do you have any plans to rebase this so it's ready for merging?
Thierry, Daniel, Dave - whose tree would this be best to merge through?
Cheers,
Daniel
Hi Ajay,
Quoted 3 lines · Ajay kumar
This series is sitting out there since long without any ACKs. If people can ACK this series, I am ready to rebase and send ASAP.
Both Tomi and Laurent have acked this in principle for now in < [email protected]> and <3197445.qizQc0zeRb@avalon>, so another series would be quite good I think.
Cheers,
Daniel
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 4 lines · Ajay kumar
Hi Daniel,
This series is sitting out there since long without any ACKs. If people can ACK this series, I am ready to rebase and send ASAP.
And, for [PATCH V8 5/14] drm/exynos: dp: support drm_bridge,
Thanks,
Inki Dae
Quoted 51 lines
Regards,
Ajay KumarQuoted 35 lines · Daniel Stone
Hi Ajay,
Quoted 22 lines · Javier Martinez Canillas
Quoted 10 lines · Laurent Pinchart
Quoted 9 lines
You asked Ajay to change his series to use the video port and enpoints DT
bindings instead of phandles, could you please review his latest version?I guess is now too late for 3.19 since we are in the middle of the merge
window but it would be great if this series can at least made it to 3.20.Quoted 9 lines
I don't have time to review the series in details right now, but I'm happy
with the DT bindings, and have no big issue with the rest of the patches. I
don't really like theof_drm_find_bridge()concept introduced in 03/14 but I
won't nack it given lack of time to implement an alternative proposal. It's an
internal API, it can always be reworked later anyway.Quoted 7 lines
Thanks a lot for taking the time to look at the DT bindings, then I guess that the series are finally ready to be merged?
Ajay's series don't apply cleanly anymore because it has been a while since
he posted it but he can rebase on top of 3.19-rc1 once it is released and re-resend.Quoted 6 lines
Do you have any plans to rebase this so it's ready for merging?
Thierry, Daniel, Dave - whose tree would this be best to merge through?
Cheers,
Daniel--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo at vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 28 lines · Daniel Stone
Hi Ajay,
Quoted 23 lines · Javier Martinez Canillas
Quoted 1 line · Laurent Pinchart
Quoted 1 line
You asked Ajay to change his series to use the video port and enpoints
DT
Quoted 1 line
Quoted 1 line
bindings instead of phandles, could you please review his latest
version?
Quoted 3 lines
Quoted 3 lines
I guess is now too late for 3.19 since we are in the middle of the merge window but it would be great if this series can at least made it to
3.20.
Quoted 2 lines
I don't have time to review the series in details right now, but I'm
happy
Quoted 1 line
with the DT bindings, and have no big issue with the rest of the
patches. I
Quoted 1 line
don't really like the
of_drm_find_bridge()concept introduced in 03/14but I
Quoted 1 line
won't nack it given lack of time to implement an alternative proposal.
It's an
Quoted 1 line
internal API, it can always be reworked later anyway.
Thanks a lot for taking the time to look at the DT bindings, then I guess that the series are finally ready to be merged?
Quoted 8 lines
Quoted 4 lines
Ajay's series don't apply cleanly anymore because it has been a while since he posted it but he can rebase on top of 3.19-rc1 once it is released and re-resend.
Do you have any plans to rebase this so it's ready for merging?
Thierry, Daniel, Dave - whose tree would this be best to merge through?
The plan is for me to take the bridge patches through the drm/panel tree. I'm going to look at these patches again later this week but from a very quick peek there don't seem to be any major issues left.
Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150105/93ebed52/attachment-0001.sig>
A message that is not in the archive (sent off-list or not yet received): 20150105135015.GA12010-AwZRO8vwLAwmlAP/[email protected]
Hello Thierry,
Quoted 7 lines · Thierry Reding
Quoted 6 lines · Daniel Stone
Quoted 5 lines
Ajay's series don't apply cleanly anymore because it has been a while since he posted it but he can rebase on top of 3.19-rc1 once it is released and re-resend.
Quoted 8 lines
Quoted 3 lines
Do you have any plans to rebase this so it's ready for merging?
Thierry, Daniel, Dave - whose tree would this be best to merge through?
The plan is for me to take the bridge patches through the drm/panel tree. I'm going to look at these patches again later this week but from a very quick peek there don't seem to be any major issues left.
I know you probably are very busy but it would be great if you can take a look to this series to avoid another kernel release to be missed since we are already at v3.19-rc5.
Only this version was posted 2 months ago and the first version of the series was sent on May, 2014 so it has been on the list for almost a year now...
Tomi and Laurent had already agreed with the DT binging so I think that we can already merge these and if there are any remaining issues, those can be fixed during the 3.20 -rc cycle.
Quoted 2 lines
Thierry
Thanks a lot and best regards,
Javier
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 23 lines · Javier Martinez Canillas
Hello Thierry,
Quoted 7 lines · Thierry Reding
Quoted 6 lines · Daniel Stone
Quoted 5 lines
Ajay's series don't apply cleanly anymore because it has been a while since he posted it but he can rebase on top of 3.19-rc1 once it is released and re-resend.
Quoted 8 lines
Quoted 3 lines
Do you have any plans to rebase this so it's ready for merging?
Thierry, Daniel, Dave - whose tree would this be best to merge through?
The plan is for me to take the bridge patches through the drm/panel tree. I'm going to look at these patches again later this week but from a very quick peek there don't seem to be any major issues left.
I know you probably are very busy but it would be great if you can take a look to this series to avoid another kernel release to be missed since we are already at v3.19-rc5.
Quoted 6 lines
Only this version was posted 2 months ago and the first version of the series was sent on May, 2014 so it has been on the list for almost a year now...
Tomi and Laurent had already agreed with the DT binging so I think that we can already merge these and if there are any remaining issues, those can be fixed during the 3.20 -rc cycle.
I see only a single Tested-by on this series and that seems to be with a bunch of out-of-tree patches applied on top. Does this now actually work applied on top of upstream? Also it seems like many people actually want this to get merged but there's been no Reviewed-bys and only a single Tested-by? Is that as good as it's going to get?
Also I think the last update was that Ajay was going to resend this based on v3.19-rc1 or something. Is that still going to happen? Otherwise I can probably try to apply as-is, but not sure how well it will.
Thierry
Gustavo Padovan
Tested-by2015-01-19 Thierry Reding <[email protected]>:
Quoted 31 lines · Javier Martinez Canillas
Quoted 23 lines
Hello Thierry,
Quoted 7 lines · Thierry Reding
Quoted 6 lines · Daniel Stone
Quoted 5 lines
Ajay's series don't apply cleanly anymore because it has been a while since he posted it but he can rebase on top of 3.19-rc1 once it is released and re-resend.
Quoted 8 lines
Quoted 3 lines
Do you have any plans to rebase this so it's ready for merging?
Thierry, Daniel, Dave - whose tree would this be best to merge through?
The plan is for me to take the bridge patches through the drm/panel tree. I'm going to look at these patches again later this week but from a very quick peek there don't seem to be any major issues left.
I know you probably are very busy but it would be great if you can take a look to this series to avoid another kernel release to be missed since we are already at v3.19-rc5.
Quoted 6 lines
Only this version was posted 2 months ago and the first version of the series was sent on May, 2014 so it has been on the list for almost a year now...
Tomi and Laurent had already agreed with the DT binging so I think that we can already merge these and if there are any remaining issues, those can be fixed during the 3.20 -rc cycle.
Quoted 5 lines
I see only a single Tested-by on this series and that seems to be with a bunch of out-of-tree patches applied on top. Does this now actually work applied on top of upstream? Also it seems like many people actually want this to get merged but there's been no Reviewed-bys and only a single Tested-by? Is that as good as it's going to get?
I've been using this series on top of exynos-drm for more than a month and it works fine for me so..
Gustavo
Sjoerd Simons
Tested-byQuoted 39 lines · Gustavo Padovan
2015-01-19 Thierry Reding <[email protected]>:
Quoted 31 lines · Javier Martinez Canillas
Quoted 23 lines
Hello Thierry,
Quoted 7 lines · Thierry Reding
Quoted 6 lines · Daniel Stone
Quoted 5 lines
Ajay's series don't apply cleanly anymore because it has been a while since he posted it but he can rebase on top of 3.19-rc1 once it is released and re-resend.
Quoted 8 lines
Quoted 3 lines
Do you have any plans to rebase this so it's ready for merging?
Thierry, Daniel, Dave - whose tree would this be best to merge through?
The plan is for me to take the bridge patches through the drm/panel tree. I'm going to look at these patches again later this week but from a very quick peek there don't seem to be any major issues left.
I know you probably are very busy but it would be great if you can take a look to this series to avoid another kernel release to be missed since we are already at v3.19-rc5.
Quoted 6 lines
Only this version was posted 2 months ago and the first version of the series was sent on May, 2014 so it has been on the list for almost a year now...
Tomi and Laurent had already agreed with the DT binging so I think that we can already merge these and if there are any remaining issues, those can be fixed during the 3.20 -rc cycle.
Quoted 5 lines
I see only a single Tested-by on this series and that seems to be with a bunch of out-of-tree patches applied on top. Does this now actually work applied on top of upstream? Also it seems like many people actually want this to get merged but there's been no Reviewed-bys and only a single Tested-by? Is that as good as it's going to get?
Quoted 4 lines
I've been using this series on top of exynos-drm for more than a month and it works fine for me so..
Tested-by Gustavo Padovan <[email protected]>
Same here, just test-booted on my snow with just these patch on top of 3.19-rc5 and got a nicely working display.
Signature · 2 lines
Sjoerd Simons <[email protected]> Collabora Ltd.
A message that is not in the archive (sent off-list or not yet received): 20150119163043.GB7751-AwZRO8vwLAwmlAP/[email protected]
Javier Martinez Canillas
Tested-byHello Thierry,
Quoted 12 lines · Thierry Reding
Quoted 11 lines
I know you probably are very busy but it would be great if you can take a look to this series to avoid another kernel release to be missed since we are already at v3.19-rc5.
Only this version was posted 2 months ago and the first version of the series was sent on May, 2014 so it has been on the list for almost a year now...
Tomi and Laurent had already agreed with the DT binging so I think that we can already merge these and if there are any remaining issues, those can be fixed during the 3.20 -rc cycle.
Quoted 6 lines
I see only a single Tested-by on this series and that seems to be with a bunch of out-of-tree patches applied on top. Does this now actually work applied on top of upstream? Also it seems like many people actually want this to get merged but there's been no Reviewed-bys and only a single Tested-by? Is that as good as it's going to get?
Good point, I provided some feedback on an early version of the series but I'm not an DRM expert so I couldn't review it in detail to provide my Reviewed-by.
I did provide my Tested-by a long time ago though but looking at the patches it seems those were dropped so here goes again:
For the whole series on an Exynos5420 Peach Pit and an Exynos5250 Snow Chromebooks:
Quoted 5 lines
Also I think the last update was that Ajay was going to resend this based on v3.19-rc1 or something. Is that still going to happen? Otherwise I can probably try to apply as-is, but not sure how well it will.
Ajay,
Are you going to rebase and resend this series with all the provided tags? Gustavo and I have a rebased branch on top of 3.19-rc5 and one of us can post your series if you are not planning to do it.
Laurent and Tomi,
You said that you are OK with the DT bindings now, does that count as an Acked-by or Reviewed-by for you at least for the DT bindings changes in the series?
Quoted 2 lines
Thierry
Best regards,
Javier
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 38 lines · Javier Martinez Canillas
Hello Thierry,
Quoted 12 lines · Thierry Reding
Quoted 11 lines
I know you probably are very busy but it would be great if you can take a look to this series to avoid another kernel release to be missed since we are already at v3.19-rc5.
Only this version was posted 2 months ago and the first version of the series was sent on May, 2014 so it has been on the list for almost a year now...
Tomi and Laurent had already agreed with the DT binging so I think that we can already merge these and if there are any remaining issues, those can be fixed during the 3.20 -rc cycle.
Quoted 6 lines
I see only a single Tested-by on this series and that seems to be with a bunch of out-of-tree patches applied on top. Does this now actually work applied on top of upstream? Also it seems like many people actually want this to get merged but there's been no Reviewed-bys and only a single Tested-by? Is that as good as it's going to get?
Good point, I provided some feedback on an early version of the series but I'm not an DRM expert so I couldn't review it in detail to provide my Reviewed-by.
I did provide my Tested-by a long time ago though but looking at the patches it seems those were dropped so here goes again:
For the whole series on an Exynos5420 Peach Pit and an Exynos5250 Snow Chromebooks:
Quoted 5 lines
Also I think the last update was that Ajay was going to resend this based on v3.19-rc1 or something. Is that still going to happen? Otherwise I can probably try to apply as-is, but not sure how well it will.
Quoted 5 lines
Ajay,
Are you going to rebase and resend this series with all the provided tags? Gustavo and I have a rebased branch on top of 3.19-rc5 and one of us can post your series if you are not planning to do it.
Yes, in a day or so. I am currently rebasing on 3.19-rc5 linux-next. I will add Tested-by from from Rahul, Javier, Inki, Sjoerd, and Gustavo. Only Inki has acked this till now. So, I will add Inki's Acked-by.
Ajay
Quoted 10 lines
Laurent and Tomi,
You said that you are OK with the DT bindings now, does that count as an Acked-by or Reviewed-by for you at least for the DT bindings changes in the series?
Quoted 2 lines
Thierry
Best regards,
Javier
Laurent Pinchart
reviewerHi,
Quoted 42 lines · On Monday 19 January 2015 18:05:07 Javier Martinez Canillas wrote:
Quoted 12 lines · Thierry Reding
Quoted 11 lines
I know you probably are very busy but it would be great if you can take a look to this series to avoid another kernel release to be missed since we are already at v3.19-rc5.
Only this version was posted 2 months ago and the first version of the series was sent on May, 2014 so it has been on the list for almost a year now...
Tomi and Laurent had already agreed with the DT binging so I think that we can already merge these and if there are any remaining issues, those can be fixed during the 3.20 -rc cycle.
Quoted 5 lines
I see only a single Tested-by on this series and that seems to be with a bunch of out-of-tree patches applied on top. Does this now actually work applied on top of upstream? Also it seems like many people actually want this to get merged but there's been no Reviewed-bys and only a single Tested-by? Is that as good as it's going to get?
Good point, I provided some feedback on an early version of the series but I'm not an DRM expert so I couldn't review it in detail to provide my Reviewed-by.
I did provide my Tested-by a long time ago though but looking at the patches it seems those were dropped so here goes again:
For the whole series on an Exynos5420 Peach Pit and an Exynos5250 Snow Chromebooks:
Quoted 4 lines
Also I think the last update was that Ajay was going to resend this based on v3.19-rc1 or something. Is that still going to happen? Otherwise I can probably try to apply as-is, but not sure how well it will.
Ajay,
Are you going to rebase and resend this series with all the provided tags? Gustavo and I have a rebased branch on top of 3.19-rc5 and one of us can post your series if you are not planning to do it.
Quoted 5 lines
Laurent and Tomi,
You said that you are OK with the DT bindings now, does that count as an Acked-by or Reviewed-by for you at least for the DT bindings changes in the series?
It counts as an Acked-by for the DT bindings.
Signature · 3 lines
Regards, Laurent Pinchart