Associate ddc adapters with connectors
Subsystems (24)
v4 cover Associate ddc adapters with connectors
It is difficult for a user to know which of the i2c adapters is for which drm connector. This series addresses this problem.
The idea is to have a symbolic link in connector's sysfs directory, e.g.:
ls -l /sys/class/drm/card0-HDMI-A-1/ddc
lrwxrwxrwx 1 root root 0 Jun 24 10:42 /sys/class/drm/card0-HDMI-A-1/ddc \ -> ../../../../soc/13880000.i2c/i2c-2
The user then knows that their card0-HDMI-A-1 uses i2c-2 and can e.g. run ddcutil:
ddcutil -b 2 getvcp 0x10
VCP code 0x10 (Brightness ): current value = 90, max value = 100
The first patch in the series adds struct i2c_adapter pointer to struct drm_connector. If the field is used by a particular driver, then an appropriate symbolic link is created by the generic code, which is also added by this patch.
The next 22 patches is an example of how to convert a driver to this new scheme.
v1..v2:
- used fixed name "ddc" for the symbolic link in order to make it easy for userspace to find the i2c adapter
v2..v3:
- converted as many drivers as possible.
v3..v4:
- added Reviewed-by for patch 01/23
- moved "ddc" field assignment to before drm_connector_init() is called in msm, vc4, sti, mgag200, ast, amdgpu, radeon
- simplified the code in amdgpu and radeon at the expense of some lines exceeding 80 characters as per Alex Deucher's suggestion
- added i915
TODO: nouveau, gma500, omapdrm, panel-simple - if applicable. Other drivers are either already converted or don't mention neither "ddc" nor "i2c_adapter".
Andrzej Pietrasiewicz (23):
drm: Include ddc adapter pointer in struct drm_connector drm/exynos: Provide ddc symlink in connector's sysfs
drm: rockchip: Provide ddc symlink in rk3066_hdmi sysfs directory
drm: rockchip: Provide ddc symlink in inno_hdmi sysfs directory drm/msm/hdmi: Provide ddc symlink in hdmi connector sysfs directory drm/sun4i: hdmi: Provide ddc symlink in sun4i hdmi connector sysfs
directory
drm/mediatek: Provide ddc symlink in hdmi connector sysfs directory drm/tegra: Provide ddc symlink in output connector sysfs directory drm/imx: imx-ldb: Provide ddc symlink in connector's sysfs drm/imx: imx-tve: Provide ddc symlink in connector's sysfs drm/vc4: Provide ddc symlink in connector sysfs directory
drm: zte: Provide ddc symlink in hdmi connector sysfs directory
drm: zte: Provide ddc symlink in vga connector sysfs directory drm/tilcdc: Provide ddc symlink in connector sysfs directory
drm: sti: Provide ddc symlink in hdmi connector sysfs directory drm/mgag200: Provide ddc symlink in connector sysfs directory drm/ast: Provide ddc symlink in connector sysfs directory drm/bridge: dumb-vga-dac: Provide ddc symlink in connector sysfs
directory
drm/bridge: dw-hdmi: Provide ddc symlink in connector sysfs directory drm/bridge: ti-tfp410: Provide ddc symlink in connector sysfs
directory
drm/amdgpu: Provide ddc symlink in connector sysfs directory drm/radeon: Provide ddc symlink in connector sysfs directory drm/i915: Provide ddc symlink in hdmi connector sysfs directory
.../gpu/drm/amd/amdgpu/amdgpu_connectors.c | 56 ++++++++----- drivers/gpu/drm/ast/ast_mode.c | 9 ++- drivers/gpu/drm/bridge/dumb-vga-dac.c | 19 +++-- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 40 +++++----- drivers/gpu/drm/bridge/ti-tfp410.c | 19 +++-- drivers/gpu/drm/drm_sysfs.c | 7 ++ drivers/gpu/drm/exynos/exynos_hdmi.c | 11 ++- drivers/gpu/drm/i915/display/intel_hdmi.c | 5 +- drivers/gpu/drm/imx/imx-ldb.c | 13 ++- drivers/gpu/drm/imx/imx-tve.c | 8 +- drivers/gpu/drm/mediatek/mtk_hdmi.c | 9 +-- drivers/gpu/drm/mgag200/mgag200_mode.c | 9 ++- drivers/gpu/drm/msm/hdmi/hdmi_connector.c | 1 + drivers/gpu/drm/radeon/radeon_connectors.c | 80 ++++++++++++------- drivers/gpu/drm/rockchip/inno_hdmi.c | 17 ++-- drivers/gpu/drm/rockchip/rk3066_hdmi.c | 17 ++-- drivers/gpu/drm/sti/sti_hdmi.c | 1 + drivers/gpu/drm/sun4i/sun4i_hdmi.h | 1 - drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c | 14 ++-- drivers/gpu/drm/tegra/drm.h | 1 - drivers/gpu/drm/tegra/output.c | 12 +-- drivers/gpu/drm/tegra/sor.c | 6 +- drivers/gpu/drm/tilcdc/tilcdc_tfp410.c | 1 + drivers/gpu/drm/vc4/vc4_hdmi.c | 21 ++--- drivers/gpu/drm/zte/zx_hdmi.c | 25 +++--- drivers/gpu/drm/zte/zx_vga.c | 25 +++--- include/drm/drm_connector.h | 11 +++ 27 files changed, 240 insertions(+), 198 deletions(-)
Signature · 6 lines
2.17.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v4 1/23 drm: Include ddc adapter pointer in struct drm_connector
Add generic code which creates symbolic links in sysfs, pointing to ddc interface used by a particular video output. For example:
ls -l /sys/class/drm/card0-HDMI-A-1/ddc
lrwxrwxrwx 1 root root 0 Jun 24 10:42 /sys/class/drm/card0-HDMI-A-1/ddc \ -> ../../../../soc/13880000.i2c/i2c-2
This makes it easy for user to associate a display with its ddc adapter and use e.g. ddcutil to control the chosen monitor.
This patch adds an i2c_adapter pointer to struct drm_connector. Particular drivers can then use it instead of using their own private instance. If a connector contains a ddc, then create a symbolic link in sysfs.
--- drivers/gpu/drm/drm_sysfs.c | 7 +++++++ include/drm/drm_connector.h | 11 +++++++++++ 2 files changed, 18 insertions(+)
drivers/gpu/drm/drm_sysfs.c +7 -0
@@ -294,6 +294,9 @@ int drm_sysfs_connector_add(struct drm_connector *connector)/* Let userspace know we have a new connector */ drm_sysfs_hotplug_event (dev); +if (connector->ddc) +return sysfs_create_link (&connector->kdev->kobj, + &connector->ddc->dev.kobj,"ddc" );return 0 ; }
@@ -301,6 +304,10 @@ void drm_sysfs_connector_remove(struct drm_connector *connector) {if (!connector->kdev)return ; + +if (connector->ddc) +sysfs_remove_link (&connector->kdev->kobj,"ddc" ); +DRM_DEBUG ("removing \"%s\" from sysfs\n" , connector->name);
include/drm/drm_connector.h +11 -0
@@ -23,6 +23,7 @@#ifndef __DRM_CONNECTOR_H__#define __DRM_CONNECTOR_H__ +#include <linux/i2c.h> #include <linux/list.h> #include <linux/llist.h> #include <linux/ctype.h>
@@ -1308,6 +1309,16 @@ struct drm_connector {* [0]: progressive, [1]: interlaced */ int audio_latency[2 ]; + +/** +* @ddc: associated ddc adapter. +* A connector usually has its associated ddc adapter. If a driver uses +* this field, then an appropriate symbolic link is created in connector +* sysfs directory to make it easy for the user to tell which i2c +* adapter is for a particular display. +*/ +struct i2c_adapter *ddc; +/** * @null_edid_counter: track sinks that give us all zeros for the EDID. * Needed to workaround some HW bugs where we get all 0s
Signature · 6 lines
2.17.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v4 2/23 drm/exynos: Provide ddc symlink in connector's sysfs
In reply to Andrzej PietrasiewiczSwitch to using the ddc provided by the generic connector.
--- drivers/gpu/drm/exynos/exynos_hdmi.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-)
drivers/gpu/drm/exynos/exynos_hdmi.c +5 -6
@@ -125,7 +125,6 @@ struct hdmi_context {void __iomem *regs;void __iomem *regs_hdmiphy;struct i2c_client *hdmiphy_port; -struct i2c_adapter *ddc_adpt;struct gpio_desc *hpd_gpio;int irq;struct regmap *pmureg;
@@ -871,10 +870,10 @@ static int hdmi_get_modes(struct drm_connector *connector)struct edid *edid;int ret; -if (!hdata->ddc_adpt) +if (!connector->ddc)return -ENODEV ; - edid =drm_get_edid (connector, hdata->ddc_adpt); + edid =drm_get_edid (connector, connector->ddc);if (!edid)return -ENODEV ;
@@ -1892,7 +1891,7 @@ static int hdmi_get_ddc_adapter(struct hdmi_context *hdata)return -EPROBE_DEFER ; } - hdata->ddc_adpt = adpt; + hdata->connector.ddc = adpt;return 0 ; }
@@ -2044,7 +2043,7 @@ static int hdmi_probe(struct platform_device *pdev)if (hdata->regs_hdmiphy)iounmap (hdata->regs_hdmiphy); err_ddc: -put_device (&hdata->ddc_adpt->dev); +put_device (&hdata->connector.ddc->dev);return ret; }
@@ -2071,7 +2070,7 @@ static int hdmi_remove(struct platform_device *pdev)if (hdata->regs_hdmiphy)iounmap (hdata->regs_hdmiphy); -put_device (&hdata->ddc_adpt->dev); +put_device (&hdata->connector.ddc->dev);mutex_destroy (&hdata->mutex);
Signature · 6 lines
2.17.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v4 3/23 drm: rockchip: Provide ddc symlink in rk3066_hdmi sysfs directory
In reply to Andrzej PietrasiewiczUse the ddc pointer provided by the generic connector.
--- drivers/gpu/drm/rockchip/rk3066_hdmi.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-)
drivers/gpu/drm/rockchip/rk3066_hdmi.c +8 -9
@@ -49,7 +49,6 @@ struct rk3066_hdmi {struct drm_encoder encoder;struct rk3066_hdmi_i2c *i2c; -struct i2c_adapter *ddc;unsigned int tmdsclk;
@@ -470,10 +469,10 @@ static int rk3066_hdmi_connector_get_modes(struct drm_connector *connector)struct edid *edid;int ret =0 ; -if (!hdmi->ddc) +if (!connector->ddc)return 0 ; - edid =drm_get_edid (connector, hdmi->ddc); + edid =drm_get_edid (connector, connector->ddc);if (edid) { hdmi->hdmi_data.sink_is_hdmi =drm_detect_hdmi_monitor (edid);drm_connector_update_edid_property (connector, edid);
@@ -789,10 +788,10 @@ static int rk3066_hdmi_bind(struct device *dev, struct device *master,/* internal hclk = hdmi_hclk / 25 */ hdmi_writeb (hdmi,HDMI_INTERNAL_CLK_DIVIDER ,25 ); - hdmi->ddc =rk3066_hdmi_i2c_adapter (hdmi); -if (IS_ERR (hdmi->ddc)) { - ret =PTR_ERR (hdmi->ddc); - hdmi->ddc =NULL ; + hdmi->connector.ddc =rk3066_hdmi_i2c_adapter (hdmi); +if (IS_ERR (hdmi->connector.ddc)) { + ret =PTR_ERR (hdmi->connector.ddc); + hdmi->connector.ddc =NULL ; goto err_disable_hclk; }
@@ -824,7 +823,7 @@ static int rk3066_hdmi_bind(struct device *dev, struct device *master, hdmi->connector.funcs->destroy (&hdmi->connector); hdmi->encoder.funcs->destroy (&hdmi->encoder); err_disable_i2c: -i2c_put_adapter (hdmi->ddc); +i2c_put_adapter (hdmi->connector.ddc); err_disable_hclk:clk_disable_unprepare (hdmi->hclk);
@@ -839,7 +838,7 @@ static void rk3066_hdmi_unbind(struct device *dev, struct device *master, hdmi->connector.funcs->destroy (&hdmi->connector); hdmi->encoder.funcs->destroy (&hdmi->encoder); -i2c_put_adapter (hdmi->ddc); +i2c_put_adapter (hdmi->connector.ddc);clk_disable_unprepare (hdmi->hclk); }
Signature · 6 lines
2.17.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v4 4/23 drm: rockchip: Provide ddc symlink in inno_hdmi sysfs directory
In reply to a message not in the archiveUse the ddc pointer provided by the generic connector.
--- drivers/gpu/drm/rockchip/inno_hdmi.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-)
drivers/gpu/drm/rockchip/inno_hdmi.c +8 -9
@@ -59,7 +59,6 @@ struct inno_hdmi {struct drm_encoder encoder;struct inno_hdmi_i2c *i2c; -struct i2c_adapter *ddc;unsigned int tmds_rate;
@@ -552,10 +551,10 @@ static int inno_hdmi_connector_get_modes(struct drm_connector *connector)struct edid *edid;int ret =0 ; -if (!hdmi->ddc) +if (!hdmi->connector.ddc)return 0 ; - edid =drm_get_edid (connector, hdmi->ddc); + edid =drm_get_edid (connector, hdmi->connector.ddc);if (edid) { hdmi->hdmi_data.sink_is_hdmi =drm_detect_hdmi_monitor (edid); hdmi->hdmi_data.sink_has_audio =drm_detect_monitor_audio (edid);
@@ -850,10 +849,10 @@ static int inno_hdmi_bind(struct device *dev, struct device *master,inno_hdmi_reset (hdmi); - hdmi->ddc =inno_hdmi_i2c_adapter (hdmi); -if (IS_ERR (hdmi->ddc)) { - ret =PTR_ERR (hdmi->ddc); - hdmi->ddc =NULL ; + hdmi->connector.ddc =inno_hdmi_i2c_adapter (hdmi); +if (IS_ERR (hdmi->connector.ddc)) { + ret =PTR_ERR (hdmi->connector.ddc); + hdmi->connector.ddc =NULL ; goto err_disable_clk; }
@@ -886,7 +885,7 @@ static int inno_hdmi_bind(struct device *dev, struct device *master, hdmi->connector.funcs->destroy (&hdmi->connector); hdmi->encoder.funcs->destroy (&hdmi->encoder); err_put_adapter: -i2c_put_adapter (hdmi->ddc); +i2c_put_adapter (hdmi->connector.ddc); err_disable_clk:clk_disable_unprepare (hdmi->pclk);return ret;
@@ -900,7 +899,7 @@ static void inno_hdmi_unbind(struct device *dev, struct device *master, hdmi->connector.funcs->destroy (&hdmi->connector); hdmi->encoder.funcs->destroy (&hdmi->encoder); -i2c_put_adapter (hdmi->ddc); +i2c_put_adapter (hdmi->connector.ddc);clk_disable_unprepare (hdmi->pclk); }
Signature · 6 lines
2.17.1 _______________________________________________ Freedreno mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/freedreno
PATCH v4 5/23 drm/msm/hdmi: Provide ddc symlink in hdmi connector sysfs directory
In reply to a message not in the archiveUse the ddc pointer provided by the generic connector.
--- drivers/gpu/drm/msm/hdmi/hdmi_connector.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/msm/hdmi/hdmi_connector.c +1 -0
@@ -450,6 +450,7 @@ struct drm_connector *msm_hdmi_connector_init(struct hdmi *hdmi) connector = &hdmi_connector->base; + connector->ddc = hdmi->i2c;drm_connector_init (hdmi->dev, connector, &hdmi_connector_funcs,DRM_MODE_CONNECTOR_HDMIA );drm_connector_helper_add (connector, &msm_hdmi_connector_helper_funcs);
Signature · 6 lines
2.17.1 _______________________________________________ Freedreno mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/freedreno
PATCH v4 6/23 drm/sun4i: hdmi: Provide ddc symlink in sun4i hdmi connector sysfs directory
In reply to Andrzej PietrasiewiczUse the ddc pointer provided by the generic connector.
--- drivers/gpu/drm/sun4i/sun4i_hdmi.h | 1 - drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c | 14 +++++++------- 2 files changed, 7 insertions(+), 8 deletions(-)
drivers/gpu/drm/sun4i/sun4i_hdmi.h +0 -1
@@ -265,7 +265,6 @@ struct sun4i_hdmi {struct clk *tmds_clk;struct i2c_adapter *i2c; -struct i2c_adapter *ddc_i2c;/* Regmap fields for I2C adapter */ struct regmap_field *field_ddc_en;
drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c +7 -7
@@ -213,7 +213,7 @@ static int sun4i_hdmi_get_modes(struct drm_connector *connector)struct edid *edid;int ret; - edid =drm_get_edid (connector, hdmi->ddc_i2c ?: hdmi->i2c); + edid =drm_get_edid (connector, connector->ddc ?: hdmi->i2c);if (!edid)return 0 ;
@@ -598,11 +598,11 @@ static int sun4i_hdmi_bind(struct device *dev, struct device *master, goto err_disable_mod_clk; } - hdmi->ddc_i2c =sun4i_hdmi_get_ddc (dev); -if (IS_ERR (hdmi->ddc_i2c)) { - ret =PTR_ERR (hdmi->ddc_i2c); + hdmi->connector.ddc =sun4i_hdmi_get_ddc (dev); +if (IS_ERR (hdmi->connector.ddc)) { + ret =PTR_ERR (hdmi->connector.ddc);if (ret == -ENODEV ) - hdmi->ddc_i2c =NULL ; + hdmi->connector.ddc =NULL ;else goto err_del_i2c_adapter; }
@@ -663,7 +663,7 @@ static int sun4i_hdmi_bind(struct device *dev, struct device *master,cec_delete_adapter (hdmi->cec_adap);drm_encoder_cleanup (&hdmi->encoder); err_put_ddc_i2c: -i2c_put_adapter (hdmi->ddc_i2c); +i2c_put_adapter (hdmi->connector.ddc); err_del_i2c_adapter:i2c_del_adapter (hdmi->i2c); err_disable_mod_clk:
@@ -684,7 +684,7 @@ static void sun4i_hdmi_unbind(struct device *dev, struct device *master,drm_connector_cleanup (&hdmi->connector);drm_encoder_cleanup (&hdmi->encoder);i2c_del_adapter (hdmi->i2c); -i2c_put_adapter (hdmi->ddc_i2c); +i2c_put_adapter (hdmi->connector.ddc);clk_disable_unprepare (hdmi->mod_clk);clk_disable_unprepare (hdmi->bus_clk); }
Signature · 6 lines
2.17.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v4 7/23 drm/mediatek: Provide ddc symlink in hdmi connector sysfs directory
In reply to Andrzej PietrasiewiczUse the ddc pointer provided by the generic connector.
--- drivers/gpu/drm/mediatek/mtk_hdmi.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/gpu/drm/mediatek/mtk_hdmi.c +4 -5
@@ -146,7 +146,6 @@ struct mtk_hdmi {struct device *dev;struct phy *phy;struct device *cec_dev; -struct i2c_adapter *ddc_adpt;struct clk *clk[MTK_HDMI_CLK_COUNT ];struct drm_display_mode mode;bool dvi_mode;
@@ -1213,10 +1212,10 @@ static int mtk_hdmi_conn_get_modes(struct drm_connector *conn)struct edid *edid;int ret; -if (!hdmi->ddc_adpt) +if (!conn->ddc)return -ENODEV ; - edid =drm_get_edid (conn, hdmi->ddc_adpt); + edid =drm_get_edid (conn, conn->ddc);if (!edid)return -ENODEV ;
@@ -1509,9 +1508,9 @@ static int mtk_hdmi_dt_parse_pdata(struct mtk_hdmi *hdmi, }of_node_put (remote); - hdmi->ddc_adpt =of_find_i2c_adapter_by_node (i2c_np); + hdmi->conn.ddc =of_find_i2c_adapter_by_node (i2c_np);of_node_put (i2c_np); -if (!hdmi->ddc_adpt) { +if (!hdmi->conn.ddc) {dev_err (dev,"Failed to get ddc i2c adapter by node\n" );return -EINVAL ; }
Signature · 6 lines
2.17.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v4 8/23 drm/tegra: Provide ddc symlink in output connector sysfs directory
In reply to Andrzej PietrasiewiczUse the ddc pointer provided by the generic connector.
--- drivers/gpu/drm/tegra/drm.h | 1 - drivers/gpu/drm/tegra/output.c | 12 ++++++------ drivers/gpu/drm/tegra/sor.c | 6 +++--- 3 files changed, 9 insertions(+), 10 deletions(-)
drivers/gpu/drm/tegra/drm.h +0 -1
@@ -120,7 +120,6 @@ struct tegra_output {struct device *dev;struct drm_panel *panel; -struct i2c_adapter *ddc;const struct edid *edid;struct cec_notifier *cec;unsigned int hpd_irq;
drivers/gpu/drm/tegra/output.c +6 -6
@@ -30,8 +30,8 @@ int tegra_output_connector_get_modes(struct drm_connector *connector)if (output->edid) edid =kmemdup (output->edid,sizeof (*edid),GFP_KERNEL ); -else if (output->ddc) - edid =drm_get_edid (connector, output->ddc); +else if (connector->ddc) + edid =drm_get_edid (connector, connector->ddc);cec_notifier_set_phys_addr_from_edid (output->cec, edid);drm_connector_update_edid_property (connector, edid);
@@ -111,8 +111,8 @@ int tegra_output_probe(struct tegra_output *output) ddc =of_parse_phandle (output->of_node,"nvidia,ddc-i2c-bus" ,0 );if (ddc) { - output->ddc =of_find_i2c_adapter_by_node (ddc); -if (!output->ddc) { + output->connector.ddc =of_find_i2c_adapter_by_node (ddc); +if (!output->connector.ddc) { err = -EPROBE_DEFER ;of_node_put (ddc);return err;
@@ -174,8 +174,8 @@ void tegra_output_remove(struct tegra_output *output)if (output->hpd_gpio)free_irq (output->hpd_irq, output); -if (output->ddc) -put_device (&output->ddc->dev); +if (output->connector.ddc) +put_device (&output->connector.ddc->dev); }int tegra_output_init (struct drm_device *drm,struct tegra_output *output)
drivers/gpu/drm/tegra/sor.c +3 -3
@@ -2311,7 +2311,7 @@ static void tegra_sor_hdmi_disable_scrambling(struct tegra_sor *sor)static void tegra_sor_hdmi_scdc_disable (struct tegra_sor *sor) { -struct i2c_adapter *ddc = sor->output.ddc; +struct i2c_adapter *ddc = sor->output.connector.ddc;drm_scdc_set_high_tmds_clock_ratio (ddc, false);drm_scdc_set_scrambling (ddc, false);
@@ -2339,7 +2339,7 @@ static void tegra_sor_hdmi_enable_scrambling(struct tegra_sor *sor)static void tegra_sor_hdmi_scdc_enable (struct tegra_sor *sor) { -struct i2c_adapter *ddc = sor->output.ddc; +struct i2c_adapter *ddc = sor->output.connector.ddc;drm_scdc_set_high_tmds_clock_ratio (ddc, true);drm_scdc_set_scrambling (ddc, true);
@@ -2350,7 +2350,7 @@ static void tegra_sor_hdmi_scdc_enable(struct tegra_sor *sor)static void tegra_sor_hdmi_scdc_work (struct work_struct *work) { struct tegra_sor *sor = container_of(work, struct tegra_sor, scdc.work); -struct i2c_adapter *ddc = sor->output.ddc; +struct i2c_adapter *ddc = sor->output.connector.ddc;if (!drm_scdc_get_scrambling_status (ddc)) {DRM_DEBUG_KMS ("SCDC not scrambled\n" );
Signature · 6 lines
2.17.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v4 9/23 drm/imx: imx-ldb: Provide ddc symlink in connector's sysfs
In reply to Andrzej PietrasiewiczUse the ddc pointer provided by the generic connector.
--- drivers/gpu/drm/imx/imx-ldb.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-)
drivers/gpu/drm/imx/imx-ldb.c +6 -7
@@ -55,7 +55,6 @@ struct imx_ldb_channel {struct drm_bridge *bridge;struct device_node *child; -struct i2c_adapter *ddc;int chno;void *edid;int edid_len;
@@ -131,8 +130,8 @@ static int imx_ldb_connector_get_modes(struct drm_connector *connector)return num_modes; } -if (!imx_ldb_ch->edid && imx_ldb_ch->ddc) - imx_ldb_ch->edid =drm_get_edid (connector, imx_ldb_ch->ddc); +if (!imx_ldb_ch->edid && connector->ddc) + imx_ldb_ch->edid =drm_get_edid (connector, connector->ddc);if (imx_ldb_ch->edid) { drm_connector_update_edid_property(connector,
@@ -550,15 +549,15 @@ static int imx_ldb_panel_ddc(struct device *dev, ddc_node =of_parse_phandle (child,"ddc-i2c-bus" ,0 );if (ddc_node) { - channel->ddc =of_find_i2c_adapter_by_node (ddc_node); + channel->connector.ddc =of_find_i2c_adapter_by_node (ddc_node);of_node_put (ddc_node); -if (!channel->ddc) { +if (!channel->connector.ddc) {dev_warn (dev,"failed to get ddc i2c adapter\n" );return -EPROBE_DEFER ; } } -if (!channel->ddc) { +if (!channel->connector.ddc) {/* if no DDC available, fallback to hardcoded EDID */ dev_dbg (dev,"no ddc available\n" );
@@ -725,7 +724,7 @@ static void imx_ldb_unbind(struct device *dev, struct device *master,drm_panel_detach (channel->panel);kfree (channel->edid); -i2c_put_adapter (channel->ddc); +i2c_put_adapter (channel->connector.ddc); } }
Signature · 6 lines
2.17.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v4 10/23 drm/imx: imx-tve: Provide ddc symlink in connector's sysfs
In reply to Andrzej PietrasiewiczUse the ddc pointer provided by the generic connector.
--- drivers/gpu/drm/imx/imx-tve.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/gpu/drm/imx/imx-tve.c +3 -5
@@ -109,7 +109,6 @@ struct imx_tve {struct regmap *regmap;struct regulator *dac_reg; -struct i2c_adapter *ddc;struct clk *clk;struct clk *di_sel_clk;struct clk_hw clk_hw_di;
@@ -218,14 +217,13 @@ static int tve_setup_vga(struct imx_tve *tve)static int imx_tve_connector_get_modes (struct drm_connector *connector) { -struct imx_tve *tve =con_to_tve (connector);struct edid *edid;int ret =0 ; -if (!tve->ddc) +if (!connector->ddc)return 0 ; - edid =drm_get_edid (connector, tve->ddc); + edid =drm_get_edid (connector, connector->ddc);if (edid) {drm_connector_update_edid_property (connector, edid); ret =drm_add_edid_modes (connector, edid);
@@ -551,7 +549,7 @@ static int imx_tve_bind(struct device *dev, struct device *master, void *data) ddc_node =of_parse_phandle (np,"ddc-i2c-bus" ,0 );if (ddc_node) { - tve->ddc =of_find_i2c_adapter_by_node (ddc_node); + tve->connector.ddc =of_find_i2c_adapter_by_node (ddc_node);of_node_put (ddc_node); }
Signature · 6 lines
2.17.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v4 11/23 drm/vc4: Provide ddc symlink in connector sysfs directory
In reply to Andrzej PietrasiewiczUse the ddc pointer provided by the generic connector.
--- drivers/gpu/drm/vc4/vc4_hdmi.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-)
drivers/gpu/drm/vc4/vc4_hdmi.c +12 -9
@@ -76,7 +76,6 @@ struct vc4_hdmi {struct vc4_hdmi_audio audio; -struct i2c_adapter *ddc;void __iomem *hdmicore_regs;void __iomem *hd_regs;int hpd_gpio;
@@ -207,7 +206,7 @@ vc4_hdmi_connector_detect(struct drm_connector *connector, bool force)return connector_status_disconnected; } -if (drm_probe_ddc (vc4->hdmi->ddc)) +if (drm_probe_ddc (connector->ddc))return connector_status_connected;if (HDMI_READ (VC4_HDMI_HOTPLUG ) &VC4_HDMI_HOTPLUG_CONNECTED )
@@ -233,7 +232,7 @@ static int vc4_hdmi_connector_get_modes(struct drm_connector *connector)int ret =0 ;struct edid *edid; - edid =drm_get_edid (connector, vc4->hdmi->ddc); + edid =drm_get_edid (connector, connector->ddc);cec_s_phys_addr_from_edid (vc4->hdmi->cec_adap, edid);if (!edid)return -ENODEV ;
@@ -267,7 +266,8 @@ static const struct drm_connector_helper_funcs vc4_hdmi_connector_helper_funcs = };static struct drm_connector *vc4_hdmi_connector_init (struct drm_device *dev, -struct drm_encoder *encoder) +struct drm_encoder *encoder, +struct i2c_adapter *ddc) {struct drm_connector *connector;struct vc4_hdmi_connector *hdmi_connector;
@@ -280,6 +280,7 @@ static struct drm_connector *vc4_hdmi_connector_init(struct drm_device *dev, connector = &hdmi_connector->base; hdmi_connector->encoder = encoder; + connector->ddc = ddc;drm_connector_init (dev, connector, &vc4_hdmi_connector_funcs,DRM_MODE_CONNECTOR_HDMIA );
@@ -1291,6 +1292,7 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data)struct vc4_hdmi *hdmi;struct vc4_hdmi_encoder *vc4_hdmi_encoder;struct device_node *ddc_node; +struct i2c_adapter *ddc;u32 value;int ret;
@@ -1338,9 +1340,9 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data)return -ENODEV ; } - hdmi->ddc =of_find_i2c_adapter_by_node (ddc_node); + ddc =of_find_i2c_adapter_by_node (ddc_node);of_node_put (ddc_node); -if (!hdmi->ddc) { +if (ddc) {DRM_DEBUG ("Failed to get ddc i2c adapter by node\n" );return -EPROBE_DEFER ; }
@@ -1395,7 +1397,7 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data) DRM_MODE_ENCODER_TMDS, NULL);drm_encoder_helper_add (hdmi->encoder, &vc4_hdmi_encoder_helper_funcs); - hdmi->connector =vc4_hdmi_connector_init (drm, hdmi->encoder); + hdmi->connector =vc4_hdmi_connector_init (drm, hdmi->encoder, ddc);if (IS_ERR (hdmi->connector)) { ret =PTR_ERR (hdmi->connector); goto err_destroy_encoder;
@@ -1452,7 +1454,7 @@ static int vc4_hdmi_bind(struct device *dev, struct device *master, void *data)clk_disable_unprepare (hdmi->hsm_clock);pm_runtime_disable (dev); err_put_i2c: -put_device (&hdmi->ddc->dev); +put_device (&ddc->dev);return ret; }
@@ -1463,6 +1465,7 @@ static void vc4_hdmi_unbind(struct device *dev, struct device *master,struct drm_device *drm =dev_get_drvdata (master);struct vc4_dev *vc4 = drm->dev_private;struct vc4_hdmi *hdmi = vc4->hdmi; +struct i2c_adapter *ddc = hdmi->connector->ddc;cec_unregister_adapter (hdmi->cec_adap);vc4_hdmi_connector_destroy (hdmi->connector);
@@ -1471,7 +1474,7 @@ static void vc4_hdmi_unbind(struct device *dev, struct device *master,clk_disable_unprepare (hdmi->hsm_clock);pm_runtime_disable (dev); -put_device (&hdmi->ddc->dev); +put_device (&ddc->dev); vc4->hdmi =NULL ; }
Signature · 6 lines
2.17.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v4 12/23 drm: zte: Provide ddc symlink in hdmi connector sysfs directory
In reply to Andrzej PietrasiewiczUse the ddc pointer provided by the generic connector.
--- drivers/gpu/drm/zte/zx_hdmi.c | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-)
drivers/gpu/drm/zte/zx_hdmi.c +9 -16
@@ -29,15 +29,11 @@#define ZX_HDMI_INFOFRAME_SIZE 31#define DDC_SEGMENT_ADDR 0x30 -struct zx_hdmi_i2c { -struct i2c_adapter adap; -struct mutex lock; -}; -struct zx_hdmi {struct drm_connector connector;struct drm_encoder encoder; -struct zx_hdmi_i2c *ddc; +/* protects ddc access */ +struct mutex ddc_lock;struct device *dev;struct drm_device *drm;void __iomem *mmio;
@@ -264,7 +260,7 @@ static int zx_hdmi_connector_get_modes(struct drm_connector *connector)struct edid *edid;int ret; - edid =drm_get_edid (connector, &hdmi->ddc->adap); + edid =drm_get_edid (connector, connector->ddc);if (!edid)return 0 ;
@@ -562,10 +558,9 @@ static int zx_hdmi_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) {struct zx_hdmi *hdmi =i2c_get_adapdata (adap); -struct zx_hdmi_i2c *ddc = hdmi->ddc;int i, ret =0 ; -mutex_lock (&ddc->lock); +mutex_lock (&hdmi->ddc_lock);/* Enable DDC master access */ hdmi_writeb_mask (hdmi,TPI_DDC_MASTER_EN ,HW_DDC_MASTER ,HW_DDC_MASTER );
@@ -590,7 +585,7 @@ static int zx_hdmi_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,/* Disable DDC master access */ hdmi_writeb_mask (hdmi,TPI_DDC_MASTER_EN ,HW_DDC_MASTER ,0 ); -mutex_unlock (&ddc->lock); +mutex_unlock (&hdmi->ddc_lock);return ret; }
@@ -608,17 +603,15 @@ static const struct i2c_algorithm zx_hdmi_algorithm = {static int zx_hdmi_ddc_register (struct zx_hdmi *hdmi) {struct i2c_adapter *adap; -struct zx_hdmi_i2c *ddc;int ret; - ddc =devm_kzalloc (hdmi->dev,sizeof (*ddc),GFP_KERNEL ); -if (!ddc) + adap =devm_kzalloc (hdmi->dev,sizeof (*adap),GFP_KERNEL ); +if (!adap)return -ENOMEM ; - hdmi->ddc = ddc; -mutex_init (&ddc->lock); + hdmi->connector.ddc = adap; +mutex_init (&hdmi->ddc_lock); - adap = &ddc->adap; adap->owner =THIS_MODULE ; adap->class =I2C_CLASS_DDC ; adap->dev.parent = hdmi->dev;
Signature · 6 lines
2.17.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v4 13/23 drm: zte: Provide ddc symlink in vga connector sysfs directory
In reply to Andrzej PietrasiewiczUse the ddc pointer provided by the generic connector.
--- drivers/gpu/drm/zte/zx_vga.c | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-)
drivers/gpu/drm/zte/zx_vga.c +9 -16
@@ -23,15 +23,11 @@ struct zx_vga_pwrctrl {u32 mask; }; -struct zx_vga_i2c { -struct i2c_adapter adap; -struct mutex lock; -}; -struct zx_vga {struct drm_connector connector;struct drm_encoder encoder; -struct zx_vga_i2c *ddc; +/* protects ddc access */ +struct mutex ddc_lock;struct device *dev;void __iomem *mmio;struct clk *i2c_wclk;
@@ -86,7 +82,7 @@ static int zx_vga_connector_get_modes(struct drm_connector *connector)*/ zx_writel (vga->mmio +VGA_AUTO_DETECT_SEL ,0 ); - edid =drm_get_edid (connector, &vga->ddc->adap); + edid =drm_get_edid (connector, connector->ddc);if (!edid) {/* * If EDID reading fails, we set the device state into
@@ -282,11 +278,10 @@ static int zx_vga_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) {struct zx_vga *vga =i2c_get_adapdata (adap); -struct zx_vga_i2c *ddc = vga->ddc;int ret =0 ;int i; -mutex_lock (&ddc->lock); +mutex_lock (&vga->ddc_lock);for (i =0 ; i < num; i++) {if (msgs[i].flags &I2C_M_RD )
@@ -301,7 +296,7 @@ static int zx_vga_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,if (!ret) ret = num; -mutex_unlock (&ddc->lock); +mutex_unlock (&vga->ddc_lock);return ret; }
@@ -320,17 +315,15 @@ static int zx_vga_ddc_register(struct zx_vga *vga) {struct device *dev = vga->dev;struct i2c_adapter *adap; -struct zx_vga_i2c *ddc;int ret; - ddc =devm_kzalloc (dev,sizeof (*ddc),GFP_KERNEL ); -if (!ddc) + adap =devm_kzalloc (dev,sizeof (*adap),GFP_KERNEL ); +if (!adap)return -ENOMEM ; - vga->ddc = ddc; -mutex_init (&ddc->lock); + vga->connector.ddc = adap; +mutex_init (&vga->ddc_lock); - adap = &ddc->adap; adap->owner =THIS_MODULE ; adap->class =I2C_CLASS_DDC ; adap->dev.parent = dev;
Signature · 6 lines
2.17.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v4 14/23 drm/tilcdc: Provide ddc symlink in connector sysfs directory
In reply to Andrzej PietrasiewiczUse the ddc pointer provided by the generic connector.
--- drivers/gpu/drm/tilcdc/tilcdc_tfp410.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/tilcdc/tilcdc_tfp410.c +1 -0
@@ -219,6 +219,7 @@ static struct drm_connector *tfp410_connector_create(struct drm_device *dev, tfp410_connector->mod = mod; connector = &tfp410_connector->base; + connector->ddc = mod->i2c;drm_connector_init (dev, connector, &tfp410_connector_funcs,DRM_MODE_CONNECTOR_DVID );
Signature · 6 lines
2.17.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v4 15/23 drm: sti: Provide ddc symlink in hdmi connector sysfs directory
In reply to a message not in the archiveUse the ddc pointer provided by the generic connector.
--- drivers/gpu/drm/sti/sti_hdmi.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/sti/sti_hdmi.c +1 -0
@@ -1279,6 +1279,7 @@ static int sti_hdmi_bind(struct device *dev, struct device *master, void *data)drm_bridge_attach (encoder, bridge,NULL ); connector->encoder = encoder; + drm_connector->ddc = hdmi->ddc_adapt; drm_connector = (struct drm_connector *)connector;
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH v4 16/23 drm/mgag200: Provide ddc symlink in connector sysfs directory
In reply to a message not in the archiveUse the ddc pointer provided by the generic connector.
--- drivers/gpu/drm/mgag200/mgag200_mode.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/gpu/drm/mgag200/mgag200_mode.c +5 -4
@@ -1703,6 +1703,11 @@ static struct drm_connector *mga_vga_init(struct drm_device *dev)return NULL ; connector = &mga_connector->base; + mga_connector->i2c =mgag200_i2c_create (dev); +if (!mga_connector->i2c) +DRM_ERROR ("failed to add ddc bus\n" ); + + connector->ddc = &mga_connector->i2c->adapter;drm_connector_init (dev, connector, &mga_vga_connector_funcs,DRM_MODE_CONNECTOR_VGA );
@@ -1711,10 +1716,6 @@ static struct drm_connector *mga_vga_init(struct drm_device *dev)drm_connector_register (connector); - mga_connector->i2c =mgag200_i2c_create (dev); -if (!mga_connector->i2c) -DRM_ERROR ("failed to add ddc bus\n" ); -return connector; }
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH v4 17/23 drm/ast: Provide ddc symlink in connector sysfs directory
In reply to a message not in the archiveUse the ddc pointer provided by the generic connector.
--- drivers/gpu/drm/ast/ast_mode.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/gpu/drm/ast/ast_mode.c +5 -4
@@ -890,6 +890,11 @@ static int ast_connector_init(struct drm_device *dev)return -ENOMEM ; connector = &ast_connector->base; + ast_connector->i2c =ast_i2c_create (dev); +if (!ast_connector->i2c) +DRM_ERROR ("failed to add ddc bus for connector\n" ); + + connector->ddc = &ast_connector->i2c->adapter;drm_connector_init (dev, connector, &ast_connector_funcs,DRM_MODE_CONNECTOR_VGA );drm_connector_helper_add (connector, &ast_connector_helper_funcs);
@@ -904,10 +909,6 @@ static int ast_connector_init(struct drm_device *dev) encoder = list_first_entry(&dev->mode_config.encoder_list, struct drm_encoder, head);drm_connector_attach_encoder (connector, encoder); - ast_connector->i2c =ast_i2c_create (dev); -if (!ast_connector->i2c) -DRM_ERROR ("failed to add ddc bus for connector\n" ); -return 0 ; }
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH v4 18/23 drm/bridge: dumb-vga-dac: Provide ddc symlink in connector sysfs directory
In reply to a message not in the archiveUse the ddc pointer provided by the generic connector.
--- drivers/gpu/drm/bridge/dumb-vga-dac.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-)
drivers/gpu/drm/bridge/dumb-vga-dac.c +9 -10
@@ -20,7 +20,6 @@ struct dumb_vga {struct drm_bridge bridge;struct drm_connector connector; -struct i2c_adapter *ddc;struct regulator *vdd; };
@@ -42,10 +41,10 @@ static int dumb_vga_get_modes(struct drm_connector *connector)struct edid *edid;int ret; -if (IS_ERR (vga->ddc)) +if (IS_ERR (vga->connector.ddc)) goto fallback; - edid =drm_get_edid (connector, vga->ddc); + edid =drm_get_edid (connector, vga->connector.ddc);if (!edid) {DRM_INFO ("EDID readout failed, falling back to standard modes\n" ); goto fallback;
@@ -84,7 +83,7 @@ dumb_vga_connector_detect(struct drm_connector *connector, bool force)* wire the DDC pins, or the I2C bus might not be working at * all. */ -if (!IS_ERR (vga->ddc) &&drm_probe_ddc (vga->ddc)) +if (!IS_ERR (vga->connector.ddc) &&drm_probe_ddc (vga->connector.ddc))return connector_status_connected;return connector_status_unknown;
@@ -190,14 +189,14 @@ static int dumb_vga_probe(struct platform_device *pdev)dev_dbg (&pdev->dev,"No vdd regulator found: %d\n" , ret); } - vga->ddc =dumb_vga_retrieve_ddc (&pdev->dev); -if (IS_ERR (vga->ddc)) { -if (PTR_ERR (vga->ddc) == -ENODEV ) { + vga->connector.ddc =dumb_vga_retrieve_ddc (&pdev->dev); +if (IS_ERR (vga->connector.ddc)) { +if (PTR_ERR (vga->connector.ddc) == -ENODEV ) {dev_dbg (&pdev->dev,"No i2c bus specified. Disabling EDID readout\n" ); }else {dev_err (&pdev->dev,"Couldn't retrieve i2c bus\n" ); -return PTR_ERR (vga->ddc); +return PTR_ERR (vga->connector.ddc); } }
@@ -216,8 +215,8 @@ static int dumb_vga_remove(struct platform_device *pdev)drm_bridge_remove (&vga->bridge); -if (!IS_ERR (vga->ddc)) -i2c_put_adapter (vga->ddc); +if (!IS_ERR (vga->connector.ddc)) +i2c_put_adapter (vga->connector.ddc);return 0 ; }
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH v4 19/23 drm/bridge: dw-hdmi: Provide ddc symlink in connector sysfs directory
In reply to Andrzej PietrasiewiczUse the ddc pointer provided by the generic connector.
--- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 40 +++++++++++------------ 1 file changed, 20 insertions(+), 20 deletions(-)
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +20 -20
@@ -161,7 +161,6 @@ struct dw_hdmi {struct drm_display_mode previous_mode; -struct i2c_adapter *ddc;void __iomem *regs;bool sink_is_hdmi;bool sink_has_audio;
@@ -1118,7 +1117,7 @@ static bool dw_hdmi_support_scdc(struct dw_hdmi *hdmi)return false;/* Disable if no DDC bus */ -if (!hdmi->ddc) +if (!hdmi->connector.ddc)return false;/* Disable if SCDC is not supported, or if an HF-VSDB block is absent */
@@ -1156,10 +1155,11 @@ void dw_hdmi_set_high_tmds_clock_ratio(struct dw_hdmi *hdmi)/* Control for TMDS Bit Period/TMDS Clock-Period Ratio */ if (dw_hdmi_support_scdc (hdmi)) { +struct i2c_adapter *ddc = hdmi->connector.ddc;if (mtmdsclock >HDMI14_MAX_TMDSCLK ) -drm_scdc_set_high_tmds_clock_ratio (hdmi->ddc,1 ); +drm_scdc_set_high_tmds_clock_ratio (ddc,1 );else -drm_scdc_set_high_tmds_clock_ratio (hdmi->ddc,0 ); +drm_scdc_set_high_tmds_clock_ratio (ddc,0 ); } }EXPORT_SYMBOL_GPL (dw_hdmi_set_high_tmds_clock_ratio);
@@ -1750,6 +1750,7 @@ static void hdmi_av_composer(struct dw_hdmi *hdmi,if (dw_hdmi_support_scdc (hdmi)) {if (vmode->mtmdsclock >HDMI14_MAX_TMDSCLK || hdmi_info->scdc.scrambling.low_rates) { +struct i2c_adapter *ddc = hdmi->connector.ddc;/* * HDMI2.0 Specifies the following procedure: * After the Source Device has determined that
@@ -1759,13 +1760,12 @@ static void hdmi_av_composer(struct dw_hdmi *hdmi,* Source Devices compliant shall set the * Source Version = 1. */ -drm_scdc_readb (hdmi->ddc,SCDC_SINK_VERSION , - &bytes); -drm_scdc_writeb (hdmi->ddc,SCDC_SOURCE_VERSION , +drm_scdc_readb (ddc,SCDC_SINK_VERSION , &bytes); +drm_scdc_writeb (ddc,SCDC_SOURCE_VERSION ,min_t (u8, bytes,SCDC_MIN_SOURCE_VERSION ));/* Enabled Scrambling in the Sink */ -drm_scdc_set_scrambling (hdmi->ddc,1 ); +drm_scdc_set_scrambling (hdmi->connector.ddc,1 );/* * To activate the scrambler feature, you must ensure
@@ -1781,7 +1781,7 @@ static void hdmi_av_composer(struct dw_hdmi *hdmi,hdmi_writeb (hdmi,0 ,HDMI_FC_SCRAMBLER_CTRL );hdmi_writeb (hdmi, (u8 )~HDMI_MC_SWRSTZ_TMDSSWRST_REQ ,HDMI_MC_SWRSTZ ); -drm_scdc_set_scrambling (hdmi->ddc,0 ); +drm_scdc_set_scrambling (hdmi->connector.ddc,0 ); } }
@@ -2127,10 +2127,10 @@ static int dw_hdmi_connector_get_modes(struct drm_connector *connector)struct edid *edid;int ret =0 ; -if (!hdmi->ddc) +if (!hdmi->connector.ddc)return 0 ; - edid =drm_get_edid (connector, hdmi->ddc); + edid =drm_get_edid (connector, hdmi->connector.ddc);if (edid) {dev_dbg (hdmi->dev,"got edid: width[%d] x height[%d]\n" , edid->width_cm, edid->height_cm);
@@ -2548,9 +2548,9 @@ __dw_hdmi_probe(struct platform_device *pdev, ddc_node =of_parse_phandle (np,"ddc-i2c-bus" ,0 );if (ddc_node) { - hdmi->ddc =of_get_i2c_adapter_by_node (ddc_node); + hdmi->connector.ddc =of_get_i2c_adapter_by_node (ddc_node);of_node_put (ddc_node); -if (!hdmi->ddc) { +if (!hdmi->connector.ddc) {dev_dbg (hdmi->dev,"failed to read ddc node\n" );return ERR_PTR (-EPROBE_DEFER ); }
@@ -2689,7 +2689,7 @@ __dw_hdmi_probe(struct platform_device *pdev,hdmi_init_clk_regenerator (hdmi);/* If DDC bus is not specified, try to register HDMI I2C bus */ -if (!hdmi->ddc) { +if (!hdmi->connector.ddc) {/* Look for (optional) stuff related to unwedging */ hdmi->pinctrl =devm_pinctrl_get (dev);if (!IS_ERR (hdmi->pinctrl)) {
@@ -2708,9 +2708,9 @@ __dw_hdmi_probe(struct platform_device *pdev, } } - hdmi->ddc =dw_hdmi_i2c_adapter (hdmi); -if (IS_ERR (hdmi->ddc)) - hdmi->ddc =NULL ; + hdmi->connector.ddc =dw_hdmi_i2c_adapter (hdmi); +if (IS_ERR (hdmi->connector.ddc)) + hdmi->connector.ddc =NULL ; } hdmi->bridge.driver_private = hdmi;
@@ -2776,7 +2776,7 @@ __dw_hdmi_probe(struct platform_device *pdev, err_iahb:if (hdmi->i2c) {i2c_del_adapter (&hdmi->i2c->adap); - hdmi->ddc =NULL ; + hdmi->connector.ddc =NULL ; }if (hdmi->cec_notifier)
@@ -2788,7 +2788,7 @@ __dw_hdmi_probe(struct platform_device *pdev, err_isfr:clk_disable_unprepare (hdmi->isfr_clk); err_res: -i2c_put_adapter (hdmi->ddc); +i2c_put_adapter (hdmi->connector.ddc);return ERR_PTR (ret); }
@@ -2814,7 +2814,7 @@ static void __dw_hdmi_remove(struct dw_hdmi *hdmi)if (hdmi->i2c)i2c_del_adapter (&hdmi->i2c->adap);else -i2c_put_adapter (hdmi->ddc); +i2c_put_adapter (hdmi->connector.ddc); }/* -----------------------------------------------------------------------------
Signature · 6 lines
2.17.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v4 20/23 drm/bridge: ti-tfp410: Provide ddc symlink in connector sysfs directory
In reply to a message not in the archiveUse the ddc pointer provided by the generic connector.
--- drivers/gpu/drm/bridge/ti-tfp410.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-)
drivers/gpu/drm/bridge/ti-tfp410.c +9 -10
@@ -26,7 +26,6 @@ struct tfp410 {unsigned int connector_type;u32 bus_format; -struct i2c_adapter *ddc;struct gpio_desc *hpd;int hpd_irq;struct delayed_work hpd_work;
@@ -55,10 +54,10 @@ static int tfp410_get_modes(struct drm_connector *connector)struct edid *edid;int ret; -if (!dvi->ddc) +if (!dvi->connector.ddc) goto fallback; - edid =drm_get_edid (connector, dvi->ddc); + edid =drm_get_edid (connector, dvi->connector.ddc);if (!edid) {DRM_INFO ("EDID read failed. Fallback to standard modes\n" ); goto fallback;
@@ -98,8 +97,8 @@ tfp410_connector_detect(struct drm_connector *connector, bool force)return connector_status_disconnected; } -if (dvi->ddc) { -if (drm_probe_ddc (dvi->ddc)) +if (dvi->connector.ddc) { +if (drm_probe_ddc (dvi->connector.ddc))return connector_status_connected;else return connector_status_disconnected;
@@ -297,8 +296,8 @@ static int tfp410_get_connector_properties(struct tfp410 *dvi)if (!ddc_phandle) goto fail; - dvi->ddc =of_get_i2c_adapter_by_node (ddc_phandle); -if (dvi->ddc) + dvi->connector.ddc =of_get_i2c_adapter_by_node (ddc_phandle); +if (dvi->connector.ddc)dev_info (dvi->dev,"Connector's ddc i2c bus found\n" );else ret = -EPROBE_DEFER ;
@@ -367,7 +366,7 @@ static int tfp410_init(struct device *dev, bool i2c)return 0 ; fail: -i2c_put_adapter (dvi->ddc); +i2c_put_adapter (dvi->connector.ddc);if (dvi->hpd)gpiod_put (dvi->hpd);return ret;
@@ -382,8 +381,8 @@ static int tfp410_fini(struct device *dev)drm_bridge_remove (&dvi->bridge); -if (dvi->ddc) -i2c_put_adapter (dvi->ddc); +if (dvi->connector.ddc) +i2c_put_adapter (dvi->connector.ddc);if (dvi->hpd)gpiod_put (dvi->hpd);
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH v4 21/23 drm/amdgpu: Provide ddc symlink in connector sysfs directory
In reply to Andrzej PietrasiewiczUse the ddc pointer provided by the generic connector.
--- .../gpu/drm/amd/amdgpu/amdgpu_connectors.c | 56 ++++++++++++------- 1 file changed, 36 insertions(+), 20 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c +36 -20
@@ -1574,10 +1574,12 @@ amdgpu_connector_add(struct amdgpu_device *adev, amdgpu_connector->con_priv = amdgpu_dig_connector;if (i2c_bus->valid) { amdgpu_connector->ddc_bus =amdgpu_i2c_lookup (adev, i2c_bus); -if (amdgpu_connector->ddc_bus) +if (amdgpu_connector->ddc_bus) { has_aux = true; -else + connector->ddc = &amdgpu_connector->ddc_bus->adapter; + }else {DRM_ERROR ("DP: Failed to assign ddc bus! Check dmesg for i2c errors.\n" ); + } }switch (connector_type) {case DRM_MODE_CONNECTOR_VGA :
@@ -1659,13 +1661,15 @@ amdgpu_connector_add(struct amdgpu_device *adev, }else {switch (connector_type) {case DRM_MODE_CONNECTOR_VGA : -drm_connector_init (dev, &amdgpu_connector->base, &amdgpu_connector_vga_funcs, connector_type); -drm_connector_helper_add (&amdgpu_connector->base, &amdgpu_connector_vga_helper_funcs);if (i2c_bus->valid) { amdgpu_connector->ddc_bus =amdgpu_i2c_lookup (adev, i2c_bus);if (!amdgpu_connector->ddc_bus)DRM_ERROR ("VGA: Failed to assign ddc bus! Check dmesg for i2c errors.\n" ); +else + connector->ddc = &amdgpu_connector->ddc_bus->adapter; } +drm_connector_init (dev, &amdgpu_connector->base, &amdgpu_connector_vga_funcs, connector_type); +drm_connector_helper_add (&amdgpu_connector->base, &amdgpu_connector_vga_helper_funcs); amdgpu_connector->dac_load_detect = true; drm_object_attach_property(&amdgpu_connector->base.base, adev->mode_info.load_detect_property,
@@ -1679,13 +1683,15 @@ amdgpu_connector_add(struct amdgpu_device *adev, connector->doublescan_allowed = true;break ;case DRM_MODE_CONNECTOR_DVIA : -drm_connector_init (dev, &amdgpu_connector->base, &amdgpu_connector_vga_funcs, connector_type); -drm_connector_helper_add (&amdgpu_connector->base, &amdgpu_connector_vga_helper_funcs);if (i2c_bus->valid) { amdgpu_connector->ddc_bus =amdgpu_i2c_lookup (adev, i2c_bus);if (!amdgpu_connector->ddc_bus)DRM_ERROR ("DVIA: Failed to assign ddc bus! Check dmesg for i2c errors.\n" ); +else + connector->ddc = &amdgpu_connector->ddc_bus->adapter; } +drm_connector_init (dev, &amdgpu_connector->base, &amdgpu_connector_vga_funcs, connector_type); +drm_connector_helper_add (&amdgpu_connector->base, &amdgpu_connector_vga_helper_funcs); amdgpu_connector->dac_load_detect = true; drm_object_attach_property(&amdgpu_connector->base.base, adev->mode_info.load_detect_property,
@@ -1704,13 +1710,15 @@ amdgpu_connector_add(struct amdgpu_device *adev,if (!amdgpu_dig_connector) goto failed; amdgpu_connector->con_priv = amdgpu_dig_connector; -drm_connector_init (dev, &amdgpu_connector->base, &amdgpu_connector_dvi_funcs, connector_type); -drm_connector_helper_add (&amdgpu_connector->base, &amdgpu_connector_dvi_helper_funcs);if (i2c_bus->valid) { amdgpu_connector->ddc_bus =amdgpu_i2c_lookup (adev, i2c_bus);if (!amdgpu_connector->ddc_bus)DRM_ERROR ("DVI: Failed to assign ddc bus! Check dmesg for i2c errors.\n" ); +else + connector->ddc = &amdgpu_connector->ddc_bus->adapter; } +drm_connector_init (dev, &amdgpu_connector->base, &amdgpu_connector_dvi_funcs, connector_type); +drm_connector_helper_add (&amdgpu_connector->base, &amdgpu_connector_dvi_helper_funcs); subpixel_order = SubPixelHorizontalRGB; drm_object_attach_property(&amdgpu_connector->base.base, adev->mode_info.coherent_mode_property,
@@ -1754,13 +1762,15 @@ amdgpu_connector_add(struct amdgpu_device *adev,if (!amdgpu_dig_connector) goto failed; amdgpu_connector->con_priv = amdgpu_dig_connector; -drm_connector_init (dev, &amdgpu_connector->base, &amdgpu_connector_dvi_funcs, connector_type); -drm_connector_helper_add (&amdgpu_connector->base, &amdgpu_connector_dvi_helper_funcs);if (i2c_bus->valid) { amdgpu_connector->ddc_bus =amdgpu_i2c_lookup (adev, i2c_bus);if (!amdgpu_connector->ddc_bus)DRM_ERROR ("HDMI: Failed to assign ddc bus! Check dmesg for i2c errors.\n" ); +else + connector->ddc = &amdgpu_connector->ddc_bus->adapter; } +drm_connector_init (dev, &amdgpu_connector->base, &amdgpu_connector_dvi_funcs, connector_type); +drm_connector_helper_add (&amdgpu_connector->base, &amdgpu_connector_dvi_helper_funcs);drm_object_attach_property (&amdgpu_connector->base.base, adev->mode_info.coherent_mode_property,1 );
@@ -1796,15 +1806,17 @@ amdgpu_connector_add(struct amdgpu_device *adev,if (!amdgpu_dig_connector) goto failed; amdgpu_connector->con_priv = amdgpu_dig_connector; -drm_connector_init (dev, &amdgpu_connector->base, &amdgpu_connector_dp_funcs, connector_type); -drm_connector_helper_add (&amdgpu_connector->base, &amdgpu_connector_dp_helper_funcs);if (i2c_bus->valid) { amdgpu_connector->ddc_bus =amdgpu_i2c_lookup (adev, i2c_bus); -if (amdgpu_connector->ddc_bus) +if (amdgpu_connector->ddc_bus) { has_aux = true; -else + connector->ddc = &amdgpu_connector->ddc_bus->adapter; + }else {DRM_ERROR ("DP: Failed to assign ddc bus! Check dmesg for i2c errors.\n" ); + } } +drm_connector_init (dev, &amdgpu_connector->base, &amdgpu_connector_dp_funcs, connector_type); +drm_connector_helper_add (&amdgpu_connector->base, &amdgpu_connector_dp_helper_funcs); subpixel_order = SubPixelHorizontalRGB; drm_object_attach_property(&amdgpu_connector->base.base, adev->mode_info.coherent_mode_property,
@@ -1838,15 +1850,17 @@ amdgpu_connector_add(struct amdgpu_device *adev,if (!amdgpu_dig_connector) goto failed; amdgpu_connector->con_priv = amdgpu_dig_connector; -drm_connector_init (dev, &amdgpu_connector->base, &amdgpu_connector_edp_funcs, connector_type); -drm_connector_helper_add (&amdgpu_connector->base, &amdgpu_connector_dp_helper_funcs);if (i2c_bus->valid) { amdgpu_connector->ddc_bus =amdgpu_i2c_lookup (adev, i2c_bus); -if (amdgpu_connector->ddc_bus) +if (amdgpu_connector->ddc_bus) { has_aux = true; -else + connector->ddc = &amdgpu_connector->ddc_bus->adapter; + }else {DRM_ERROR ("DP: Failed to assign ddc bus! Check dmesg for i2c errors.\n" ); + } } +drm_connector_init (dev, &amdgpu_connector->base, &amdgpu_connector_edp_funcs, connector_type); +drm_connector_helper_add (&amdgpu_connector->base, &amdgpu_connector_dp_helper_funcs);drm_object_attach_property (&amdgpu_connector->base.base, dev->mode_config.scaling_mode_property,DRM_MODE_SCALE_FULLSCREEN );
@@ -1859,13 +1873,15 @@ amdgpu_connector_add(struct amdgpu_device *adev,if (!amdgpu_dig_connector) goto failed; amdgpu_connector->con_priv = amdgpu_dig_connector; -drm_connector_init (dev, &amdgpu_connector->base, &amdgpu_connector_lvds_funcs, connector_type); -drm_connector_helper_add (&amdgpu_connector->base, &amdgpu_connector_lvds_helper_funcs);if (i2c_bus->valid) { amdgpu_connector->ddc_bus =amdgpu_i2c_lookup (adev, i2c_bus);if (!amdgpu_connector->ddc_bus)DRM_ERROR ("LVDS: Failed to assign ddc bus! Check dmesg for i2c errors.\n" ); +else + connector->ddc = &amdgpu_connector->ddc_bus->adapter; } +drm_connector_init (dev, &amdgpu_connector->base, &amdgpu_connector_lvds_funcs, connector_type); +drm_connector_helper_add (&amdgpu_connector->base, &amdgpu_connector_lvds_helper_funcs);drm_object_attach_property (&amdgpu_connector->base.base, dev->mode_config.scaling_mode_property,DRM_MODE_SCALE_FULLSCREEN );
Signature · 6 lines
2.17.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v4 22/23 drm/radeon: Provide ddc symlink in connector sysfs directory
In reply to Andrzej PietrasiewiczUse the ddc pointer provided by the generic connector.
--- drivers/gpu/drm/radeon/radeon_connectors.c | 80 ++++++++++++++-------- 1 file changed, 52 insertions(+), 28 deletions(-)
drivers/gpu/drm/radeon/radeon_connectors.c +52 -28
@@ -1947,10 +1947,12 @@ radeon_add_atom_connector(struct drm_device *dev, radeon_connector->con_priv = radeon_dig_connector;if (i2c_bus->valid) { radeon_connector->ddc_bus =radeon_i2c_lookup (rdev, i2c_bus); -if (radeon_connector->ddc_bus) +if (radeon_connector->ddc_bus) { has_aux = true; -else + connector->ddc = &radeon_connector->ddc_bus->adapter; + }else {DRM_ERROR ("DP: Failed to assign ddc bus! Check dmesg for i2c errors.\n" ); + } }switch (connector_type) {case DRM_MODE_CONNECTOR_VGA :
@@ -2042,13 +2044,15 @@ radeon_add_atom_connector(struct drm_device *dev, }else {switch (connector_type) {case DRM_MODE_CONNECTOR_VGA : -drm_connector_init (dev, &radeon_connector->base, &radeon_vga_connector_funcs, connector_type); -drm_connector_helper_add (&radeon_connector->base, &radeon_vga_connector_helper_funcs);if (i2c_bus->valid) { radeon_connector->ddc_bus =radeon_i2c_lookup (rdev, i2c_bus);if (!radeon_connector->ddc_bus)DRM_ERROR ("VGA: Failed to assign ddc bus! Check dmesg for i2c errors.\n" ); +else + connector->ddc = &radeon_connector->ddc_bus->adapter; } +drm_connector_init (dev, &radeon_connector->base, &radeon_vga_connector_funcs, connector_type); +drm_connector_helper_add (&radeon_connector->base, &radeon_vga_connector_helper_funcs); radeon_connector->dac_load_detect = true; drm_object_attach_property(&radeon_connector->base.base, rdev->mode_info.load_detect_property,
@@ -2067,13 +2071,15 @@ radeon_add_atom_connector(struct drm_device *dev, connector->doublescan_allowed = true;break ;case DRM_MODE_CONNECTOR_DVIA : -drm_connector_init (dev, &radeon_connector->base, &radeon_vga_connector_funcs, connector_type); -drm_connector_helper_add (&radeon_connector->base, &radeon_vga_connector_helper_funcs);if (i2c_bus->valid) { radeon_connector->ddc_bus =radeon_i2c_lookup (rdev, i2c_bus);if (!radeon_connector->ddc_bus)DRM_ERROR ("DVIA: Failed to assign ddc bus! Check dmesg for i2c errors.\n" ); +else + connector->ddc = &radeon_connector->ddc_bus->adapter; } +drm_connector_init (dev, &radeon_connector->base, &radeon_vga_connector_funcs, connector_type); +drm_connector_helper_add (&radeon_connector->base, &radeon_vga_connector_helper_funcs); radeon_connector->dac_load_detect = true; drm_object_attach_property(&radeon_connector->base.base, rdev->mode_info.load_detect_property,
@@ -2098,13 +2104,15 @@ radeon_add_atom_connector(struct drm_device *dev, goto failed; radeon_dig_connector->igp_lane_info = igp_lane_info; radeon_connector->con_priv = radeon_dig_connector; -drm_connector_init (dev, &radeon_connector->base, &radeon_dvi_connector_funcs, connector_type); -drm_connector_helper_add (&radeon_connector->base, &radeon_dvi_connector_helper_funcs);if (i2c_bus->valid) { radeon_connector->ddc_bus =radeon_i2c_lookup (rdev, i2c_bus);if (!radeon_connector->ddc_bus)DRM_ERROR ("DVI: Failed to assign ddc bus! Check dmesg for i2c errors.\n" ); +else + connector->ddc = &radeon_connector->ddc_bus->adapter; } +drm_connector_init (dev, &radeon_connector->base, &radeon_dvi_connector_funcs, connector_type); +drm_connector_helper_add (&radeon_connector->base, &radeon_dvi_connector_helper_funcs); subpixel_order = SubPixelHorizontalRGB; drm_object_attach_property(&radeon_connector->base.base, rdev->mode_info.coherent_mode_property,
@@ -2155,13 +2163,15 @@ radeon_add_atom_connector(struct drm_device *dev, goto failed; radeon_dig_connector->igp_lane_info = igp_lane_info; radeon_connector->con_priv = radeon_dig_connector; -drm_connector_init (dev, &radeon_connector->base, &radeon_dvi_connector_funcs, connector_type); -drm_connector_helper_add (&radeon_connector->base, &radeon_dvi_connector_helper_funcs);if (i2c_bus->valid) { radeon_connector->ddc_bus =radeon_i2c_lookup (rdev, i2c_bus);if (!radeon_connector->ddc_bus)DRM_ERROR ("HDMI: Failed to assign ddc bus! Check dmesg for i2c errors.\n" ); +else + connector->ddc = &radeon_connector->ddc_bus->adapter; } +drm_connector_init (dev, &radeon_connector->base, &radeon_dvi_connector_funcs, connector_type); +drm_connector_helper_add (&radeon_connector->base, &radeon_dvi_connector_helper_funcs);drm_object_attach_property (&radeon_connector->base.base, rdev->mode_info.coherent_mode_property,1 );
@@ -2205,15 +2215,17 @@ radeon_add_atom_connector(struct drm_device *dev, goto failed; radeon_dig_connector->igp_lane_info = igp_lane_info; radeon_connector->con_priv = radeon_dig_connector; -drm_connector_init (dev, &radeon_connector->base, &radeon_dp_connector_funcs, connector_type); -drm_connector_helper_add (&radeon_connector->base, &radeon_dp_connector_helper_funcs);if (i2c_bus->valid) { radeon_connector->ddc_bus =radeon_i2c_lookup (rdev, i2c_bus); -if (radeon_connector->ddc_bus) +if (radeon_connector->ddc_bus) { has_aux = true; -else + connector->ddc = &radeon_connector->ddc_bus->adapter; + }else {DRM_ERROR ("DP: Failed to assign ddc bus! Check dmesg for i2c errors.\n" ); + } } +drm_connector_init (dev, &radeon_connector->base, &radeon_dp_connector_funcs, connector_type); +drm_connector_helper_add (&radeon_connector->base, &radeon_dp_connector_helper_funcs); subpixel_order = SubPixelHorizontalRGB; drm_object_attach_property(&radeon_connector->base.base, rdev->mode_info.coherent_mode_property,
@@ -2255,15 +2267,17 @@ radeon_add_atom_connector(struct drm_device *dev, goto failed; radeon_dig_connector->igp_lane_info = igp_lane_info; radeon_connector->con_priv = radeon_dig_connector; -drm_connector_init (dev, &radeon_connector->base, &radeon_edp_connector_funcs, connector_type); -drm_connector_helper_add (&radeon_connector->base, &radeon_dp_connector_helper_funcs);if (i2c_bus->valid) { radeon_connector->ddc_bus =radeon_i2c_lookup (rdev, i2c_bus); -if (radeon_connector->ddc_bus) +if (radeon_connector->ddc_bus) { has_aux = true; -else + connector->ddc = &radeon_connector->ddc_bus->adapter; + }else {DRM_ERROR ("DP: Failed to assign ddc bus! Check dmesg for i2c errors.\n" ); + } } +drm_connector_init (dev, &radeon_connector->base, &radeon_edp_connector_funcs, connector_type); +drm_connector_helper_add (&radeon_connector->base, &radeon_dp_connector_helper_funcs);drm_object_attach_property (&radeon_connector->base.base, dev->mode_config.scaling_mode_property,DRM_MODE_SCALE_FULLSCREEN );
@@ -2294,13 +2308,15 @@ radeon_add_atom_connector(struct drm_device *dev, goto failed; radeon_dig_connector->igp_lane_info = igp_lane_info; radeon_connector->con_priv = radeon_dig_connector; -drm_connector_init (dev, &radeon_connector->base, &radeon_lvds_connector_funcs, connector_type); -drm_connector_helper_add (&radeon_connector->base, &radeon_lvds_connector_helper_funcs);if (i2c_bus->valid) { radeon_connector->ddc_bus =radeon_i2c_lookup (rdev, i2c_bus);if (!radeon_connector->ddc_bus)DRM_ERROR ("LVDS: Failed to assign ddc bus! Check dmesg for i2c errors.\n" ); +else + connector->ddc = &radeon_connector->ddc_bus->adapter; } +drm_connector_init (dev, &radeon_connector->base, &radeon_lvds_connector_funcs, connector_type); +drm_connector_helper_add (&radeon_connector->base, &radeon_lvds_connector_helper_funcs);drm_object_attach_property (&radeon_connector->base.base, dev->mode_config.scaling_mode_property,DRM_MODE_SCALE_FULLSCREEN );
@@ -2378,13 +2394,15 @@ radeon_add_legacy_connector(struct drm_device *dev,switch (connector_type) {case DRM_MODE_CONNECTOR_VGA : -drm_connector_init (dev, &radeon_connector->base, &radeon_vga_connector_funcs, connector_type); -drm_connector_helper_add (&radeon_connector->base, &radeon_vga_connector_helper_funcs);if (i2c_bus->valid) { radeon_connector->ddc_bus =radeon_i2c_lookup (rdev, i2c_bus);if (!radeon_connector->ddc_bus)DRM_ERROR ("VGA: Failed to assign ddc bus! Check dmesg for i2c errors.\n" ); +else + connector->ddc = &radeon_connector->ddc_bus->adapter; } +drm_connector_init (dev, &radeon_connector->base, &radeon_vga_connector_funcs, connector_type); +drm_connector_helper_add (&radeon_connector->base, &radeon_vga_connector_helper_funcs); radeon_connector->dac_load_detect = true; drm_object_attach_property(&radeon_connector->base.base, rdev->mode_info.load_detect_property,
@@ -2395,13 +2413,15 @@ radeon_add_legacy_connector(struct drm_device *dev, connector->doublescan_allowed = true;break ;case DRM_MODE_CONNECTOR_DVIA : -drm_connector_init (dev, &radeon_connector->base, &radeon_vga_connector_funcs, connector_type); -drm_connector_helper_add (&radeon_connector->base, &radeon_vga_connector_helper_funcs);if (i2c_bus->valid) { radeon_connector->ddc_bus =radeon_i2c_lookup (rdev, i2c_bus);if (!radeon_connector->ddc_bus)DRM_ERROR ("DVIA: Failed to assign ddc bus! Check dmesg for i2c errors.\n" ); +else + connector->ddc = &radeon_connector->ddc_bus->adapter; } +drm_connector_init (dev, &radeon_connector->base, &radeon_vga_connector_funcs, connector_type); +drm_connector_helper_add (&radeon_connector->base, &radeon_vga_connector_helper_funcs); radeon_connector->dac_load_detect = true; drm_object_attach_property(&radeon_connector->base.base, rdev->mode_info.load_detect_property,
@@ -2413,13 +2433,15 @@ radeon_add_legacy_connector(struct drm_device *dev,break ;case DRM_MODE_CONNECTOR_DVII :case DRM_MODE_CONNECTOR_DVID : -drm_connector_init (dev, &radeon_connector->base, &radeon_dvi_connector_funcs, connector_type); -drm_connector_helper_add (&radeon_connector->base, &radeon_dvi_connector_helper_funcs);if (i2c_bus->valid) { radeon_connector->ddc_bus =radeon_i2c_lookup (rdev, i2c_bus);if (!radeon_connector->ddc_bus)DRM_ERROR ("DVI: Failed to assign ddc bus! Check dmesg for i2c errors.\n" ); +else + connector->ddc = &radeon_connector->ddc_bus->adapter; } +drm_connector_init (dev, &radeon_connector->base, &radeon_dvi_connector_funcs, connector_type); +drm_connector_helper_add (&radeon_connector->base, &radeon_dvi_connector_helper_funcs);if (connector_type ==DRM_MODE_CONNECTOR_DVII ) { radeon_connector->dac_load_detect = true; drm_object_attach_property(&radeon_connector->base.base,
@@ -2458,13 +2480,15 @@ radeon_add_legacy_connector(struct drm_device *dev, connector->doublescan_allowed = false;break ;case DRM_MODE_CONNECTOR_LVDS : -drm_connector_init (dev, &radeon_connector->base, &radeon_lvds_connector_funcs, connector_type); -drm_connector_helper_add (&radeon_connector->base, &radeon_lvds_connector_helper_funcs);if (i2c_bus->valid) { radeon_connector->ddc_bus =radeon_i2c_lookup (rdev, i2c_bus);if (!radeon_connector->ddc_bus)DRM_ERROR ("LVDS: Failed to assign ddc bus! Check dmesg for i2c errors.\n" ); +else + connector->ddc = &radeon_connector->ddc_bus->adapter; } +drm_connector_init (dev, &radeon_connector->base, &radeon_lvds_connector_funcs, connector_type); +drm_connector_helper_add (&radeon_connector->base, &radeon_lvds_connector_helper_funcs);drm_object_attach_property (&radeon_connector->base.base, dev->mode_config.scaling_mode_property,DRM_MODE_SCALE_FULLSCREEN );
Signature · 6 lines
2.17.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v4 23/23 drm/i915: Provide ddc symlink in hdmi connector sysfs directory
In reply to a message not in the archiveUse the ddc pointer provided by the generic connector.
--- drivers/gpu/drm/i915/display/intel_hdmi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/display/intel_hdmi.c +3 -2
@@ -3094,6 +3094,9 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port, intel_dig_port->max_lanes, port_name(port)))return ; + intel_hdmi->ddc_bus =intel_hdmi_ddc_pin (dev_priv, port); + connector->ddc =intel_gmbus_get_adapter (dev_priv, intel_hdmi->ddc_bus); +drm_connector_init (dev, connector, &intel_hdmi_connector_funcs,DRM_MODE_CONNECTOR_HDMIA );drm_connector_helper_add (connector, &intel_hdmi_connector_helper_funcs);
@@ -3105,8 +3108,6 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,if (INTEL_GEN (dev_priv) >=10 ||IS_GEMINILAKE (dev_priv)) connector->ycbcr_420_allowed = true; - intel_hdmi->ddc_bus =intel_hdmi_ddc_pin (dev_priv, port); -if (WARN_ON (port ==PORT_A ))return ; intel_encoder->hpd_pin =intel_hpd_pin_default (dev_priv, port);
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH v4 23/23] drm/i915: Provide ddc symlink in hdmi connector sysfs directory
In reply to a message not in the archiveQuoted 1 line · Andrzej Pietrasiewicz
Use the ddc pointer provided by the generic connector.
We already have a symlink via intel_hdmi_create_i2c_symlink(). I guess we should remove that in favor of the generic one. Oleg?
Quoted 31 lines
Signed-off-by Andrzej Pietrasiewicz <[email protected]>--- drivers/gpu/drm/i915/display/intel_hdmi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)drivers/gpu/drm/i915/display/intel_hdmi.c +3
-2@@ -3094,6 +3094,9 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port, intel_dig_port->max_lanes, port_name(port)))return ; + intel_hdmi->ddc_bus =intel_hdmi_ddc_pin (dev_priv, port); + connector->ddc =intel_gmbus_get_adapter (dev_priv, intel_hdmi->ddc_bus); +drm_connector_init (dev, connector, &intel_hdmi_connector_funcs,DRM_MODE_CONNECTOR_HDMIA );drm_connector_helper_add (connector, &intel_hdmi_connector_helper_funcs);@@ -3105,8 +3108,6 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,if (INTEL_GEN (dev_priv) >=10 ||IS_GEMINILAKE (dev_priv)) connector->ycbcr_420_allowed = true; - intel_hdmi->ddc_bus =intel_hdmi_ddc_pin (dev_priv, port); -if (WARN_ON (port ==PORT_A ))return ; intel_encoder->hpd_pin =intel_hpd_pin_default (dev_priv, port);Signature · 1 line
2.17.1
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH v4 23/23] drm/i915: Provide ddc symlink in hdmi connector sysfs directory
In reply to Andrzej PietrasiewiczQuoted 1 line · Andrzej Pietrasiewicz
Use the ddc pointer provided by the generic connector.
We already have a symlink via intel_hdmi_create_i2c_symlink(). I guess we should remove that in favor of the generic one. Oleg?
Quoted 31 lines
Signed-off-by Andrzej Pietrasiewicz <[email protected]>--- drivers/gpu/drm/i915/display/intel_hdmi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)drivers/gpu/drm/i915/display/intel_hdmi.c +3
-2@@ -3094,6 +3094,9 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port, intel_dig_port->max_lanes, port_name(port)))return ; + intel_hdmi->ddc_bus =intel_hdmi_ddc_pin (dev_priv, port); + connector->ddc =intel_gmbus_get_adapter (dev_priv, intel_hdmi->ddc_bus); +drm_connector_init (dev, connector, &intel_hdmi_connector_funcs,DRM_MODE_CONNECTOR_HDMIA );drm_connector_helper_add (connector, &intel_hdmi_connector_helper_funcs);@@ -3105,8 +3108,6 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,if (INTEL_GEN (dev_priv) >=10 ||IS_GEMINILAKE (dev_priv)) connector->ycbcr_420_allowed = true; - intel_hdmi->ddc_bus =intel_hdmi_ddc_pin (dev_priv, port); -if (WARN_ON (port ==PORT_A ))return ; intel_encoder->hpd_pin =intel_hpd_pin_default (dev_priv, port);Signature · 1 line
2.17.1
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v4 23/23] drm/i915: Provide ddc symlink in hdmi connector sysfs directory
In reply to Andrzej PietrasiewiczQuoted 1 line · Andrzej Pietrasiewicz
Use the ddc pointer provided by the generic connector.
We already have a symlink via intel_hdmi_create_i2c_symlink(). I guess we should remove that in favor of the generic one. Oleg?
Quoted 31 lines
Signed-off-by Andrzej Pietrasiewicz <[email protected]>--- drivers/gpu/drm/i915/display/intel_hdmi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)drivers/gpu/drm/i915/display/intel_hdmi.c +3
-2@@ -3094,6 +3094,9 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port, intel_dig_port->max_lanes, port_name(port)))return ; + intel_hdmi->ddc_bus =intel_hdmi_ddc_pin (dev_priv, port); + connector->ddc =intel_gmbus_get_adapter (dev_priv, intel_hdmi->ddc_bus); +drm_connector_init (dev, connector, &intel_hdmi_connector_funcs,DRM_MODE_CONNECTOR_HDMIA );drm_connector_helper_add (connector, &intel_hdmi_connector_helper_funcs);@@ -3105,8 +3108,6 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,if (INTEL_GEN (dev_priv) >=10 ||IS_GEMINILAKE (dev_priv)) connector->ycbcr_420_allowed = true; - intel_hdmi->ddc_bus =intel_hdmi_ddc_pin (dev_priv, port); -if (WARN_ON (port ==PORT_A ))return ; intel_encoder->hpd_pin =intel_hpd_pin_default (dev_priv, port);Signature · 1 line
2.17.1
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v4 01/23] drm: Include ddc adapter pointer in struct drm_connector
In reply to a message not in the archiveQuoted 52 lines · Andrzej Pietrasiewicz
Add generic code which creates symbolic links in sysfs, pointing to ddc interface used by a particular video output. For example:
ls -l
/sys/class/drm/card0-HDMI-A-1/ddclrwxrwxrwx 1 root root 0 Jun 24 10:42 /sys/class/drm/card0-HDMI-A-1/ddc \ -> ../../../../soc/13880000.i2c/i2c-2This makes it easy for user to associate a display with its ddc adapter and use e.g. ddcutil to control the chosen monitor.
This patch adds an
i2c_adapterpointer to structdrm_connector. Particular drivers can then use it instead of using their own private instance. If a connector contains a ddc, then create a symbolic link in sysfs.Signed-off-by Andrzej Pietrasiewicz <[email protected]>Acked-by Daniel Vetter <[email protected]>Reviewed-by Andrzej Hajda <[email protected]>--- drivers/gpu/drm/drm_sysfs.c | 7 +++++++ include/drm/drm_connector.h | 11 +++++++++++ 2 files changed, 18 insertions(+)drivers/gpu/drm/drm_sysfs.c +7
-0@@ -294,6 +294,9 @@ int drm_sysfs_connector_add(struct drm_connector *connector)/* Let userspace know we have a new connector */ drm_sysfs_hotplug_event (dev); +if (connector->ddc) +return sysfs_create_link (&connector->kdev->kobj, + &connector->ddc->dev.kobj,"ddc" );return 0 ; }@@ -301,6 +304,10 @@ void drm_sysfs_connector_remove(struct drm_connector *connector) {if (!connector->kdev)return ; + +if (connector->ddc) +sysfs_remove_link (&connector->kdev->kobj,"ddc" ); +DRM_DEBUG ("removing \"%s\" from sysfs\n" , connector->name);include/drm/drm_connector.h +0
-0
include/drm/drm_connector.h line 26
Quoted 4 lines
include/drm/drm_connector.h +1
-0@@ -23,6 +23,7 @@#ifndef __DRM_CONNECTOR_H__#define __DRM_CONNECTOR_H__ +#include <linux/i2c.h>
struct i2c_adapter;
would suffice.
Quoted 22 lines
include/drm/drm_connector.h +10
-0#include <linux/list.h> #include <linux/llist.h> #include <linux/ctype.h> @@ -1308,6 +1309,16 @@ struct drm_connector {* [0]: progressive, [1]: interlaced */ int audio_latency[2 ]; + +/** +* @ddc: associated ddc adapter. +* A connector usually has its associated ddc adapter. If a driver uses +* this field, then an appropriate symbolic link is created in connector +* sysfs directory to make it easy for the user to tell which i2c +* adapter is for a particular display. +*/ +struct i2c_adapter *ddc; +/** * @null_edid_counter: track sinks that give us all zeros for the EDID. * Needed to workaround some HW bugs where we get all 0s Signature · 1 line
2.17.1
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH v4 01/23] drm: Include ddc adapter pointer in struct drm_connector
In reply to Andrzej PietrasiewiczQuoted 52 lines · Andrzej Pietrasiewicz
Add generic code which creates symbolic links in sysfs, pointing to ddc interface used by a particular video output. For example:
ls -l
/sys/class/drm/card0-HDMI-A-1/ddclrwxrwxrwx 1 root root 0 Jun 24 10:42 /sys/class/drm/card0-HDMI-A-1/ddc \ -> ../../../../soc/13880000.i2c/i2c-2This makes it easy for user to associate a display with its ddc adapter and use e.g. ddcutil to control the chosen monitor.
This patch adds an
i2c_adapterpointer to structdrm_connector. Particular drivers can then use it instead of using their own private instance. If a connector contains a ddc, then create a symbolic link in sysfs.Signed-off-by Andrzej Pietrasiewicz <[email protected]>Acked-by Daniel Vetter <[email protected]>Reviewed-by Andrzej Hajda <[email protected]>--- drivers/gpu/drm/drm_sysfs.c | 7 +++++++ include/drm/drm_connector.h | 11 +++++++++++ 2 files changed, 18 insertions(+)drivers/gpu/drm/drm_sysfs.c +7
-0@@ -294,6 +294,9 @@ int drm_sysfs_connector_add(struct drm_connector *connector)/* Let userspace know we have a new connector */ drm_sysfs_hotplug_event (dev); +if (connector->ddc) +return sysfs_create_link (&connector->kdev->kobj, + &connector->ddc->dev.kobj,"ddc" );return 0 ; }@@ -301,6 +304,10 @@ void drm_sysfs_connector_remove(struct drm_connector *connector) {if (!connector->kdev)return ; + +if (connector->ddc) +sysfs_remove_link (&connector->kdev->kobj,"ddc" ); +DRM_DEBUG ("removing \"%s\" from sysfs\n" , connector->name);include/drm/drm_connector.h +0
-0
include/drm/drm_connector.h line 26
Quoted 4 lines
include/drm/drm_connector.h +1
-0@@ -23,6 +23,7 @@#ifndef __DRM_CONNECTOR_H__#define __DRM_CONNECTOR_H__ +#include <linux/i2c.h>
struct i2c_adapter;
would suffice.
Quoted 22 lines
include/drm/drm_connector.h +10
-0#include <linux/list.h> #include <linux/llist.h> #include <linux/ctype.h> @@ -1308,6 +1309,16 @@ struct drm_connector {* [0]: progressive, [1]: interlaced */ int audio_latency[2 ]; + +/** +* @ddc: associated ddc adapter. +* A connector usually has its associated ddc adapter. If a driver uses +* this field, then an appropriate symbolic link is created in connector +* sysfs directory to make it easy for the user to tell which i2c +* adapter is for a particular display. +*/ +struct i2c_adapter *ddc; +/** * @null_edid_counter: track sinks that give us all zeros for the EDID. * Needed to workaround some HW bugs where we get all 0s Signature · 1 line
2.17.1
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v4 01/23] drm: Include ddc adapter pointer in struct drm_connector
In reply to Andrzej PietrasiewiczQuoted 52 lines · Andrzej Pietrasiewicz
Add generic code which creates symbolic links in sysfs, pointing to ddc interface used by a particular video output. For example:
ls -l
/sys/class/drm/card0-HDMI-A-1/ddclrwxrwxrwx 1 root root 0 Jun 24 10:42 /sys/class/drm/card0-HDMI-A-1/ddc \ -> ../../../../soc/13880000.i2c/i2c-2This makes it easy for user to associate a display with its ddc adapter and use e.g. ddcutil to control the chosen monitor.
This patch adds an
i2c_adapterpointer to structdrm_connector. Particular drivers can then use it instead of using their own private instance. If a connector contains a ddc, then create a symbolic link in sysfs.Signed-off-by Andrzej Pietrasiewicz <[email protected]>Acked-by Daniel Vetter <[email protected]>Reviewed-by Andrzej Hajda <[email protected]>--- drivers/gpu/drm/drm_sysfs.c | 7 +++++++ include/drm/drm_connector.h | 11 +++++++++++ 2 files changed, 18 insertions(+)drivers/gpu/drm/drm_sysfs.c +7
-0@@ -294,6 +294,9 @@ int drm_sysfs_connector_add(struct drm_connector *connector)/* Let userspace know we have a new connector */ drm_sysfs_hotplug_event (dev); +if (connector->ddc) +return sysfs_create_link (&connector->kdev->kobj, + &connector->ddc->dev.kobj,"ddc" );return 0 ; }@@ -301,6 +304,10 @@ void drm_sysfs_connector_remove(struct drm_connector *connector) {if (!connector->kdev)return ; + +if (connector->ddc) +sysfs_remove_link (&connector->kdev->kobj,"ddc" ); +DRM_DEBUG ("removing \"%s\" from sysfs\n" , connector->name);include/drm/drm_connector.h +0
-0
include/drm/drm_connector.h line 26
Quoted 4 lines
include/drm/drm_connector.h +1
-0@@ -23,6 +23,7 @@#ifndef __DRM_CONNECTOR_H__#define __DRM_CONNECTOR_H__ +#include <linux/i2c.h>
struct i2c_adapter;
would suffice.
Quoted 22 lines
include/drm/drm_connector.h +10
-0#include <linux/list.h> #include <linux/llist.h> #include <linux/ctype.h> @@ -1308,6 +1309,16 @@ struct drm_connector {* [0]: progressive, [1]: interlaced */ int audio_latency[2 ]; + +/** +* @ddc: associated ddc adapter. +* A connector usually has its associated ddc adapter. If a driver uses +* this field, then an appropriate symbolic link is created in connector +* sysfs directory to make it easy for the user to tell which i2c +* adapter is for a particular display. +*/ +struct i2c_adapter *ddc; +/** * @null_edid_counter: track sinks that give us all zeros for the EDID. * Needed to workaround some HW bugs where we get all 0s Signature · 1 line
2.17.1
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v4 23/23] drm/i915: Provide ddc symlink in hdmi connector sysfs directory
In reply to Ville SyrjäläQuoted 5 lines · Ville Syrjälä
Quoted 1 line · Andrzej Pietrasiewicz
Use the ddc pointer provided by the generic connector.
We already have a symlink via
intel_hdmi_create_i2c_symlink(). I guess we should remove that in favor of the generic one. Oleg?
Since that commit is very new I think we should try real hard to avoid the i915-ism here ...
-Daniel
Quoted 36 lines
Quoted 32 lines
Signed-off-by Andrzej Pietrasiewicz <[email protected]>--- drivers/gpu/drm/i915/display/intel_hdmi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)drivers/gpu/drm/i915/display/intel_hdmi.c +3
-2@@ -3094,6 +3094,9 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port, intel_dig_port->max_lanes, port_name(port)))return ; + intel_hdmi->ddc_bus =intel_hdmi_ddc_pin (dev_priv, port); + connector->ddc =intel_gmbus_get_adapter (dev_priv, intel_hdmi->ddc_bus); +drm_connector_init (dev, connector, &intel_hdmi_connector_funcs,DRM_MODE_CONNECTOR_HDMIA );drm_connector_helper_add (connector, &intel_hdmi_connector_helper_funcs);@@ -3105,8 +3108,6 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,if (INTEL_GEN (dev_priv) >=10 ||IS_GEMINILAKE (dev_priv)) connector->ycbcr_420_allowed = true; - intel_hdmi->ddc_bus =intel_hdmi_ddc_pin (dev_priv, port); -if (WARN_ON (port ==PORT_A ))return ; intel_encoder->hpd_pin =intel_hpd_pin_default (dev_priv, port);Signature · 1 line
2.17.1Signature · 2 lines
Ville Syrjälä Intel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v4 16/23] drm/mgag200: Provide ddc symlink in connector sysfs directory
In reply to Andrzej PietrasiewiczAm 11.07.19 um 13:26 schrieb Andrzej Pietrasiewicz:
Quoted 35 lines
Use the ddc pointer provided by the generic connector.
Signed-off-by Andrzej Pietrasiewicz <[email protected]>--- drivers/gpu/drm/mgag200/mgag200_mode.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)drivers/gpu/drm/mgag200/mgag200_mode.c +5
-4@@ -1703,6 +1703,11 @@ static struct drm_connector *mga_vga_init(struct drm_device *dev)return NULL ; connector = &mga_connector->base; + mga_connector->i2c =mgag200_i2c_create (dev); +if (!mga_connector->i2c) +DRM_ERROR ("failed to add ddc bus\n" ); + + connector->ddc = &mga_connector->i2c->adapter;drm_connector_init (dev, connector, &mga_vga_connector_funcs,DRM_MODE_CONNECTOR_VGA );@@ -1711,10 +1716,6 @@ static struct drm_connector *mga_vga_init(struct drm_device *dev)drm_connector_register (connector); - mga_connector->i2c =mgag200_i2c_create (dev); -if (!mga_connector->i2c) -DRM_ERROR ("failed to add ddc bus\n" ); -return connector; }
Signature · 5 lines
Thomas Zimmermann Graphics Driver Developer SUSE Linux GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany GF: Felix Imendörffer, Mary Higgins, Sri Rasiah HRB 21284 (AG Nürnberg)
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v4 17/23] drm/ast: Provide ddc symlink in connector sysfs directory
In reply to Andrzej PietrasiewiczAm 11.07.19 um 13:26 schrieb Andrzej Pietrasiewicz:
Quoted 35 lines
Use the ddc pointer provided by the generic connector.
Signed-off-by Andrzej Pietrasiewicz <[email protected]>--- drivers/gpu/drm/ast/ast_mode.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)drivers/gpu/drm/ast/ast_mode.c +5
-4@@ -890,6 +890,11 @@ static int ast_connector_init(struct drm_device *dev)return -ENOMEM ; connector = &ast_connector->base; + ast_connector->i2c =ast_i2c_create (dev); +if (!ast_connector->i2c) +DRM_ERROR ("failed to add ddc bus for connector\n" ); + + connector->ddc = &ast_connector->i2c->adapter;drm_connector_init (dev, connector, &ast_connector_funcs,DRM_MODE_CONNECTOR_VGA );drm_connector_helper_add (connector, &ast_connector_helper_funcs);@@ -904,10 +909,6 @@ static int ast_connector_init(struct drm_device *dev) encoder = list_first_entry(&dev->mode_config.encoder_list, struct drm_encoder, head);drm_connector_attach_encoder (connector, encoder); - ast_connector->i2c =ast_i2c_create (dev); -if (!ast_connector->i2c) -DRM_ERROR ("failed to add ddc bus for connector\n" ); -return 0 ; }
Signature · 5 lines
Thomas Zimmermann Graphics Driver Developer SUSE Linux GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany GF: Felix Imendörffer, Mary Higgins, Sri Rasiah HRB 21284 (AG Nürnberg)
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Patchwork
CI✓ Fi.CI.BAT: success for Associate ddc adapters with connectors
In reply to Andrzej Pietrasiewicz== Series Details ==
== Series Details ==
Series: Associate ddc adapters with connectors
URL : https://patchwork.freedesktop.org/series/63558/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_6460 -> Patchwork_13624
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13624/
Known issues
------------
Here are the changes found in Patchwork_13624 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_exec_suspend@basic-s3:
- fi-blb-e6850: [PASS][1] -> [INCOMPLETE][2] ([fdo#107718])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6460/fi-blb-e6850/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13624/fi-blb-e6850/igt@[email protected]
* igt@i915_selftest@live_hangcheck:
- fi-icl-dsi: [PASS][3] -> [INCOMPLETE][4] ([fdo#107713] / [fdo#108569])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6460/fi-icl-dsi/igt@i915_selftest@live_hangcheck.html
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13624/fi-icl-dsi/igt@i915_selftest@live_hangcheck.html
* igt@i915_selftest@live_mman:
- fi-glk-dsi: [PASS][5] -> [INCOMPLETE][6] ([fdo#103359] / [k.org#198133])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6460/fi-glk-dsi/igt@i915_selftest@live_mman.html
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13624/fi-glk-dsi/igt@i915_selftest@live_mman.html
#### Possible fixes ####
* igt@gem_close_race@basic-threads:
- {fi-icl-u4}: [INCOMPLETE][7] ([fdo#107713]) -> [PASS][8]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6460/fi-icl-u4/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13624/fi-icl-u4/igt@[email protected]
* igt@i915_selftest@live_contexts:
- fi-skl-iommu: [INCOMPLETE][9] ([fdo#111050]) -> [PASS][10]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6460/fi-skl-iommu/igt@i915_selftest@live_contexts.html
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13624/fi-skl-iommu/igt@i915_selftest@live_contexts.html
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#103359]: https://bugs.freedesktop.org/show_bug.cgi?id=103359
[fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
[fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718
[fdo#108569]: https://bugs.freedesktop.org/show_bug.cgi?id=108569
[fdo#111050]: https://bugs.freedesktop.org/show_bug.cgi?id=111050
[k.org#198133]: https://bugzilla.kernel.org/show_bug.cgi?id=198133
Participating hosts (50 -> 47)
------------------------------
Additional (2): fi-icl-u3 fi-apl-guc
Missing (5): fi-byt-squawks fi-bsw-cyan fi-icl-y fi-byt-clapper fi-bdw-samus
Build changes
-------------
* Linux: CI_DRM_6460 -> Patchwork_13624
CI_DRM_6460: 32d52650873db547f6702f12ebdbae3e8e052dad @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5094: d7f140b5b02d054183a74842b4579cf7f5533927 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_13624: 60e82dafe00cea91a273ea2e55475beaccd52954 @ git://anongit.freedesktop.org/gfx-ci/linux
== Kernel 32bit build ==
Warning: Kernel 32bit buildtest failed:
https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13624/build_32bit.log
CALL scripts/checksyscalls.sh CALL scripts/atomic/check-atomics.sh CHK include/generated/compile.h
Kernel: arch/x86/boot/bzImage is ready (#1)
Building modules, stage 2.
MODPOST 112 modules
ERROR: "__udivdi3" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined!
ERROR: "__divdi3" [drivers/gpu/drm/amd/amdgpu/amdgpu.ko] undefined! scripts/Makefile.modpost:91: recipe for target '__modpost' failed make[1]: *** [__modpost] Error 1
Makefile:1287: recipe for target 'modules' failed
make: *** [modules] Error 2
== Linux commits ==
60e82dafe00c drm/i915: Provide ddc symlink in hdmi connector sysfs directory 2bdcc775cc25 drm/radeon: Provide ddc symlink in connector sysfs directory 61b383c5fb93 drm/amdgpu: Provide ddc symlink in connector sysfs directory b3958f606ccc drm/bridge: ti-tfp410: Provide ddc symlink in connector sysfs directory d726b6da43f7 drm/bridge: dw-hdmi: Provide ddc symlink in connector sysfs directory 136be3295b29 drm/bridge: dumb-vga-dac: Provide ddc symlink in connector sysfs directory 752f9e9d23e4 drm/ast: Provide ddc symlink in connector sysfs directory 475547eaa2a8 drm/mgag200: Provide ddc symlink in connector sysfs directory 4e708680d16d drm: sti: Provide ddc symlink in hdmi connector sysfs directory 09e81b72cb45 drm/tilcdc: Provide ddc symlink in connector sysfs directory e5a5a4ec10e8 drm: zte: Provide ddc symlink in vga connector sysfs directory 0abf56fc70c9 drm: zte: Provide ddc symlink in hdmi connector sysfs directory 665656680034 drm/vc4: Provide ddc symlink in connector sysfs directory 63f0cb3452f0 drm/imx: imx-tve: Provide ddc symlink in connector's sysfs 68e258fdc995 drm/imx: imx-ldb: Provide ddc symlink in connector's sysfs e9ae76f80294 drm/tegra: Provide ddc symlink in output connector sysfs directory 0dbb26bba588 drm/mediatek: Provide ddc symlink in hdmi connector sysfs directory f0d464ae2102 drm/sun4i: hdmi: Provide ddc symlink in sun4i hdmi connector sysfs directory 468ffe738c34 drm/msm/hdmi: Provide ddc symlink in hdmi connector sysfs directory 4f62a9663e68 drm: rockchip: Provide ddc symlink in inno_hdmi sysfs directory 72335f2b3f9c drm: rockchip: Provide ddc symlink in rk3066_hdmi sysfs directory 3e9dd6c9f823 drm/exynos: Provide ddc symlink in connector's sysfs aba854868cff drm: Include ddc adapter pointer in struct drm_connector
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13624/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Benjamin Gaignard
Reviewed-byRe: [PATCH v4 15/23] drm: sti: Provide ddc symlink in hdmi connector sysfs directory
In reply to a message not in the archiveQuoted 4 lines · Andrzej Pietrasiewicz
Use the ddc pointer provided by the generic connector.
Signed-off-by Andrzej Pietrasiewicz <[email protected]>
Quoted 17 lines
--- drivers/gpu/drm/sti/sti_hdmi.c | 1 + 1 file changed, 1 insertion(+)drivers/gpu/drm/sti/sti_hdmi.c +1
-1@@ -1279,6 +1279,7 @@ static int sti_hdmi_bind(struct device *dev, struct device *master, void *data)drm_bridge_attach (encoder, bridge,NULL ); connector->encoder = encoder; + drm_connector->ddc = hdmi->ddc_adapt; drm_connector = (struct drm_connector *)connector; --
Quoted 2 lines
2.17.1
_______________________________________________
Freedreno mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/freedreno
Patchwork
CI✓ Fi.CI.IGT: success for Associate ddc adapters with connectors
In reply to Andrzej Pietrasiewicz== Series Details ==
== Series Details ==
Series: Associate ddc adapters with connectors
URL : https://patchwork.freedesktop.org/series/63558/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_6460_full -> Patchwork_13624_full
====================================================
Summary
-------
**SUCCESS**
No regressions found.
Known issues
------------
Here are the changes found in Patchwork_13624_full that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_ctx_isolation@rcs0-s3:
- shard-apl: [PASS][1] -> [DMESG-WARN][2] ([fdo#108566])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6460/shard-apl6/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13624/shard-apl4/igt@[email protected]
* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-shrfb-plflip-blt:
- shard-iclb: [PASS][3] -> [FAIL][4] ([fdo#103167]) +3 similar issues
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6460/shard-iclb8/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13624/shard-iclb7/igt@[email protected]
* igt@kms_frontbuffer_tracking@fbcpsr-suspend:
- shard-skl: [PASS][5] -> [INCOMPLETE][6] ([fdo#104108] / [fdo#106978])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6460/shard-skl3/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13624/shard-skl10/igt@[email protected]
* igt@kms_psr2_su@page_flip:
- shard-iclb: [PASS][7] -> [SKIP][8] ([fdo#109642] / [fdo#111068])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6460/shard-iclb2/igt@kms_psr2_su@page_flip.html
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13624/shard-iclb1/igt@kms_psr2_su@page_flip.html
* igt@kms_setmode@basic:
- shard-apl: [PASS][9] -> [FAIL][10] ([fdo#99912])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6460/shard-apl4/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13624/shard-apl2/igt@[email protected]
* igt@perf@polling:
- shard-skl: [PASS][11] -> [FAIL][12] ([fdo#110728])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6460/shard-skl1/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13624/shard-skl10/igt@[email protected]
#### Possible fixes ####
* igt@kms_frontbuffer_tracking@fbc-1p-pri-indfb-multidraw:
- shard-iclb: [FAIL][13] ([fdo#103167]) -> [PASS][14] +3 similar issues
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6460/shard-iclb2/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13624/shard-iclb4/igt@[email protected]
* igt@kms_frontbuffer_tracking@fbc-1p-shrfb-fliptrack:
- shard-iclb: [INCOMPLETE][15] ([fdo#107713]) -> [PASS][16]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6460/shard-iclb7/igt@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13624/shard-iclb8/igt@[email protected]
* igt@kms_plane@plane-panning-bottom-right-suspend-pipe-b-planes:
- shard-apl: [DMESG-WARN][17] ([fdo#108566]) -> [PASS][18] +3 similar issues
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6460/shard-apl6/igt@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13624/shard-apl4/igt@[email protected]
* igt@kms_plane_lowres@pipe-a-tiling-x:
- shard-iclb: [FAIL][19] ([fdo#103166]) -> [PASS][20]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6460/shard-iclb6/igt@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13624/shard-iclb8/igt@[email protected]
* igt@kms_psr@psr2_primary_page_flip:
- shard-iclb: [SKIP][21] ([fdo#109441]) -> [PASS][22] +1 similar issue
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6460/shard-iclb3/igt@kms_psr@psr2_primary_page_flip.html
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13624/shard-iclb2/igt@kms_psr@psr2_primary_page_flip.html
#### Warnings ####
* igt@kms_dp_dsc@basic-dsc-enable-edp:
- shard-iclb: [SKIP][23] ([fdo#109349]) -> [DMESG-WARN][24] ([fdo#107724])
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6460/shard-iclb1/igt@[email protected]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13624/shard-iclb2/igt@[email protected]
[fdo#103166]: https://bugs.freedesktop.org/show_bug.cgi?id=103166
[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#104108]: https://bugs.freedesktop.org/show_bug.cgi?id=104108
[fdo#106978]: https://bugs.freedesktop.org/show_bug.cgi?id=106978
[fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
[fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
[fdo#108566]: https://bugs.freedesktop.org/show_bug.cgi?id=108566
[fdo#109349]: https://bugs.freedesktop.org/show_bug.cgi?id=109349
[fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
[fdo#109642]: https://bugs.freedesktop.org/show_bug.cgi?id=109642
[fdo#110728]: https://bugs.freedesktop.org/show_bug.cgi?id=110728
[fdo#111068]: https://bugs.freedesktop.org/show_bug.cgi?id=111068
[fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912
Participating hosts (11 -> 10)
------------------------------
Missing (1): pig-snb-2600
Build changes
-------------
* Linux: CI_DRM_6460 -> Patchwork_13624
CI_DRM_6460: 32d52650873db547f6702f12ebdbae3e8e052dad @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5094: d7f140b5b02d054183a74842b4579cf7f5533927 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_13624: 60e82dafe00cea91a273ea2e55475beaccd52954 @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13624/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v4 12/23] drm: zte: Provide ddc symlink in hdmi connector sysfs directory
In reply to Andrzej PietrasiewiczQuoted 3 lines · Andrzej Pietrasiewicz
Use the ddc pointer provided by the generic connector.
Signed-off-by Andrzej Pietrasiewicz <[email protected]>
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Shawn Guo
Acked-byRe: [PATCH v4 13/23] drm: zte: Provide ddc symlink in vga connector sysfs directory
In reply to a message not in the archiveQuoted 3 lines · Andrzej Pietrasiewicz
Use the ddc pointer provided by the generic connector.
Signed-off-by Andrzej Pietrasiewicz <[email protected]>
_______________________________________________
Freedreno mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/freedreno
Re: [PATCH v4 14/23] drm/tilcdc: Provide ddc symlink in connector sysfs directory
In reply to a message not in the archiveHi Andrzej
Quoted 12 lines · Andrzej Pietrasiewicz
Use the ddc pointer provided by the generic connector.
Signed-off-by Andrzej Pietrasiewicz <[email protected]>--- drivers/gpu/drm/tilcdc/tilcdc_tfp410.c | 1 + 1 file changed, 1 insertion(+)drivers/gpu/drm/tilcdc/tilcdc_tfp410.c +0
-0
drivers/gpu/drm/tilcdc/tilcdc_tfp410.c static struct drm_connector *tfp410_connector_create(struct drm_device *dev, · line 225
Quoted 7 lines
drivers/gpu/drm/tilcdc/tilcdc_tfp410.c +1
-0@@ -219,6 +219,7 @@ static struct drm_connector *tfp410_connector_create(struct drm_device *dev, tfp410_connector->mod = mod; connector = &tfp410_connector->base; + connector->ddc = mod->i2c;drm_connector_init (dev, connector, &tfp410_connector_funcs,DRM_MODE_CONNECTOR_DVID );
When reading this code, it looks strange that we set connector->ddc *before* the call to init the connector.
One could risk that drm_connector_init() used memset(..) to clear all fields or so, and it would break this order.
As it is today the code works as I read it.
Sam
_______________________________________________
Freedreno mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/freedreno
Re: [PATCH v4 16/23] drm/mgag200: Provide ddc symlink in connector sysfs directory
In reply to Andrzej PietrasiewiczHi Andrzej.
Quoted 13 lines · Andrzej Pietrasiewicz
Use the ddc pointer provided by the generic connector.
Signed-off-by Andrzej Pietrasiewicz <[email protected]>--- drivers/gpu/drm/mgag200/mgag200_mode.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)drivers/gpu/drm/mgag200/mgag200_mode.c +0
-0@@ -1703,6 +1703,11 @@ static struct drm_connector *mga_vga_init(struct drm_device *dev)return NULL ;
drivers/gpu/drm/mgag200/mgag200_mode.c static struct drm_connector *mga_vga_init(struct drm_device *dev) · line 1713
Quoted 10 lines
drivers/gpu/drm/mgag200/mgag200_mode.c +5
-0connector = &mga_connector->base; + mga_connector->i2c =mgag200_i2c_create (dev); +if (!mga_connector->i2c) +DRM_ERROR ("failed to add ddc bus\n" ); + + connector->ddc = &mga_connector->i2c->adapter;drm_connector_init (dev, connector, &mga_vga_connector_funcs,DRM_MODE_CONNECTOR_VGA );
Like on other patch, assigning connector->ddc before drm_connector_init() looks wrong.
Sam
Re: [PATCH v4 17/23] drm/ast: Provide ddc symlink in connector sysfs directory
In reply to Andrzej PietrasiewiczHi Andrzej.
Quoted 13 lines · Andrzej Pietrasiewicz
Use the ddc pointer provided by the generic connector.
Signed-off-by Andrzej Pietrasiewicz <[email protected]>--- drivers/gpu/drm/ast/ast_mode.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)drivers/gpu/drm/ast/ast_mode.c +0
-0@@ -890,6 +890,11 @@ static int ast_connector_init(struct drm_device *dev)return -ENOMEM ;
drivers/gpu/drm/ast/ast_mode.c static int ast_connector_init(struct drm_device *dev) · line 900
Quoted 10 lines
drivers/gpu/drm/ast/ast_mode.c +5
-0connector = &ast_connector->base; + ast_connector->i2c =ast_i2c_create (dev); +if (!ast_connector->i2c) +DRM_ERROR ("failed to add ddc bus for connector\n" ); + + connector->ddc = &ast_connector->i2c->adapter;drm_connector_init (dev, connector, &ast_connector_funcs,DRM_MODE_CONNECTOR_VGA );drm_connector_helper_add (connector, &ast_connector_helper_funcs);
Again, assigning before drm_connector_init().
I did not audit the remaining patches - you got the idea.
Sam
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v4 14/23] drm/tilcdc: Provide ddc symlink in connector sysfs directory
In reply to Sam RavnborgHi Sam,
W dniu 23.07.2019 o 11:05, Sam Ravnborg pisze:
Quoted 20 lines
Hi Andrzej
Quoted 17 lines · Andrzej Pietrasiewicz
Use the ddc pointer provided by the generic connector.
Signed-off-by Andrzej Pietrasiewicz <[email protected]>--- drivers/gpu/drm/tilcdc/tilcdc_tfp410.c | 1 + 1 file changed, 1 insertion(+)drivers/gpu/drm/tilcdc/tilcdc_tfp410.c +1
-0@@ -219,6 +219,7 @@ static struct drm_connector *tfp410_connector_create(struct drm_device *dev, tfp410_connector->mod = mod; connector = &tfp410_connector->base; + connector->ddc = mod->i2c;
Quoted 7 lines
drivers/gpu/drm/tilcdc/tilcdc_tfp410.c static struct drm_connector *tfp410_connector_create(struct drm_device *dev, · line 225
Quoted 2 lines
drivers/gpu/drm/tilcdc/tilcdc_tfp410.c +0
-0drm_connector_init (dev, connector, &tfp410_connector_funcs,DRM_MODE_CONNECTOR_DVID );When reading this code, it looks strange that we set
connector->ddc*before* the call to init the connector.
One could risk thatdrm_connector_init()used memset(..) to clear all fields or so, and it would break this order.
I verified the code of drm_connector_init() and cannot find any memset() invocations there. What is your actual concern?
Andrzej
Re: [PATCH v4 14/23] drm/tilcdc: Provide ddc symlink in connector sysfs directory
Hi Andrej.
Quoted 29 lines · Andrzej Pietrasiewicz
Hi Sam,
W dniu 23.07.2019 o 11:05, Sam Ravnborg pisze:
Quoted 10 lines
Hi Andrzej
Quoted 7 lines · Andrzej Pietrasiewicz
Use the ddc pointer provided by the generic connector.
Signed-off-by Andrzej Pietrasiewicz <[email protected]>--- drivers/gpu/drm/tilcdc/tilcdc_tfp410.c | 1 + 1 file changed, 1 insertion(+)Quoted 15 lines
drivers/gpu/drm/tilcdc/tilcdc_tfp410.c static struct drm_connector *tfp410_connector_create(struct drm_device *dev, · line 223
Quoted 10 lines
drivers/gpu/drm/tilcdc/tilcdc_tfp410.c +1
-0@@ -219,6 +219,7 @@ static struct drm_connector *tfp410_connector_create(struct drm_device *dev, tfp410_connector->mod = mod; connector = &tfp410_connector->base; + connector->ddc = mod->i2c;drm_connector_init (dev, connector, &tfp410_connector_funcs,DRM_MODE_CONNECTOR_DVID );When reading this code, it looks strange that we set
connector->ddc*before* the call to init the connector.
One could risk thatdrm_connector_init()used memset(..) to clear all fields or so, and it would break this order.
Quoted 2 lines
I verified the code of
drm_connector_init()and cannot find anymemset()invocations there. What is your actual concern?
My concern is that drm_connector_init() maybe sometime in the future will init all fileds in drm_connector, so we loose any assingments done to drm_connector from *before* we called the init function.
Moving the assignment to after drm_connector_init() would not let us depend on the actual implmentation of drm_connector_init().
Sam
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Thomas Zimmermann
maintainerRe: [PATCH v4 14/23] drm/tilcdc: Provide ddc symlink in connector sysfs directory
In reply to Andrzej PietrasiewiczHi
Am 23.07.19 um 14:44 schrieb Andrzej Pietrasiewicz:
Quoted 31 lines
Hi Sam,
W dniu 23.07.2019 o 11:05, Sam Ravnborg pisze:
Quoted 19 lines
Hi Andrzej
Quoted 16 lines · Andrzej Pietrasiewicz
Use the ddc pointer provided by the generic connector.
Signed-off-by Andrzej Pietrasiewicz <[email protected]>---
drivers/gpu/drm/tilcdc/tilcdc_tfp410.c| 1 +1 file changed, 1 insertion(+)drivers/gpu/drm/tilcdc/tilcdc_tfp410.c +0
-0@@ -219,6 +219,7 @@ static struct drm_connector *tfp410_connector_create(struct drm_device *dev, tfp410_connector->mod = mod; connector = &tfp410_connector->base;Quoted 8 lines
drivers/gpu/drm/tilcdc/tilcdc_tfp410.c static struct drm_connector *tfp410_connector_create(struct drm_device *dev, · line 225
Quoted 3 lines
drivers/gpu/drm/tilcdc/tilcdc_tfp410.c +1
-0+ connector->ddc = mod->i2c; drm_connector_init(dev, connector, &tfp410_connector_funcs, DRM_MODE_CONNECTOR_DVID);When reading this code, it looks strange that we set
connector->ddc*before* the call to init the connector.
One could risk thatdrm_connector_init()used memset(..) to clear all fields or so, and it would break this order.
Quoted 2 lines
I verified the code of
drm_connector_init()and cannot find anymemset()invocations there. What is your actual concern?
I think this echoes my concern about the implicit order of operation. It seems too easy to get this wrong. If you don't want to add an additional interface for setting the ddc field, why not add a dedicated initializer function that sets the ddc field? Something like this.
int drm_connector_init_with_ddc(connector, funcs, ..., ddc)
{
ret = drm_connector_init(connector, funcs, ...);
if (ret)
return ret;
if (!ddc)
return 0;
connector->ddc = ddc;
/* set up sysfs */
return 0;
}Best regards
Thomas
Quoted 5 lines
Andrzej
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 5 lines
Thomas Zimmermann Graphics Driver Developer SUSE Linux GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany GF: Felix Imendörffer, Mary Higgins, Sri Rasiah HRB 21284 (AG Nürnberg)
Re: [PATCH v4 14/23] drm/tilcdc: Provide ddc symlink in connector sysfs directory
Hi Thomas,
W dniu 24.07.2019 o 10:01, Thomas Zimmermann pisze:
Quoted 11 lines
Hi
I think this echoes my concern about the implicit order of operation. It seems too easy to get this wrong. If you don't want to add an additional interface for setting the ddc field, why not add a dedicated initializer function that sets the ddc field? Something like this.
int
drm_connector_init_with_ddc(connector, funcs, ..., ddc)
Quoted 14 lines
{
ret = drm_connector_init(connector, funcs, ...);
if (ret)
return ret;
if (!ddc)
return 0;
connector->ddc = ddc;
/* set up sysfs */
return 0;
}True. I will send a v5 soon.
Thanks,
Andrzej
Re: [PATCH v4 18/23] drm/bridge: dumb-vga-dac: Provide ddc symlink in connector sysfs directory
In reply to Andrzej PietrasiewiczQuoted 62 lines · Andrzej Pietrasiewicz
Use the ddc pointer provided by the generic connector.
Signed-off-by Andrzej Pietrasiewicz <[email protected]>--- drivers/gpu/drm/bridge/dumb-vga-dac.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-)drivers/gpu/drm/bridge/dumb-vga-dac.c +7
-8@@ -20,7 +20,6 @@ struct dumb_vga {struct drm_bridge bridge;struct drm_connector connector; -struct i2c_adapter *ddc;struct regulator *vdd; };@@ -42,10 +41,10 @@ static int dumb_vga_get_modes(struct drm_connector *connector)struct edid *edid;int ret; -if (IS_ERR (vga->ddc)) +if (IS_ERR (vga->connector.ddc)) goto fallback; - edid =drm_get_edid (connector, vga->ddc); + edid =drm_get_edid (connector, vga->connector.ddc);if (!edid) {DRM_INFO ("EDID readout failed, falling back to standard modes\n" ); goto fallback;@@ -84,7 +83,7 @@ dumb_vga_connector_detect(struct drm_connector *connector, bool force)* wire the DDC pins, or the I2C bus might not be working at * all. */ -if (!IS_ERR (vga->ddc) &&drm_probe_ddc (vga->ddc)) +if (!IS_ERR (vga->connector.ddc) &&drm_probe_ddc (vga->connector.ddc))return connector_status_connected;return connector_status_unknown;@@ -190,14 +189,14 @@ static int dumb_vga_probe(struct platform_device *pdev)dev_dbg (&pdev->dev,"No vdd regulator found: %d\n" , ret); } - vga->ddc =dumb_vga_retrieve_ddc (&pdev->dev); -if (IS_ERR (vga->ddc)) { -if (PTR_ERR (vga->ddc) == -ENODEV ) { + vga->connector.ddc =dumb_vga_retrieve_ddc (&pdev->dev); +if (IS_ERR (vga->connector.ddc)) { +if (PTR_ERR (vga->connector.ddc) == -ENODEV ) {dev_dbg (&pdev->dev,"No i2c bus specified. Disabling EDID readout\n" ); }else {dev_err (&pdev->dev,"Couldn't retrieve i2c bus\n" ); -return PTR_ERR (vga->ddc); +return PTR_ERR (vga->connector.ddc); } }
drivers/gpu/drm/bridge/dumb-vga-dac.c static int dumb_vga_remove(struct platform_device *pdev) · line 222
Quoted 10 lines
drivers/gpu/drm/bridge/dumb-vga-dac.c +2
-2@@ -216,8 +215,8 @@ static int dumb_vga_remove(struct platform_device *pdev)drm_bridge_remove (&vga->bridge); -if (!IS_ERR (vga->ddc)) -i2c_put_adapter (vga->ddc); +if (!IS_ERR (vga->connector.ddc)) +i2c_put_adapter (vga->connector.ddc);return 0 ; }
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Neil Armstrong
Reviewed-byRe: [PATCH v4 19/23] drm/bridge: dw-hdmi: Provide ddc symlink in connector sysfs directory
In reply to a message not in the archiveQuoted 143 lines · Andrzej Pietrasiewicz
Use the ddc pointer provided by the generic connector.
Signed-off-by Andrzej Pietrasiewicz <[email protected]>--- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 40 +++++++++++------------ 1 file changed, 20 insertions(+), 20 deletions(-)drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +19
-19@@ -161,7 +161,6 @@ struct dw_hdmi {struct drm_display_mode previous_mode; -struct i2c_adapter *ddc;void __iomem *regs;bool sink_is_hdmi;bool sink_has_audio;@@ -1118,7 +1117,7 @@ static bool dw_hdmi_support_scdc(struct dw_hdmi *hdmi)return false;/* Disable if no DDC bus */ -if (!hdmi->ddc) +if (!hdmi->connector.ddc)return false;/* Disable if SCDC is not supported, or if an HF-VSDB block is absent */ @@ -1156,10 +1155,11 @@ void dw_hdmi_set_high_tmds_clock_ratio(struct dw_hdmi *hdmi)/* Control for TMDS Bit Period/TMDS Clock-Period Ratio */ if (dw_hdmi_support_scdc (hdmi)) { +struct i2c_adapter *ddc = hdmi->connector.ddc;if (mtmdsclock >HDMI14_MAX_TMDSCLK ) -drm_scdc_set_high_tmds_clock_ratio (hdmi->ddc,1 ); +drm_scdc_set_high_tmds_clock_ratio (ddc,1 );else -drm_scdc_set_high_tmds_clock_ratio (hdmi->ddc,0 ); +drm_scdc_set_high_tmds_clock_ratio (ddc,0 ); } }EXPORT_SYMBOL_GPL (dw_hdmi_set_high_tmds_clock_ratio);@@ -1750,6 +1750,7 @@ static void hdmi_av_composer(struct dw_hdmi *hdmi,if (dw_hdmi_support_scdc (hdmi)) {if (vmode->mtmdsclock >HDMI14_MAX_TMDSCLK || hdmi_info->scdc.scrambling.low_rates) { +struct i2c_adapter *ddc = hdmi->connector.ddc;/* * HDMI2.0 Specifies the following procedure: * After the Source Device has determined that @@ -1759,13 +1760,12 @@ static void hdmi_av_composer(struct dw_hdmi *hdmi,* Source Devices compliant shall set the * Source Version = 1. */ -drm_scdc_readb (hdmi->ddc,SCDC_SINK_VERSION , - &bytes); -drm_scdc_writeb (hdmi->ddc,SCDC_SOURCE_VERSION , +drm_scdc_readb (ddc,SCDC_SINK_VERSION , &bytes); +drm_scdc_writeb (ddc,SCDC_SOURCE_VERSION ,min_t (u8, bytes,SCDC_MIN_SOURCE_VERSION ));/* Enabled Scrambling in the Sink */ -drm_scdc_set_scrambling (hdmi->ddc,1 ); +drm_scdc_set_scrambling (hdmi->connector.ddc,1 );/* * To activate the scrambler feature, you must ensure @@ -1781,7 +1781,7 @@ static void hdmi_av_composer(struct dw_hdmi *hdmi,hdmi_writeb (hdmi,0 ,HDMI_FC_SCRAMBLER_CTRL );hdmi_writeb (hdmi, (u8 )~HDMI_MC_SWRSTZ_TMDSSWRST_REQ ,HDMI_MC_SWRSTZ ); -drm_scdc_set_scrambling (hdmi->ddc,0 ); +drm_scdc_set_scrambling (hdmi->connector.ddc,0 ); } }@@ -2127,10 +2127,10 @@ static int dw_hdmi_connector_get_modes(struct drm_connector *connector)struct edid *edid;int ret =0 ; -if (!hdmi->ddc) +if (!hdmi->connector.ddc)return 0 ; - edid =drm_get_edid (connector, hdmi->ddc); + edid =drm_get_edid (connector, hdmi->connector.ddc);if (edid) {dev_dbg (hdmi->dev,"got edid: width[%d] x height[%d]\n" , edid->width_cm, edid->height_cm);@@ -2548,9 +2548,9 @@ __dw_hdmi_probe(struct platform_device *pdev, ddc_node =of_parse_phandle (np,"ddc-i2c-bus" ,0 );if (ddc_node) { - hdmi->ddc =of_get_i2c_adapter_by_node (ddc_node); + hdmi->connector.ddc =of_get_i2c_adapter_by_node (ddc_node);of_node_put (ddc_node); -if (!hdmi->ddc) { +if (!hdmi->connector.ddc) {dev_dbg (hdmi->dev,"failed to read ddc node\n" );return ERR_PTR (-EPROBE_DEFER ); }@@ -2689,7 +2689,7 @@ __dw_hdmi_probe(struct platform_device *pdev,hdmi_init_clk_regenerator (hdmi);/* If DDC bus is not specified, try to register HDMI I2C bus */ -if (!hdmi->ddc) { +if (!hdmi->connector.ddc) {/* Look for (optional) stuff related to unwedging */ hdmi->pinctrl =devm_pinctrl_get (dev);if (!IS_ERR (hdmi->pinctrl)) {@@ -2708,9 +2708,9 @@ __dw_hdmi_probe(struct platform_device *pdev, } } - hdmi->ddc =dw_hdmi_i2c_adapter (hdmi); -if (IS_ERR (hdmi->ddc)) - hdmi->ddc =NULL ; + hdmi->connector.ddc =dw_hdmi_i2c_adapter (hdmi); +if (IS_ERR (hdmi->connector.ddc)) + hdmi->connector.ddc =NULL ; } hdmi->bridge.driver_private = hdmi;@@ -2776,7 +2776,7 @@ __dw_hdmi_probe(struct platform_device *pdev, err_iahb:if (hdmi->i2c) {i2c_del_adapter (&hdmi->i2c->adap); - hdmi->ddc =NULL ; + hdmi->connector.ddc =NULL ; }if (hdmi->cec_notifier)@@ -2788,7 +2788,7 @@ __dw_hdmi_probe(struct platform_device *pdev, err_isfr:clk_disable_unprepare (hdmi->isfr_clk); err_res: -i2c_put_adapter (hdmi->ddc); +i2c_put_adapter (hdmi->connector.ddc);return ERR_PTR (ret); }
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c static void __dw_hdmi_remove(struct dw_hdmi *hdmi) · line 2820
Quoted 8 lines
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +1
-1@@ -2814,7 +2814,7 @@ static void __dw_hdmi_remove(struct dw_hdmi *hdmi)if (hdmi->i2c)i2c_del_adapter (&hdmi->i2c->adap);else -i2c_put_adapter (hdmi->ddc); +i2c_put_adapter (hdmi->connector.ddc); }/* -----------------------------------------------------------------------------
_______________________________________________
Freedreno mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/freedreno
Re: [PATCH v4 20/23] drm/bridge: ti-tfp410: Provide ddc symlink in connector sysfs directory
In reply to Andrzej PietrasiewiczQuoted 65 lines · Andrzej Pietrasiewicz
Use the ddc pointer provided by the generic connector.
Signed-off-by Andrzej Pietrasiewicz <[email protected]>--- drivers/gpu/drm/bridge/ti-tfp410.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-)drivers/gpu/drm/bridge/ti-tfp410.c +7
-8@@ -26,7 +26,6 @@ struct tfp410 {unsigned int connector_type;u32 bus_format; -struct i2c_adapter *ddc;struct gpio_desc *hpd;int hpd_irq;struct delayed_work hpd_work;@@ -55,10 +54,10 @@ static int tfp410_get_modes(struct drm_connector *connector)struct edid *edid;int ret; -if (!dvi->ddc) +if (!dvi->connector.ddc) goto fallback; - edid =drm_get_edid (connector, dvi->ddc); + edid =drm_get_edid (connector, dvi->connector.ddc);if (!edid) {DRM_INFO ("EDID read failed. Fallback to standard modes\n" ); goto fallback;@@ -98,8 +97,8 @@ tfp410_connector_detect(struct drm_connector *connector, bool force)return connector_status_disconnected; } -if (dvi->ddc) { -if (drm_probe_ddc (dvi->ddc)) +if (dvi->connector.ddc) { +if (drm_probe_ddc (dvi->connector.ddc))return connector_status_connected;else return connector_status_disconnected;@@ -297,8 +296,8 @@ static int tfp410_get_connector_properties(struct tfp410 *dvi)if (!ddc_phandle) goto fail; - dvi->ddc =of_get_i2c_adapter_by_node (ddc_phandle); -if (dvi->ddc) + dvi->connector.ddc =of_get_i2c_adapter_by_node (ddc_phandle); +if (dvi->connector.ddc)dev_info (dvi->dev,"Connector's ddc i2c bus found\n" );else ret = -EPROBE_DEFER ;@@ -367,7 +366,7 @@ static int tfp410_init(struct device *dev, bool i2c)return 0 ; fail: -i2c_put_adapter (dvi->ddc); +i2c_put_adapter (dvi->connector.ddc);if (dvi->hpd)gpiod_put (dvi->hpd);return ret;
drivers/gpu/drm/bridge/ti-tfp410.c static int tfp410_fini(struct device *dev) · line 388
Quoted 10 lines
drivers/gpu/drm/bridge/ti-tfp410.c +2
-2@@ -382,8 +381,8 @@ static int tfp410_fini(struct device *dev)drm_bridge_remove (&dvi->bridge); -if (dvi->ddc) -i2c_put_adapter (dvi->ddc); +if (dvi->connector.ddc) +i2c_put_adapter (dvi->connector.ddc);if (dvi->hpd)gpiod_put (dvi->hpd);
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v4 19/23] drm/bridge: dw-hdmi: Provide ddc symlink in connector sysfs directory
In reply to a message not in the archiveHi Neil.
Quoted 5 lines
Quoted 5 lines
Signed-off-by Andrzej Pietrasiewicz <[email protected]>--- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 40 +++++++++++------------ 1 file changed, 20 insertions(+), 20 deletions(-)
...
Quoted 2 lines
Reviewed-by Neil Armstrong <[email protected]>
There is now a much simpler v6 of this patch.
Care to take a look and ack/r-b?
Sam
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH v4 19/23] drm/bridge: dw-hdmi: Provide ddc symlink in connector sysfs directory
In reply to a message not in the archiveHi,
Quoted 7 lines · Sam Ravnborg
Hi Neil.
Quoted 5 lines
Quoted 5 lines
Signed-off-by Andrzej Pietrasiewicz <[email protected]>--- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 40 +++++++++++------------ 1 file changed, 20 insertions(+), 20 deletions(-)
Quoted 6 lines
...
Quoted 2 lines
Reviewed-by Neil Armstrong <[email protected]>There is now a much simpler v6 of this patch.
Care to take a look and ack/r-b?
I saw it too late, I reviewed the bridge patches, now I'll have a look at the whole patchset.
Neil
Quoted 3 lines
Sam
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH v4 14/23] drm/tilcdc: Provide ddc symlink in connector sysfs directory
In reply to Thomas ZimmermannHi,
I'm glad to see this work moving forward!
Quoted 43 lines · Thomas Zimmermann
Hi
Am 23.07.19 um 14:44 schrieb Andrzej Pietrasiewicz:
Quoted 31 lines
Hi Sam,
W dniu 23.07.2019 o 11:05, Sam Ravnborg pisze:
Quoted 19 lines
Hi Andrzej
Quoted 16 lines · Andrzej Pietrasiewicz
Use the ddc pointer provided by the generic connector.
Signed-off-by Andrzej Pietrasiewicz <[email protected]>--- drivers/gpu/drm/tilcdc/tilcdc_tfp410.c | 1 + 1 file changed, 1 insertion(+)drivers/gpu/drm/tilcdc/tilcdc_tfp410.c +0
-0@@ -219,6 +219,7 @@ static struct drm_connector *tfp410_connector_create(struct drm_device *dev, tfp410_connector->mod = mod; connector = &tfp410_connector->base;Quoted 8 lines
drivers/gpu/drm/tilcdc/tilcdc_tfp410.c static struct drm_connector · line 224
Quoted 3 lines
drivers/gpu/drm/tilcdc/tilcdc_tfp410.c +1
-0+ connector->ddc = mod->i2c;drm_connector_init (dev, connector, &tfp410_connector_funcs,DRM_MODE_CONNECTOR_DVID );When reading this code, it looks strange that we set
connector->ddc*before* the call to init the connector.
One could risk thatdrm_connector_init()used memset(..) to clear all fields or so, and it would break this order.Quoted 2 lines
I verified the code of
drm_connector_init()and cannot find anymemset()invocations there. What is your actual concern?I think this echoes my concern about the implicit order of operation. It seems too easy to get this wrong. If you don't want to add an additional interface for setting the ddc field, why not add a dedicated initializer function that sets the ddc field? Something like this.
int
drm_connector_init_with_ddc(connector, funcs, ..., ddc)
Quoted 11 lines
{
ret = drm_connector_init(connector, funcs, ...);
if (ret)
return ret;
if (!ddc)
return 0;
connector->ddc = ddc;
/* set up sysfs */I know this comment comes late to the party, but I'm a slightly suprised to see the above instead of implementing drm_connector_init in terms of drm_connector_init_with_ddc, as we typically do.
Namely, something along these lines (code might not even build!):
--------------------------------------8<-----------------------------
drivers/gpu/drm/drm_connector.c +10 -40
@@ -179,11 +179,12 @@ void drm_connector_free_work_fn(struct work_struct *work) }/** -* drm_connector_init - Init a preallocated connector +* drm_connector_init_with_ddc - Init a preallocated connector * @dev: DRM device * @connector: the connector to init * @funcs: callbacks for this connector * @connector_type: user visible type of the connector +* @ddc: pointer to the associated ddc adapter (optional) * * Initialises a preallocated connector. Connectors should be * subclassed as part of driver connector objects.
@@ -191,10 +192,11 @@ void drm_connector_free_work_fn(struct work_struct *work)* Returns: * Zero on success, error code on failure. */ -int drm_connector_init (struct drm_device *dev, -struct drm_connector *connector, -const struct drm_connector_funcs *funcs, -int connector_type) +int drm_connector_init_with_ddc (struct drm_device *dev, +struct drm_connector *connector, +const struct drm_connector_funcs *funcs, +int connector_type, +struct i2c_adapter *ddc) {struct drm_mode_config *config = &dev->mode_config;int ret;
@@ -215,6 +217,9 @@ int drm_connector_init(struct drm_device *dev, connector->dev = dev; connector->funcs = funcs; +/* provide ddc symlink in sysfs */ + connector->ddc = ddc; +/* connector index is used with 32bit bitmasks */ ret =ida_simple_get (&config->connector_ida,0 ,32 ,GFP_KERNEL );if (ret <0 ) {
@@ -295,41 +300,6 @@ int drm_connector_init(struct drm_device *dev,return ret; } -EXPORT_SYMBOL (drm_connector_init); - -/** -* drm_connector_init_with_ddc - Init a preallocated connector -* @dev: DRM device -* @connector: the connector to init -* @funcs: callbacks for this connector -* @connector_type: user visible type of the connector -* @ddc: pointer to the associated ddc adapter -* -* Initialises a preallocated connector. Connectors should be -* subclassed as part of driver connector objects. -* -* Ensures that the ddc field of the connector is correctly set. -* -* Returns: -* Zero on success, error code on failure. -*/ -int drm_connector_init_with_ddc (struct drm_device *dev, -struct drm_connector *connector, -const struct drm_connector_funcs *funcs, -int connector_type, -struct i2c_adapter *ddc) -{ -int ret; - - ret =drm_connector_init (dev, connector, funcs, connector_type); -if (ret) -return ret; - -/* provide ddc symlink in sysfs */ - connector->ddc = ddc; - -return ret; -}EXPORT_SYMBOL (drm_connector_init_with_ddc);/**
include/drm/drm_connector.h +10 -4
@@ -1408,10 +1408,6 @@ struct drm_connector {#define obj_to_connector (x) container_of(x, struct drm_connector, base) -int drm_connector_init (struct drm_device *dev, -struct drm_connector *connector, -const struct drm_connector_funcs *funcs, -int connector_type); int drm_connector_init_with_ddc(struct drm_device *dev, struct drm_connector *connector, const struct drm_connector_funcs *funcs,
@@ -1425,6 +1421,16 @@ int drm_connector_attach_encoder(struct drm_connector *connector,void drm_connector_cleanup (struct drm_connector *connector); +static inline int +drm_connector_init (struct drm_device *dev, +struct drm_connector *connector, +const struct drm_connector_funcs *funcs, +int connector_type); +{ +return drm_connector_init_with_ddc (dev, connector, funcs, + connector_type,NULL ); +} +static inline unsigned int drm_connector_index (const struct drm_connector *connector) {return connector->index;
-------------------------------------->8-----------------------------
This might be seen as bikeshed but it seems there's value keeping all the init code in the same place, as opposed to scattered.
Unless there are reasons for the current code, that I'm missing?
Thanks,
Ezequiel
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx