* [PATCH v7 0/9] drm: cec: convert DRM drivers to the new notifier API
@ 2019-08-14 10:44 Dariusz Marcinkiewicz
2019-08-14 10:45 ` [PATCH v7 9/9] drm: exynos: exynos_hdmi: use cec_notifier_conn_(un)register Dariusz Marcinkiewicz
2019-08-19 9:38 ` [PATCH v7 0/9] drm: cec: convert DRM drivers to the new notifier API Hans Verkuil
0 siblings, 2 replies; 11+ messages in thread
From: Dariusz Marcinkiewicz @ 2019-08-14 10:44 UTC (permalink / raw)
To: dri-devel, linux-media, hverkuil-cisco
Cc: Kate Stewart, Neil Armstrong, Daniel Vetter, Imre Deak,
Chris Wilson, Hans Verkuil, Andrzej Hajda, Dhinakaran Pandiyan,
Sam Ravnborg, Ville Syrjälä,
linux-samsung-soc, David Francis, amd-gfx, Leo Li,
Jerry (Fangzhi) Zuo, linux-arm-kernel, nouveau, Harry Wentland,
Shashank Sharma, Lyude Paul, Jonas Karlman, Jani Nikula,
intel-gfx, Maarten Lankhorst, Ramalingam C, Russell King,
Sean Paul, Rodrigo Vivi, linux-tegra, Thomas Gleixner,
Allison Randal, Thomas Lim, Jernej Skrabec, Greg Kroah-Hartman,
Douglas Anderson, linux-kernel, Manasi Navare, Alex Deucher,
Colin Ian King, Dariusz Marcinkiewicz, Enrico Weigelt,
Laurent Pinchart
This series updates DRM drivers to use new CEC notifier API.
Changes since v6:
Made CEC notifiers' registration and de-registration symmetric
in tda998x and dw-hdmi drivers. Also, accidentally dropped one
patch in v6 (change to drm_dp_cec), brought it back now.
Changes since v5:
Fixed a warning about a missing comment for a new member of
drm_dp_aux_cec struct. Sending to a wider audience,
including maintainers of respective drivers.
Changes since v4:
Addressing review comments.
Changes since v3:
Updated adapter flags in dw-hdmi-cec.
Changes since v2:
Include all DRM patches from "cec: improve notifier support,
add connector info connector info" series.
Changes since v1:
Those patches delay creation of notifiers until respective
connectors are constructed. It seems that those patches, for a
couple of drivers, by adding the delay, introduce a race between
notifiers' creation and the IRQs handling threads - at least I
don't see anything obvious in there that would explicitly forbid
such races to occur. v2 adds a write barrier to make sure IRQ
threads see the notifier once it is created (replacing the
WRITE_ONCE I put in v1). The best thing to do here, I believe,
would be not to have any synchronization and make sure that an IRQ
only gets enabled after the notifier is created.
Dariusz Marcinkiewicz (9):
drm_dp_cec: add connector info support.
drm/i915/intel_hdmi: use cec_notifier_conn_(un)register
dw-hdmi-cec: use cec_notifier_cec_adap_(un)register
tda9950: use cec_notifier_cec_adap_(un)register
drm: tda998x: use cec_notifier_conn_(un)register
drm: sti: use cec_notifier_conn_(un)register
drm: tegra: use cec_notifier_conn_(un)register
drm: dw-hdmi: use cec_notifier_conn_(un)register
drm: exynos: exynos_hdmi: use cec_notifier_conn_(un)register
.../display/amdgpu_dm/amdgpu_dm_mst_types.c | 2 +-
drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c | 13 +++---
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 46 +++++++++++++------
drivers/gpu/drm/drm_dp_cec.c | 25 ++++++----
drivers/gpu/drm/exynos/exynos_hdmi.c | 31 +++++++------
drivers/gpu/drm/i2c/tda9950.c | 12 ++---
drivers/gpu/drm/i2c/tda998x_drv.c | 36 ++++++++++-----
drivers/gpu/drm/i915/display/intel_dp.c | 4 +-
drivers/gpu/drm/i915/display/intel_hdmi.c | 13 ++++--
drivers/gpu/drm/nouveau/nouveau_connector.c | 3 +-
drivers/gpu/drm/sti/sti_hdmi.c | 19 +++++---
drivers/gpu/drm/tegra/output.c | 28 ++++++++---
include/drm/drm_dp_helper.h | 17 ++++---
13 files changed, 155 insertions(+), 94 deletions(-)
--
2.23.0.rc1.153.gdeed80330f-goog
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v7 9/9] drm: exynos: exynos_hdmi: use cec_notifier_conn_(un)register
2019-08-14 10:44 [PATCH v7 0/9] drm: cec: convert DRM drivers to the new notifier API Dariusz Marcinkiewicz
@ 2019-08-14 10:45 ` Dariusz Marcinkiewicz
2019-08-19 9:32 ` Hans Verkuil
2019-08-28 8:39 ` Sylwester Nawrocki
2019-08-19 9:38 ` [PATCH v7 0/9] drm: cec: convert DRM drivers to the new notifier API Hans Verkuil
1 sibling, 2 replies; 11+ messages in thread
From: Dariusz Marcinkiewicz @ 2019-08-14 10:45 UTC (permalink / raw)
To: dri-devel, linux-media, hverkuil-cisco
Cc: linux-samsung-soc, Joonyoung Shim, David Airlie, Seung-Woo Kim,
linux-kernel, Krzysztof Kozlowski, Inki Dae, Kyungmin Park,
Kukjin Kim, Daniel Vetter, Dariusz Marcinkiewicz,
linux-arm-kernel
Use the new cec_notifier_conn_(un)register() functions to
(un)register the notifier for the HDMI connector, and fill in
the cec_connector_info.
Changes since v2:
- removed unnecessary call to invalidate phys address before
deregistering the notifier,
- use cec_notifier_phys_addr_invalidate instead of setting
invalid address on a notifier.
Signed-off-by: Dariusz Marcinkiewicz <darekm@google.com>
Tested-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
---
drivers/gpu/drm/exynos/exynos_hdmi.c | 31 ++++++++++++++++------------
1 file changed, 18 insertions(+), 13 deletions(-)
diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
index bc1565f1822ab..d532b468d9af5 100644
--- a/drivers/gpu/drm/exynos/exynos_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
@@ -852,6 +852,10 @@ static enum drm_connector_status hdmi_detect(struct drm_connector *connector,
static void hdmi_connector_destroy(struct drm_connector *connector)
{
+ struct hdmi_context *hdata = connector_to_hdmi(connector);
+
+ cec_notifier_conn_unregister(hdata->notifier);
+
drm_connector_unregister(connector);
drm_connector_cleanup(connector);
}
@@ -935,6 +939,7 @@ static int hdmi_create_connector(struct drm_encoder *encoder)
{
struct hdmi_context *hdata = encoder_to_hdmi(encoder);
struct drm_connector *connector = &hdata->connector;
+ struct cec_connector_info conn_info;
int ret;
connector->interlace_allowed = true;
@@ -957,6 +962,15 @@ static int hdmi_create_connector(struct drm_encoder *encoder)
DRM_DEV_ERROR(hdata->dev, "Failed to attach bridge\n");
}
+ cec_fill_conn_info_from_drm(&conn_info, connector);
+
+ hdata->notifier = cec_notifier_conn_register(hdata->dev, NULL,
+ &conn_info);
+ if (hdata->notifier == NULL) {
+ ret = -ENOMEM;
+ DRM_DEV_ERROR(hdata->dev, "Failed to allocate CEC notifier\n");
+ }
+
return ret;
}
@@ -1528,8 +1542,8 @@ static void hdmi_disable(struct drm_encoder *encoder)
*/
mutex_unlock(&hdata->mutex);
cancel_delayed_work(&hdata->hotplug_work);
- cec_notifier_set_phys_addr(hdata->notifier,
- CEC_PHYS_ADDR_INVALID);
+ if (hdata->notifier)
+ cec_notifier_phys_addr_invalidate(hdata->notifier);
return;
}
@@ -2006,12 +2020,6 @@ static int hdmi_probe(struct platform_device *pdev)
}
}
- hdata->notifier = cec_notifier_get(&pdev->dev);
- if (hdata->notifier == NULL) {
- ret = -ENOMEM;
- goto err_hdmiphy;
- }
-
pm_runtime_enable(dev);
audio_infoframe = &hdata->audio.infoframe;
@@ -2023,7 +2031,7 @@ static int hdmi_probe(struct platform_device *pdev)
ret = hdmi_register_audio_device(hdata);
if (ret)
- goto err_notifier_put;
+ goto err_runtime_disable;
ret = component_add(&pdev->dev, &hdmi_component_ops);
if (ret)
@@ -2034,8 +2042,7 @@ static int hdmi_probe(struct platform_device *pdev)
err_unregister_audio:
platform_device_unregister(hdata->audio.pdev);
-err_notifier_put:
- cec_notifier_put(hdata->notifier);
+err_runtime_disable:
pm_runtime_disable(dev);
err_hdmiphy:
@@ -2054,12 +2061,10 @@ static int hdmi_remove(struct platform_device *pdev)
struct hdmi_context *hdata = platform_get_drvdata(pdev);
cancel_delayed_work_sync(&hdata->hotplug_work);
- cec_notifier_set_phys_addr(hdata->notifier, CEC_PHYS_ADDR_INVALID);
component_del(&pdev->dev, &hdmi_component_ops);
platform_device_unregister(hdata->audio.pdev);
- cec_notifier_put(hdata->notifier);
pm_runtime_disable(&pdev->dev);
if (!IS_ERR(hdata->reg_hdmi_en))
--
2.23.0.rc1.153.gdeed80330f-goog
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v7 9/9] drm: exynos: exynos_hdmi: use cec_notifier_conn_(un)register
2019-08-14 10:45 ` [PATCH v7 9/9] drm: exynos: exynos_hdmi: use cec_notifier_conn_(un)register Dariusz Marcinkiewicz
@ 2019-08-19 9:32 ` Hans Verkuil
2019-08-28 8:39 ` Sylwester Nawrocki
1 sibling, 0 replies; 11+ messages in thread
From: Hans Verkuil @ 2019-08-19 9:32 UTC (permalink / raw)
To: Dariusz Marcinkiewicz, dri-devel, linux-media
Cc: linux-samsung-soc, David Airlie, Seung-Woo Kim, linux-kernel,
Krzysztof Kozlowski, Kyungmin Park, Kukjin Kim, linux-arm-kernel
On 8/14/19 12:45 PM, Dariusz Marcinkiewicz wrote:
> Use the new cec_notifier_conn_(un)register() functions to
> (un)register the notifier for the HDMI connector, and fill in
> the cec_connector_info.
>
> Changes since v2:
> - removed unnecessary call to invalidate phys address before
> deregistering the notifier,
> - use cec_notifier_phys_addr_invalidate instead of setting
> invalid address on a notifier.
>
> Signed-off-by: Dariusz Marcinkiewicz <darekm@google.com>
> Tested-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Acked-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Regards,
Hans
> ---
> drivers/gpu/drm/exynos/exynos_hdmi.c | 31 ++++++++++++++++------------
> 1 file changed, 18 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
> index bc1565f1822ab..d532b468d9af5 100644
> --- a/drivers/gpu/drm/exynos/exynos_hdmi.c
> +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
> @@ -852,6 +852,10 @@ static enum drm_connector_status hdmi_detect(struct drm_connector *connector,
>
> static void hdmi_connector_destroy(struct drm_connector *connector)
> {
> + struct hdmi_context *hdata = connector_to_hdmi(connector);
> +
> + cec_notifier_conn_unregister(hdata->notifier);
> +
> drm_connector_unregister(connector);
> drm_connector_cleanup(connector);
> }
> @@ -935,6 +939,7 @@ static int hdmi_create_connector(struct drm_encoder *encoder)
> {
> struct hdmi_context *hdata = encoder_to_hdmi(encoder);
> struct drm_connector *connector = &hdata->connector;
> + struct cec_connector_info conn_info;
> int ret;
>
> connector->interlace_allowed = true;
> @@ -957,6 +962,15 @@ static int hdmi_create_connector(struct drm_encoder *encoder)
> DRM_DEV_ERROR(hdata->dev, "Failed to attach bridge\n");
> }
>
> + cec_fill_conn_info_from_drm(&conn_info, connector);
> +
> + hdata->notifier = cec_notifier_conn_register(hdata->dev, NULL,
> + &conn_info);
> + if (hdata->notifier == NULL) {
> + ret = -ENOMEM;
> + DRM_DEV_ERROR(hdata->dev, "Failed to allocate CEC notifier\n");
> + }
> +
> return ret;
> }
>
> @@ -1528,8 +1542,8 @@ static void hdmi_disable(struct drm_encoder *encoder)
> */
> mutex_unlock(&hdata->mutex);
> cancel_delayed_work(&hdata->hotplug_work);
> - cec_notifier_set_phys_addr(hdata->notifier,
> - CEC_PHYS_ADDR_INVALID);
> + if (hdata->notifier)
> + cec_notifier_phys_addr_invalidate(hdata->notifier);
> return;
> }
>
> @@ -2006,12 +2020,6 @@ static int hdmi_probe(struct platform_device *pdev)
> }
> }
>
> - hdata->notifier = cec_notifier_get(&pdev->dev);
> - if (hdata->notifier == NULL) {
> - ret = -ENOMEM;
> - goto err_hdmiphy;
> - }
> -
> pm_runtime_enable(dev);
>
> audio_infoframe = &hdata->audio.infoframe;
> @@ -2023,7 +2031,7 @@ static int hdmi_probe(struct platform_device *pdev)
>
> ret = hdmi_register_audio_device(hdata);
> if (ret)
> - goto err_notifier_put;
> + goto err_runtime_disable;
>
> ret = component_add(&pdev->dev, &hdmi_component_ops);
> if (ret)
> @@ -2034,8 +2042,7 @@ static int hdmi_probe(struct platform_device *pdev)
> err_unregister_audio:
> platform_device_unregister(hdata->audio.pdev);
>
> -err_notifier_put:
> - cec_notifier_put(hdata->notifier);
> +err_runtime_disable:
> pm_runtime_disable(dev);
>
> err_hdmiphy:
> @@ -2054,12 +2061,10 @@ static int hdmi_remove(struct platform_device *pdev)
> struct hdmi_context *hdata = platform_get_drvdata(pdev);
>
> cancel_delayed_work_sync(&hdata->hotplug_work);
> - cec_notifier_set_phys_addr(hdata->notifier, CEC_PHYS_ADDR_INVALID);
>
> component_del(&pdev->dev, &hdmi_component_ops);
> platform_device_unregister(hdata->audio.pdev);
>
> - cec_notifier_put(hdata->notifier);
> pm_runtime_disable(&pdev->dev);
>
> if (!IS_ERR(hdata->reg_hdmi_en))
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v7 0/9] drm: cec: convert DRM drivers to the new notifier API
2019-08-14 10:44 [PATCH v7 0/9] drm: cec: convert DRM drivers to the new notifier API Dariusz Marcinkiewicz
2019-08-14 10:45 ` [PATCH v7 9/9] drm: exynos: exynos_hdmi: use cec_notifier_conn_(un)register Dariusz Marcinkiewicz
@ 2019-08-19 9:38 ` Hans Verkuil
2019-08-19 11:28 ` Dariusz Marcinkiewicz
2019-08-19 14:48 ` Neil Armstrong
1 sibling, 2 replies; 11+ messages in thread
From: Hans Verkuil @ 2019-08-19 9:38 UTC (permalink / raw)
To: Dariusz Marcinkiewicz, dri-devel, linux-media
Cc: Kate Stewart, Neil Armstrong, Daniel Vetter, linux-kernel,
Hans Verkuil, Dhinakaran Pandiyan, Sam Ravnborg,
linux-samsung-soc, David Francis, amd-gfx, Jani Nikula,
Jerry (Fangzhi) Zuo, linux-arm-kernel, nouveau, Jonas Karlman,
Leo Li, intel-gfx, Russell King, Sean Paul, Rodrigo Vivi,
linux-tegra, Thomas Gleixner, Allison Randal, Thomas Lim,
Jernej Skrabec, Greg Kroah-Hartman, Douglas Anderson,
Manasi Navare, Alex Deucher, Colin Ian King, Enrico Weigelt,
Laurent Pinchart
Hi all,
The patches in this series can be applied independently from each other.
If you maintain one of these drivers and you want to merge it for v5.4
yourself, then please do so and let me know. If you prefer I commit it
to drm-misc, then please review and (hopefully) Ack the patch.
I would really like to get this in for v5.4 so I can get the userspace
bits in for v5.4 as well through the media subsystem.
Dariusz, can you post a v7.1 for patch 5/9 fixing the typo?
Thanks!
Hans
On 8/14/19 12:44 PM, Dariusz Marcinkiewicz wrote:
> This series updates DRM drivers to use new CEC notifier API.
>
> Changes since v6:
> Made CEC notifiers' registration and de-registration symmetric
> in tda998x and dw-hdmi drivers. Also, accidentally dropped one
> patch in v6 (change to drm_dp_cec), brought it back now.
> Changes since v5:
> Fixed a warning about a missing comment for a new member of
> drm_dp_aux_cec struct. Sending to a wider audience,
> including maintainers of respective drivers.
> Changes since v4:
> Addressing review comments.
> Changes since v3:
> Updated adapter flags in dw-hdmi-cec.
> Changes since v2:
> Include all DRM patches from "cec: improve notifier support,
> add connector info connector info" series.
> Changes since v1:
> Those patches delay creation of notifiers until respective
> connectors are constructed. It seems that those patches, for a
> couple of drivers, by adding the delay, introduce a race between
> notifiers' creation and the IRQs handling threads - at least I
> don't see anything obvious in there that would explicitly forbid
> such races to occur. v2 adds a write barrier to make sure IRQ
> threads see the notifier once it is created (replacing the
> WRITE_ONCE I put in v1). The best thing to do here, I believe,
> would be not to have any synchronization and make sure that an IRQ
> only gets enabled after the notifier is created.
> Dariusz Marcinkiewicz (9):
> drm_dp_cec: add connector info support.
> drm/i915/intel_hdmi: use cec_notifier_conn_(un)register
> dw-hdmi-cec: use cec_notifier_cec_adap_(un)register
> tda9950: use cec_notifier_cec_adap_(un)register
> drm: tda998x: use cec_notifier_conn_(un)register
> drm: sti: use cec_notifier_conn_(un)register
> drm: tegra: use cec_notifier_conn_(un)register
> drm: dw-hdmi: use cec_notifier_conn_(un)register
> drm: exynos: exynos_hdmi: use cec_notifier_conn_(un)register
>
> .../display/amdgpu_dm/amdgpu_dm_mst_types.c | 2 +-
> drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c | 13 +++---
> drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 46 +++++++++++++------
> drivers/gpu/drm/drm_dp_cec.c | 25 ++++++----
> drivers/gpu/drm/exynos/exynos_hdmi.c | 31 +++++++------
> drivers/gpu/drm/i2c/tda9950.c | 12 ++---
> drivers/gpu/drm/i2c/tda998x_drv.c | 36 ++++++++++-----
> drivers/gpu/drm/i915/display/intel_dp.c | 4 +-
> drivers/gpu/drm/i915/display/intel_hdmi.c | 13 ++++--
> drivers/gpu/drm/nouveau/nouveau_connector.c | 3 +-
> drivers/gpu/drm/sti/sti_hdmi.c | 19 +++++---
> drivers/gpu/drm/tegra/output.c | 28 ++++++++---
> include/drm/drm_dp_helper.h | 17 ++++---
> 13 files changed, 155 insertions(+), 94 deletions(-)
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v7 0/9] drm: cec: convert DRM drivers to the new notifier API
2019-08-19 9:38 ` [PATCH v7 0/9] drm: cec: convert DRM drivers to the new notifier API Hans Verkuil
@ 2019-08-19 11:28 ` Dariusz Marcinkiewicz
2019-08-19 12:00 ` Hans Verkuil
2019-08-19 14:48 ` Neil Armstrong
1 sibling, 1 reply; 11+ messages in thread
From: Dariusz Marcinkiewicz @ 2019-08-19 11:28 UTC (permalink / raw)
To: Hans Verkuil
Cc: Kate Stewart, Neil Armstrong, Daniel Vetter, dri-devel,
open list, Hans Verkuil, Dhinakaran Pandiyan, Sam Ravnborg,
linux-samsung-soc, David Francis, amd-gfx, Leo Li,
Jerry (Fangzhi) Zuo, Allison Randal, nouveau, linux-media,
Jonas Karlman, Jani Nikula, intel-gfx, Russell King, Sean Paul,
Rodrigo Vivi, linux-tegra, Thomas Gleixner, linux-arm-kernel,
Thomas Lim, Jernej Skrabec, Greg Kroah-Hartman, Douglas Anderson,
Manasi Navare, Alex Deucher, Colin Ian King, Enrico Weigelt,
Laurent Pinchart
On Mon, Aug 19, 2019 at 11:38 AM Hans Verkuil <hverkuil-cisco@xs4all.nl> wrote:
>
> Hi all,
>
Hi Hans.
> The patches in this series can be applied independently from each other.
>
> If you maintain one of these drivers and you want to merge it for v5.4
> yourself, then please do so and let me know. If you prefer I commit it
> to drm-misc, then please review and (hopefully) Ack the patch.
>
> I would really like to get this in for v5.4 so I can get the userspace
> bits in for v5.4 as well through the media subsystem.
>
> Dariusz, can you post a v7.1 for patch 5/9 fixing the typo?
>
Done.
I think it would be good to test v7 changes to dw-hdmi and tda998x on
a real hardware. Hans, do you think you would be able to test those?
Thank you.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v7 0/9] drm: cec: convert DRM drivers to the new notifier API
2019-08-19 11:28 ` Dariusz Marcinkiewicz
@ 2019-08-19 12:00 ` Hans Verkuil
0 siblings, 0 replies; 11+ messages in thread
From: Hans Verkuil @ 2019-08-19 12:00 UTC (permalink / raw)
To: Dariusz Marcinkiewicz
Cc: Kate Stewart, Neil Armstrong, Daniel Vetter, dri-devel,
open list, Hans Verkuil, Dhinakaran Pandiyan, Sam Ravnborg,
linux-samsung-soc, David Francis, amd-gfx, Leo Li,
Jerry (Fangzhi) Zuo, Allison Randal, nouveau, linux-media,
Jonas Karlman, Jani Nikula, intel-gfx, Russell King, Sean Paul,
Rodrigo Vivi, linux-tegra, Thomas Gleixner, linux-arm-kernel,
Thomas Lim, Jernej Skrabec, Greg Kroah-Hartman, Douglas Anderson,
Manasi Navare, Alex Deucher, Colin Ian King, Enrico Weigelt,
Laurent Pinchart
On 8/19/19 1:28 PM, Dariusz Marcinkiewicz wrote:
> On Mon, Aug 19, 2019 at 11:38 AM Hans Verkuil <hverkuil-cisco@xs4all.nl> wrote:
>>
>> Hi all,
>>
> Hi Hans.
>> The patches in this series can be applied independently from each other.
>>
>> If you maintain one of these drivers and you want to merge it for v5.4
>> yourself, then please do so and let me know. If you prefer I commit it
>> to drm-misc, then please review and (hopefully) Ack the patch.
>>
>> I would really like to get this in for v5.4 so I can get the userspace
>> bits in for v5.4 as well through the media subsystem.
>>
>> Dariusz, can you post a v7.1 for patch 5/9 fixing the typo?
>>
> Done.
>
> I think it would be good to test v7 changes to dw-hdmi and tda998x on
> a real hardware. Hans, do you think you would be able to test those?
>
> Thank you.
>
I'll try to do this for dw-hdmi today, but the tda998x testing will have to wait
until next week.
Regards,
Hans
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v7 0/9] drm: cec: convert DRM drivers to the new notifier API
2019-08-19 9:38 ` [PATCH v7 0/9] drm: cec: convert DRM drivers to the new notifier API Hans Verkuil
2019-08-19 11:28 ` Dariusz Marcinkiewicz
@ 2019-08-19 14:48 ` Neil Armstrong
2019-08-19 14:55 ` Hans Verkuil
1 sibling, 1 reply; 11+ messages in thread
From: Neil Armstrong @ 2019-08-19 14:48 UTC (permalink / raw)
To: Hans Verkuil, Dariusz Marcinkiewicz, dri-devel, linux-media
Cc: Kate Stewart, Daniel Vetter, linux-kernel, Hans Verkuil,
Dhinakaran Pandiyan, Sam Ravnborg, linux-samsung-soc,
David Francis, amd-gfx, Jani Nikula, Jerry (Fangzhi) Zuo,
linux-arm-kernel, nouveau, Jonas Karlman, Leo Li, intel-gfx,
Russell King, Sean Paul, Rodrigo Vivi, linux-tegra,
Thomas Gleixner, Allison Randal, Thomas Lim, Jernej Skrabec,
Greg Kroah-Hartman, Douglas Anderson, Manasi Navare,
Alex Deucher, Colin Ian King, Enrico Weigelt, Laurent Pinchart
Hi Dariusz, Hans,
I can apply the dw-hdmi patches if necessary.
Neil
On 19/08/2019 11:38, Hans Verkuil wrote:
> Hi all,
>
> The patches in this series can be applied independently from each other.
>
> If you maintain one of these drivers and you want to merge it for v5.4
> yourself, then please do so and let me know. If you prefer I commit it
> to drm-misc, then please review and (hopefully) Ack the patch.
>
> I would really like to get this in for v5.4 so I can get the userspace
> bits in for v5.4 as well through the media subsystem.
>
> Dariusz, can you post a v7.1 for patch 5/9 fixing the typo?
>
> Thanks!
>
> Hans
>
> On 8/14/19 12:44 PM, Dariusz Marcinkiewicz wrote:
>> This series updates DRM drivers to use new CEC notifier API.
>>
>> Changes since v6:
>> Made CEC notifiers' registration and de-registration symmetric
>> in tda998x and dw-hdmi drivers. Also, accidentally dropped one
>> patch in v6 (change to drm_dp_cec), brought it back now.
>> Changes since v5:
>> Fixed a warning about a missing comment for a new member of
>> drm_dp_aux_cec struct. Sending to a wider audience,
>> including maintainers of respective drivers.
>> Changes since v4:
>> Addressing review comments.
>> Changes since v3:
>> Updated adapter flags in dw-hdmi-cec.
>> Changes since v2:
>> Include all DRM patches from "cec: improve notifier support,
>> add connector info connector info" series.
>> Changes since v1:
>> Those patches delay creation of notifiers until respective
>> connectors are constructed. It seems that those patches, for a
>> couple of drivers, by adding the delay, introduce a race between
>> notifiers' creation and the IRQs handling threads - at least I
>> don't see anything obvious in there that would explicitly forbid
>> such races to occur. v2 adds a write barrier to make sure IRQ
>> threads see the notifier once it is created (replacing the
>> WRITE_ONCE I put in v1). The best thing to do here, I believe,
>> would be not to have any synchronization and make sure that an IRQ
>> only gets enabled after the notifier is created.
>> Dariusz Marcinkiewicz (9):
>> drm_dp_cec: add connector info support.
>> drm/i915/intel_hdmi: use cec_notifier_conn_(un)register
>> dw-hdmi-cec: use cec_notifier_cec_adap_(un)register
>> tda9950: use cec_notifier_cec_adap_(un)register
>> drm: tda998x: use cec_notifier_conn_(un)register
>> drm: sti: use cec_notifier_conn_(un)register
>> drm: tegra: use cec_notifier_conn_(un)register
>> drm: dw-hdmi: use cec_notifier_conn_(un)register
>> drm: exynos: exynos_hdmi: use cec_notifier_conn_(un)register
>>
>> .../display/amdgpu_dm/amdgpu_dm_mst_types.c | 2 +-
>> drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c | 13 +++---
>> drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 46 +++++++++++++------
>> drivers/gpu/drm/drm_dp_cec.c | 25 ++++++----
>> drivers/gpu/drm/exynos/exynos_hdmi.c | 31 +++++++------
>> drivers/gpu/drm/i2c/tda9950.c | 12 ++---
>> drivers/gpu/drm/i2c/tda998x_drv.c | 36 ++++++++++-----
>> drivers/gpu/drm/i915/display/intel_dp.c | 4 +-
>> drivers/gpu/drm/i915/display/intel_hdmi.c | 13 ++++--
>> drivers/gpu/drm/nouveau/nouveau_connector.c | 3 +-
>> drivers/gpu/drm/sti/sti_hdmi.c | 19 +++++---
>> drivers/gpu/drm/tegra/output.c | 28 ++++++++---
>> include/drm/drm_dp_helper.h | 17 ++++---
>> 13 files changed, 155 insertions(+), 94 deletions(-)
>>
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v7 0/9] drm: cec: convert DRM drivers to the new notifier API
2019-08-19 14:48 ` Neil Armstrong
@ 2019-08-19 14:55 ` Hans Verkuil
0 siblings, 0 replies; 11+ messages in thread
From: Hans Verkuil @ 2019-08-19 14:55 UTC (permalink / raw)
To: Neil Armstrong, Dariusz Marcinkiewicz, dri-devel, linux-media
Cc: Kate Stewart, Daniel Vetter, linux-kernel, Hans Verkuil,
Dhinakaran Pandiyan, Sam Ravnborg, linux-samsung-soc,
David Francis, amd-gfx, Jani Nikula, Jerry (Fangzhi) Zuo,
linux-arm-kernel, nouveau, Jonas Karlman, Leo Li, intel-gfx,
Russell King, Sean Paul, Rodrigo Vivi, linux-tegra,
Thomas Gleixner, Allison Randal, Thomas Lim, Jernej Skrabec,
Greg Kroah-Hartman, Douglas Anderson, Manasi Navare,
Alex Deucher, Colin Ian King, Enrico Weigelt, Laurent Pinchart
On 8/19/19 4:48 PM, Neil Armstrong wrote:
> Hi Dariusz, Hans,
>
> I can apply the dw-hdmi patches if necessary.
I'd appreciate it if you can do that.
Thanks,
Hans
>
> Neil
>
> On 19/08/2019 11:38, Hans Verkuil wrote:
>> Hi all,
>>
>> The patches in this series can be applied independently from each other.
>>
>> If you maintain one of these drivers and you want to merge it for v5.4
>> yourself, then please do so and let me know. If you prefer I commit it
>> to drm-misc, then please review and (hopefully) Ack the patch.
>>
>> I would really like to get this in for v5.4 so I can get the userspace
>> bits in for v5.4 as well through the media subsystem.
>>
>> Dariusz, can you post a v7.1 for patch 5/9 fixing the typo?
>>
>> Thanks!
>>
>> Hans
>>
>> On 8/14/19 12:44 PM, Dariusz Marcinkiewicz wrote:
>>> This series updates DRM drivers to use new CEC notifier API.
>>>
>>> Changes since v6:
>>> Made CEC notifiers' registration and de-registration symmetric
>>> in tda998x and dw-hdmi drivers. Also, accidentally dropped one
>>> patch in v6 (change to drm_dp_cec), brought it back now.
>>> Changes since v5:
>>> Fixed a warning about a missing comment for a new member of
>>> drm_dp_aux_cec struct. Sending to a wider audience,
>>> including maintainers of respective drivers.
>>> Changes since v4:
>>> Addressing review comments.
>>> Changes since v3:
>>> Updated adapter flags in dw-hdmi-cec.
>>> Changes since v2:
>>> Include all DRM patches from "cec: improve notifier support,
>>> add connector info connector info" series.
>>> Changes since v1:
>>> Those patches delay creation of notifiers until respective
>>> connectors are constructed. It seems that those patches, for a
>>> couple of drivers, by adding the delay, introduce a race between
>>> notifiers' creation and the IRQs handling threads - at least I
>>> don't see anything obvious in there that would explicitly forbid
>>> such races to occur. v2 adds a write barrier to make sure IRQ
>>> threads see the notifier once it is created (replacing the
>>> WRITE_ONCE I put in v1). The best thing to do here, I believe,
>>> would be not to have any synchronization and make sure that an IRQ
>>> only gets enabled after the notifier is created.
>>> Dariusz Marcinkiewicz (9):
>>> drm_dp_cec: add connector info support.
>>> drm/i915/intel_hdmi: use cec_notifier_conn_(un)register
>>> dw-hdmi-cec: use cec_notifier_cec_adap_(un)register
>>> tda9950: use cec_notifier_cec_adap_(un)register
>>> drm: tda998x: use cec_notifier_conn_(un)register
>>> drm: sti: use cec_notifier_conn_(un)register
>>> drm: tegra: use cec_notifier_conn_(un)register
>>> drm: dw-hdmi: use cec_notifier_conn_(un)register
>>> drm: exynos: exynos_hdmi: use cec_notifier_conn_(un)register
>>>
>>> .../display/amdgpu_dm/amdgpu_dm_mst_types.c | 2 +-
>>> drivers/gpu/drm/bridge/synopsys/dw-hdmi-cec.c | 13 +++---
>>> drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 46 +++++++++++++------
>>> drivers/gpu/drm/drm_dp_cec.c | 25 ++++++----
>>> drivers/gpu/drm/exynos/exynos_hdmi.c | 31 +++++++------
>>> drivers/gpu/drm/i2c/tda9950.c | 12 ++---
>>> drivers/gpu/drm/i2c/tda998x_drv.c | 36 ++++++++++-----
>>> drivers/gpu/drm/i915/display/intel_dp.c | 4 +-
>>> drivers/gpu/drm/i915/display/intel_hdmi.c | 13 ++++--
>>> drivers/gpu/drm/nouveau/nouveau_connector.c | 3 +-
>>> drivers/gpu/drm/sti/sti_hdmi.c | 19 +++++---
>>> drivers/gpu/drm/tegra/output.c | 28 ++++++++---
>>> include/drm/drm_dp_helper.h | 17 ++++---
>>> 13 files changed, 155 insertions(+), 94 deletions(-)
>>>
>>
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v7 9/9] drm: exynos: exynos_hdmi: use cec_notifier_conn_(un)register
2019-08-14 10:45 ` [PATCH v7 9/9] drm: exynos: exynos_hdmi: use cec_notifier_conn_(un)register Dariusz Marcinkiewicz
2019-08-19 9:32 ` Hans Verkuil
@ 2019-08-28 8:39 ` Sylwester Nawrocki
2019-08-28 12:34 ` [PATCH v7.1 " Dariusz Marcinkiewicz
2019-08-28 12:38 ` [PATCH v7 " Dariusz Marcinkiewicz
1 sibling, 2 replies; 11+ messages in thread
From: Sylwester Nawrocki @ 2019-08-28 8:39 UTC (permalink / raw)
To: Dariusz Marcinkiewicz, dri-devel, linux-media, hverkuil-cisco
Cc: linux-samsung-soc, Joonyoung Shim, David Airlie, Seung-Woo Kim,
linux-kernel, Krzysztof Kozlowski, Inki Dae, Kyungmin Park,
Kukjin Kim, Daniel Vetter, linux-arm-kernel
On 8/14/19 12:45, Dariusz Marcinkiewicz wrote:
> Use the new cec_notifier_conn_(un)register() functions to
> (un)register the notifier for the HDMI connector, and fill in
> the cec_connector_info.
>
> Changes since v2:
> - removed unnecessary call to invalidate phys address before
> deregistering the notifier,
> - use cec_notifier_phys_addr_invalidate instead of setting
> invalid address on a notifier.
>
> Signed-off-by: Dariusz Marcinkiewicz <darekm@google.com>
> Tested-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
> diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
> index bc1565f1822ab..d532b468d9af5 100644
> --- a/drivers/gpu/drm/exynos/exynos_hdmi.c
> +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
> @@ -2006,12 +2020,6 @@ static int hdmi_probe(struct platform_device *pdev)
> }
> }
>
> - hdata->notifier = cec_notifier_get(&pdev->dev);
> - if (hdata->notifier == NULL) {
> - ret = -ENOMEM;
> - goto err_hdmiphy;
> - }
> -
> pm_runtime_enable(dev);
>
> audio_infoframe = &hdata->audio.infoframe;
> @@ -2023,7 +2031,7 @@ static int hdmi_probe(struct platform_device *pdev)
>
> ret = hdmi_register_audio_device(hdata);
> if (ret)
> - goto err_notifier_put;
> + goto err_runtime_disable;
> -err_notifier_put:
> - cec_notifier_put(hdata->notifier);
> +err_runtime_disable:
> pm_runtime_disable(dev);
nit: I think err_rpm_disable or err_pm_runtime_disable could be better
label names.
--
Thanks,
Sylwester
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v7.1 9/9] drm: exynos: exynos_hdmi: use cec_notifier_conn_(un)register
2019-08-28 8:39 ` Sylwester Nawrocki
@ 2019-08-28 12:34 ` Dariusz Marcinkiewicz
2019-08-28 12:38 ` [PATCH v7 " Dariusz Marcinkiewicz
1 sibling, 0 replies; 11+ messages in thread
From: Dariusz Marcinkiewicz @ 2019-08-28 12:34 UTC (permalink / raw)
To: dri-devel, linux-media, s.nawrocki, hverkuil-cisco
Cc: linux-samsung-soc, Joonyoung Shim, David Airlie, Seung-Woo Kim,
linux-kernel, Krzysztof Kozlowski, Inki Dae, Kyungmin Park,
Kukjin Kim, Daniel Vetter, Dariusz Marcinkiewicz,
linux-arm-kernel
Use the new cec_notifier_conn_(un)register() functions to
(un)register the notifier for the HDMI connector, and fill in
the cec_connector_info.
Changes since v7:
- err_runtime_disable -> err_rpm_disable
Changes since v2:
- removed unnecessary call to invalidate phys address before
deregistering the notifier,
- use cec_notifier_phys_addr_invalidate instead of setting
invalid address on a notifier.
Signed-off-by: Dariusz Marcinkiewicz <darekm@google.com>
Tested-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
---
drivers/gpu/drm/exynos/exynos_hdmi.c | 31 ++++++++++++++++------------
1 file changed, 18 insertions(+), 13 deletions(-)
diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
index bc1565f1822ab..799f2db13efe2 100644
--- a/drivers/gpu/drm/exynos/exynos_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
@@ -852,6 +852,10 @@ static enum drm_connector_status hdmi_detect(struct drm_connector *connector,
static void hdmi_connector_destroy(struct drm_connector *connector)
{
+ struct hdmi_context *hdata = connector_to_hdmi(connector);
+
+ cec_notifier_conn_unregister(hdata->notifier);
+
drm_connector_unregister(connector);
drm_connector_cleanup(connector);
}
@@ -935,6 +939,7 @@ static int hdmi_create_connector(struct drm_encoder *encoder)
{
struct hdmi_context *hdata = encoder_to_hdmi(encoder);
struct drm_connector *connector = &hdata->connector;
+ struct cec_connector_info conn_info;
int ret;
connector->interlace_allowed = true;
@@ -957,6 +962,15 @@ static int hdmi_create_connector(struct drm_encoder *encoder)
DRM_DEV_ERROR(hdata->dev, "Failed to attach bridge\n");
}
+ cec_fill_conn_info_from_drm(&conn_info, connector);
+
+ hdata->notifier = cec_notifier_conn_register(hdata->dev, NULL,
+ &conn_info);
+ if (hdata->notifier == NULL) {
+ ret = -ENOMEM;
+ DRM_DEV_ERROR(hdata->dev, "Failed to allocate CEC notifier\n");
+ }
+
return ret;
}
@@ -1528,8 +1542,8 @@ static void hdmi_disable(struct drm_encoder *encoder)
*/
mutex_unlock(&hdata->mutex);
cancel_delayed_work(&hdata->hotplug_work);
- cec_notifier_set_phys_addr(hdata->notifier,
- CEC_PHYS_ADDR_INVALID);
+ if (hdata->notifier)
+ cec_notifier_phys_addr_invalidate(hdata->notifier);
return;
}
@@ -2006,12 +2020,6 @@ static int hdmi_probe(struct platform_device *pdev)
}
}
- hdata->notifier = cec_notifier_get(&pdev->dev);
- if (hdata->notifier == NULL) {
- ret = -ENOMEM;
- goto err_hdmiphy;
- }
-
pm_runtime_enable(dev);
audio_infoframe = &hdata->audio.infoframe;
@@ -2023,7 +2031,7 @@ static int hdmi_probe(struct platform_device *pdev)
ret = hdmi_register_audio_device(hdata);
if (ret)
- goto err_notifier_put;
+ goto err_rpm_disable;
ret = component_add(&pdev->dev, &hdmi_component_ops);
if (ret)
@@ -2034,8 +2042,7 @@ static int hdmi_probe(struct platform_device *pdev)
err_unregister_audio:
platform_device_unregister(hdata->audio.pdev);
-err_notifier_put:
- cec_notifier_put(hdata->notifier);
+err_rpm_disable:
pm_runtime_disable(dev);
err_hdmiphy:
@@ -2054,12 +2061,10 @@ static int hdmi_remove(struct platform_device *pdev)
struct hdmi_context *hdata = platform_get_drvdata(pdev);
cancel_delayed_work_sync(&hdata->hotplug_work);
- cec_notifier_set_phys_addr(hdata->notifier, CEC_PHYS_ADDR_INVALID);
component_del(&pdev->dev, &hdmi_component_ops);
platform_device_unregister(hdata->audio.pdev);
- cec_notifier_put(hdata->notifier);
pm_runtime_disable(&pdev->dev);
if (!IS_ERR(hdata->reg_hdmi_en))
--
2.23.0.187.g17f5b7556c-goog
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v7 9/9] drm: exynos: exynos_hdmi: use cec_notifier_conn_(un)register
2019-08-28 8:39 ` Sylwester Nawrocki
2019-08-28 12:34 ` [PATCH v7.1 " Dariusz Marcinkiewicz
@ 2019-08-28 12:38 ` Dariusz Marcinkiewicz
1 sibling, 0 replies; 11+ messages in thread
From: Dariusz Marcinkiewicz @ 2019-08-28 12:38 UTC (permalink / raw)
To: Sylwester Nawrocki
Cc: linux-samsung-soc, Joonyoung Shim, David Airlie, Seung-Woo Kim,
open list, dri-devel, Inki Dae, Kyungmin Park, Kukjin Kim,
Krzysztof Kozlowski, Daniel Vetter, Hans Verkuil,
linux-arm-kernel, linux-media
Hi.
On Wed, Aug 28, 2019 at 10:39 AM Sylwester Nawrocki
<s.nawrocki@samsung.com> wrote:
>
> nit: I think err_rpm_disable or err_pm_runtime_disable could be better
> label names.
>
Submitted v7.1 which replaces err_runtime_disable with err_rpm_disable.
Thank you.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2019-08-28 12:38 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-14 10:44 [PATCH v7 0/9] drm: cec: convert DRM drivers to the new notifier API Dariusz Marcinkiewicz
2019-08-14 10:45 ` [PATCH v7 9/9] drm: exynos: exynos_hdmi: use cec_notifier_conn_(un)register Dariusz Marcinkiewicz
2019-08-19 9:32 ` Hans Verkuil
2019-08-28 8:39 ` Sylwester Nawrocki
2019-08-28 12:34 ` [PATCH v7.1 " Dariusz Marcinkiewicz
2019-08-28 12:38 ` [PATCH v7 " Dariusz Marcinkiewicz
2019-08-19 9:38 ` [PATCH v7 0/9] drm: cec: convert DRM drivers to the new notifier API Hans Verkuil
2019-08-19 11:28 ` Dariusz Marcinkiewicz
2019-08-19 12:00 ` Hans Verkuil
2019-08-19 14:48 ` Neil Armstrong
2019-08-19 14:55 ` Hans Verkuil
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).