Daniel noted[1] that commit d606dc9a6323 ("drm: kirin: Add
register connect helper functions in drm init") was unnecessary
and incorrect, as drm_dev_register does register connectors for
us.
Thus, this patch reverts the change as suggested by Daniel.
[1]: https://lore.kernel.org/lkml/CAKMK7uHr5U-pPsxdQ4MpfK5v8iLjphDFug_3VTiUAf06nhS=yQ@mail.gmail.com/
Cc: Xu YiPing <[email protected]>
Cc: Rongrong Zou <[email protected]>
Cc: Xinliang Liu <[email protected]>
Cc: Xinwei Kong <[email protected]>
Cc: Chen Feng <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: Sam Ravnborg <[email protected]>
Cc: dri-devel <[email protected]>
Signed-off-by: John Stultz <[email protected]>
---
.../gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 1 -
.../gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 43 -------------------
.../gpu/drm/hisilicon/kirin/kirin_drm_drv.h | 1 -
3 files changed, 45 deletions(-)
diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
index 86000127d4ee..c339e632522a 100644
--- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
+++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
@@ -940,7 +940,6 @@ static struct drm_driver ade_driver = {
};
struct kirin_drm_data ade_driver_data = {
- .register_connects = false,
.num_planes = ADE_CH_NUM,
.prim_plane = ADE_CH1,
.channel_formats = channel_formats,
diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
index d3145ae877d7..4349da3e2379 100644
--- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
+++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
@@ -219,40 +219,6 @@ static int kirin_drm_kms_cleanup(struct drm_device *dev)
return 0;
}
-static int kirin_drm_connectors_register(struct drm_device *dev)
-{
- struct drm_connector *connector;
- struct drm_connector *failed_connector;
- struct drm_connector_list_iter conn_iter;
- int ret;
-
- mutex_lock(&dev->mode_config.mutex);
- drm_connector_list_iter_begin(dev, &conn_iter);
- drm_for_each_connector_iter(connector, &conn_iter) {
- ret = drm_connector_register(connector);
- if (ret) {
- failed_connector = connector;
- goto err;
- }
- }
- drm_connector_list_iter_end(&conn_iter);
- mutex_unlock(&dev->mode_config.mutex);
-
- return 0;
-
-err:
- drm_connector_list_iter_begin(dev, &conn_iter);
- drm_for_each_connector_iter(connector, &conn_iter) {
- if (failed_connector == connector)
- break;
- drm_connector_unregister(connector);
- }
- drm_connector_list_iter_end(&conn_iter);
- mutex_unlock(&dev->mode_config.mutex);
-
- return ret;
-}
-
static int kirin_drm_bind(struct device *dev)
{
struct kirin_drm_data *driver_data;
@@ -279,17 +245,8 @@ static int kirin_drm_bind(struct device *dev)
drm_fbdev_generic_setup(drm_dev, 32);
- /* connectors should be registered after drm device register */
- if (driver_data->register_connects) {
- ret = kirin_drm_connectors_register(drm_dev);
- if (ret)
- goto err_drm_dev_unregister;
- }
-
return 0;
-err_drm_dev_unregister:
- drm_dev_unregister(drm_dev);
err_kms_cleanup:
kirin_drm_kms_cleanup(drm_dev);
err_drm_dev_put:
diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.h b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.h
index 4d5c05a24065..dee8ec2f7f2e 100644
--- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.h
+++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.h
@@ -37,7 +37,6 @@ struct kirin_drm_data {
u32 channel_formats_cnt;
int config_max_width;
int config_max_height;
- bool register_connects;
u32 num_planes;
u32 prim_plane;
--
2.17.1
On Thu, Apr 09, 2020 at 12:43:06AM +0000, John Stultz wrote:
> Daniel noted[1] that commit d606dc9a6323 ("drm: kirin: Add
> register connect helper functions in drm init") was unnecessary
> and incorrect, as drm_dev_register does register connectors for
> us.
>
> Thus, this patch reverts the change as suggested by Daniel.
>
> [1]: https://lore.kernel.org/lkml/CAKMK7uHr5U-pPsxdQ4MpfK5v8iLjphDFug_3VTiUAf06nhS=yQ@mail.gmail.com/
>
> Cc: Xu YiPing <[email protected]>
> Cc: Rongrong Zou <[email protected]>
> Cc: Xinliang Liu <[email protected]>
> Cc: Xinwei Kong <[email protected]>
> Cc: Chen Feng <[email protected]>
> Cc: David Airlie <[email protected]>
> Cc: Daniel Vetter <[email protected]>
> Cc: Sam Ravnborg <[email protected]>
> Cc: dri-devel <[email protected]>
> Signed-off-by: John Stultz <[email protected]>
Reviewed-by: Daniel Vetter <[email protected]>
Thanks for the quick fix!
Cheers, Daniel
> ---
> .../gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 1 -
> .../gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 43 -------------------
> .../gpu/drm/hisilicon/kirin/kirin_drm_drv.h | 1 -
> 3 files changed, 45 deletions(-)
>
> diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
> index 86000127d4ee..c339e632522a 100644
> --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
> +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
> @@ -940,7 +940,6 @@ static struct drm_driver ade_driver = {
> };
>
> struct kirin_drm_data ade_driver_data = {
> - .register_connects = false,
> .num_planes = ADE_CH_NUM,
> .prim_plane = ADE_CH1,
> .channel_formats = channel_formats,
> diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
> index d3145ae877d7..4349da3e2379 100644
> --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
> +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
> @@ -219,40 +219,6 @@ static int kirin_drm_kms_cleanup(struct drm_device *dev)
> return 0;
> }
>
> -static int kirin_drm_connectors_register(struct drm_device *dev)
> -{
> - struct drm_connector *connector;
> - struct drm_connector *failed_connector;
> - struct drm_connector_list_iter conn_iter;
> - int ret;
> -
> - mutex_lock(&dev->mode_config.mutex);
> - drm_connector_list_iter_begin(dev, &conn_iter);
> - drm_for_each_connector_iter(connector, &conn_iter) {
> - ret = drm_connector_register(connector);
> - if (ret) {
> - failed_connector = connector;
> - goto err;
> - }
> - }
> - drm_connector_list_iter_end(&conn_iter);
> - mutex_unlock(&dev->mode_config.mutex);
> -
> - return 0;
> -
> -err:
> - drm_connector_list_iter_begin(dev, &conn_iter);
> - drm_for_each_connector_iter(connector, &conn_iter) {
> - if (failed_connector == connector)
> - break;
> - drm_connector_unregister(connector);
> - }
> - drm_connector_list_iter_end(&conn_iter);
> - mutex_unlock(&dev->mode_config.mutex);
> -
> - return ret;
> -}
> -
> static int kirin_drm_bind(struct device *dev)
> {
> struct kirin_drm_data *driver_data;
> @@ -279,17 +245,8 @@ static int kirin_drm_bind(struct device *dev)
>
> drm_fbdev_generic_setup(drm_dev, 32);
>
> - /* connectors should be registered after drm device register */
> - if (driver_data->register_connects) {
> - ret = kirin_drm_connectors_register(drm_dev);
> - if (ret)
> - goto err_drm_dev_unregister;
> - }
> -
> return 0;
>
> -err_drm_dev_unregister:
> - drm_dev_unregister(drm_dev);
> err_kms_cleanup:
> kirin_drm_kms_cleanup(drm_dev);
> err_drm_dev_put:
> diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.h b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.h
> index 4d5c05a24065..dee8ec2f7f2e 100644
> --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.h
> +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.h
> @@ -37,7 +37,6 @@ struct kirin_drm_data {
> u32 channel_formats_cnt;
> int config_max_width;
> int config_max_height;
> - bool register_connects;
> u32 num_planes;
> u32 prim_plane;
>
> --
> 2.17.1
>
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
On Thu, 9 Apr 2020 at 08:43, John Stultz <[email protected]> wrote:
>
> Daniel noted[1] that commit d606dc9a6323 ("drm: kirin: Add
> register connect helper functions in drm init") was unnecessary
> and incorrect, as drm_dev_register does register connectors for
> us.
>
> Thus, this patch reverts the change as suggested by Daniel.
>
> [1]: https://lore.kernel.org/lkml/CAKMK7uHr5U-pPsxdQ4MpfK5v8iLjphDFug_3VTiUAf06nhS=yQ@mail.gmail.com/
>
> Cc: Xu YiPing <[email protected]>
> Cc: Rongrong Zou <[email protected]>
> Cc: Xinliang Liu <[email protected]>
> Cc: Xinwei Kong <[email protected]>
> Cc: Chen Feng <[email protected]>
> Cc: David Airlie <[email protected]>
> Cc: Daniel Vetter <[email protected]>
> Cc: Sam Ravnborg <[email protected]>
> Cc: dri-devel <[email protected]>
> Signed-off-by: John Stultz <[email protected]>
Thanks John for the fix.
Acked-by: Xinliang Liu <[email protected]>
Applied to drm-misc.
-Xinliang
> ---
> .../gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 1 -
> .../gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 43 -------------------
> .../gpu/drm/hisilicon/kirin/kirin_drm_drv.h | 1 -
> 3 files changed, 45 deletions(-)
>
> diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
> index 86000127d4ee..c339e632522a 100644
> --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
> +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
> @@ -940,7 +940,6 @@ static struct drm_driver ade_driver = {
> };
>
> struct kirin_drm_data ade_driver_data = {
> - .register_connects = false,
> .num_planes = ADE_CH_NUM,
> .prim_plane = ADE_CH1,
> .channel_formats = channel_formats,
> diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
> index d3145ae877d7..4349da3e2379 100644
> --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
> +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
> @@ -219,40 +219,6 @@ static int kirin_drm_kms_cleanup(struct drm_device *dev)
> return 0;
> }
>
> -static int kirin_drm_connectors_register(struct drm_device *dev)
> -{
> - struct drm_connector *connector;
> - struct drm_connector *failed_connector;
> - struct drm_connector_list_iter conn_iter;
> - int ret;
> -
> - mutex_lock(&dev->mode_config.mutex);
> - drm_connector_list_iter_begin(dev, &conn_iter);
> - drm_for_each_connector_iter(connector, &conn_iter) {
> - ret = drm_connector_register(connector);
> - if (ret) {
> - failed_connector = connector;
> - goto err;
> - }
> - }
> - drm_connector_list_iter_end(&conn_iter);
> - mutex_unlock(&dev->mode_config.mutex);
> -
> - return 0;
> -
> -err:
> - drm_connector_list_iter_begin(dev, &conn_iter);
> - drm_for_each_connector_iter(connector, &conn_iter) {
> - if (failed_connector == connector)
> - break;
> - drm_connector_unregister(connector);
> - }
> - drm_connector_list_iter_end(&conn_iter);
> - mutex_unlock(&dev->mode_config.mutex);
> -
> - return ret;
> -}
> -
> static int kirin_drm_bind(struct device *dev)
> {
> struct kirin_drm_data *driver_data;
> @@ -279,17 +245,8 @@ static int kirin_drm_bind(struct device *dev)
>
> drm_fbdev_generic_setup(drm_dev, 32);
>
> - /* connectors should be registered after drm device register */
> - if (driver_data->register_connects) {
> - ret = kirin_drm_connectors_register(drm_dev);
> - if (ret)
> - goto err_drm_dev_unregister;
> - }
> -
> return 0;
>
> -err_drm_dev_unregister:
> - drm_dev_unregister(drm_dev);
> err_kms_cleanup:
> kirin_drm_kms_cleanup(drm_dev);
> err_drm_dev_put:
> diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.h b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.h
> index 4d5c05a24065..dee8ec2f7f2e 100644
> --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.h
> +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.h
> @@ -37,7 +37,6 @@ struct kirin_drm_data {
> u32 channel_formats_cnt;
> int config_max_width;
> int config_max_height;
> - bool register_connects;
> u32 num_planes;
> u32 prim_plane;
>
> --
> 2.17.1
>