drm_encoder_slave is the old way to write bridge drivers, for i2c bridges only. It's deprecated, and definitely should not be used in new drivers.
What's even strange is that arcpgu doesn't even use any of this, it really only wants a plain normal drm_encoder. Nuke all the surplus real estate.
Cc: Alexey Brodkin abrodkin@synopsys.com Signed-off-by: Daniel Vetter daniel.vetter@intel.com --- drivers/gpu/drm/arc/arcpgu_sim.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/arc/arcpgu_sim.c b/drivers/gpu/drm/arc/arcpgu_sim.c index bca3a678c955..d01f7743b63d 100644 --- a/drivers/gpu/drm/arc/arcpgu_sim.c +++ b/drivers/gpu/drm/arc/arcpgu_sim.c @@ -29,7 +29,6 @@
struct arcpgu_drm_connector { struct drm_connector connector; - struct drm_encoder_slave *encoder_slave; };
static int arcpgu_drm_connector_get_modes(struct drm_connector *connector) @@ -68,7 +67,7 @@ static struct drm_encoder_funcs arcpgu_drm_encoder_funcs = { int arcpgu_drm_sim_init(struct drm_device *drm, struct device_node *np) { struct arcpgu_drm_connector *arcpgu_connector; - struct drm_encoder_slave *encoder; + struct drm_encoder *encoder; struct drm_connector *connector; int ret;
@@ -76,10 +75,10 @@ int arcpgu_drm_sim_init(struct drm_device *drm, struct device_node *np) if (encoder == NULL) return -ENOMEM;
- encoder->base.possible_crtcs = 1; - encoder->base.possible_clones = 0; + encoder->possible_crtcs = 1; + encoder->possible_clones = 0;
- ret = drm_encoder_init(drm, &encoder->base, &arcpgu_drm_encoder_funcs, + ret = drm_encoder_init(drm, encoder, &arcpgu_drm_encoder_funcs, DRM_MODE_ENCODER_VIRTUAL, NULL); if (ret) return ret; @@ -101,15 +100,13 @@ int arcpgu_drm_sim_init(struct drm_device *drm, struct device_node *np) goto error_encoder_cleanup; }
- ret = drm_mode_connector_attach_encoder(connector, &encoder->base); + ret = drm_mode_connector_attach_encoder(connector, encoder); if (ret < 0) { dev_err(drm->dev, "could not attach connector to encoder\n"); drm_connector_unregister(connector); goto error_connector_cleanup; }
- arcpgu_connector->encoder_slave = encoder; - return 0;
error_connector_cleanup:
drm_encoder_slave is the old way to write bridge drivers, for i2c bridges only. It's deprecated, and definitely should not be used in new drivers.
What's even strange is that arcpgu doesn't even use any of this, it really only wants a plain normal drm_encoder. Nuke all the surplus real estate.
v2: Actually git add after compile testing ...
Cc: Laurent Pinchart laurent.pinchart@ideasonboard.com Cc: Alexey Brodkin abrodkin@synopsys.com Signed-off-by: Daniel Vetter daniel.vetter@intel.com --- drivers/gpu/drm/arc/arcpgu_sim.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/drivers/gpu/drm/arc/arcpgu_sim.c b/drivers/gpu/drm/arc/arcpgu_sim.c index bca3a678c955..19f5a781666d 100644 --- a/drivers/gpu/drm/arc/arcpgu_sim.c +++ b/drivers/gpu/drm/arc/arcpgu_sim.c @@ -29,7 +29,6 @@
struct arcpgu_drm_connector { struct drm_connector connector; - struct drm_encoder_slave *encoder_slave; };
static int arcpgu_drm_connector_get_modes(struct drm_connector *connector) @@ -68,7 +67,7 @@ static struct drm_encoder_funcs arcpgu_drm_encoder_funcs = { int arcpgu_drm_sim_init(struct drm_device *drm, struct device_node *np) { struct arcpgu_drm_connector *arcpgu_connector; - struct drm_encoder_slave *encoder; + struct drm_encoder *encoder; struct drm_connector *connector; int ret;
@@ -76,10 +75,10 @@ int arcpgu_drm_sim_init(struct drm_device *drm, struct device_node *np) if (encoder == NULL) return -ENOMEM;
- encoder->base.possible_crtcs = 1; - encoder->base.possible_clones = 0; + encoder->possible_crtcs = 1; + encoder->possible_clones = 0;
- ret = drm_encoder_init(drm, &encoder->base, &arcpgu_drm_encoder_funcs, + ret = drm_encoder_init(drm, encoder, &arcpgu_drm_encoder_funcs, DRM_MODE_ENCODER_VIRTUAL, NULL); if (ret) return ret; @@ -101,21 +100,19 @@ int arcpgu_drm_sim_init(struct drm_device *drm, struct device_node *np) goto error_encoder_cleanup; }
- ret = drm_mode_connector_attach_encoder(connector, &encoder->base); + ret = drm_mode_connector_attach_encoder(connector, encoder); if (ret < 0) { dev_err(drm->dev, "could not attach connector to encoder\n"); drm_connector_unregister(connector); goto error_connector_cleanup; }
- arcpgu_connector->encoder_slave = encoder; - return 0;
error_connector_cleanup: drm_connector_cleanup(connector);
error_encoder_cleanup: - drm_encoder_cleanup(&encoder->base); + drm_encoder_cleanup(encoder); return ret; }
Hi Daniel,
Thank you for the patch.
On Wednesday, 17 January 2018 15:53:07 EET Daniel Vetter wrote:
drm_encoder_slave is the old way to write bridge drivers, for i2c bridges only. It's deprecated, and definitely should not be used in new drivers.
What's even strange is that arcpgu doesn't even use any of this, it really only wants a plain normal drm_encoder. Nuke all the surplus real estate.
v2: Actually git add after compile testing ...
Cc: Laurent Pinchart laurent.pinchart@ideasonboard.com Cc: Alexey Brodkin abrodkin@synopsys.com Signed-off-by: Daniel Vetter daniel.vetter@intel.com
Reviewed-by: Laurent Pinchart laurent.pinchart@ideasonboard.com
Could you merge this along with "[PATCH] drm: Don't include drm/ drm_encoder_slave.h when not needed" ? We will then only have two users of the encoder slave API left, nouveau and armada (and of course the encoder slave drivers themselves), and no stray occurrence of the encoder slave term in other source files.
drivers/gpu/drm/arc/arcpgu_sim.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/drivers/gpu/drm/arc/arcpgu_sim.c b/drivers/gpu/drm/arc/arcpgu_sim.c index bca3a678c955..19f5a781666d 100644 --- a/drivers/gpu/drm/arc/arcpgu_sim.c +++ b/drivers/gpu/drm/arc/arcpgu_sim.c @@ -29,7 +29,6 @@
struct arcpgu_drm_connector { struct drm_connector connector;
- struct drm_encoder_slave *encoder_slave;
};
static int arcpgu_drm_connector_get_modes(struct drm_connector *connector) @@ -68,7 +67,7 @@ static struct drm_encoder_funcs arcpgu_drm_encoder_funcs = { int arcpgu_drm_sim_init(struct drm_device *drm, struct device_node *np) { struct arcpgu_drm_connector *arcpgu_connector;
- struct drm_encoder_slave *encoder;
- struct drm_encoder *encoder; struct drm_connector *connector; int ret;
@@ -76,10 +75,10 @@ int arcpgu_drm_sim_init(struct drm_device *drm, struct device_node *np) if (encoder == NULL) return -ENOMEM;
- encoder->base.possible_crtcs = 1;
- encoder->base.possible_clones = 0;
- encoder->possible_crtcs = 1;
- encoder->possible_clones = 0;
- ret = drm_encoder_init(drm, &encoder->base, &arcpgu_drm_encoder_funcs,
- ret = drm_encoder_init(drm, encoder, &arcpgu_drm_encoder_funcs, DRM_MODE_ENCODER_VIRTUAL, NULL); if (ret) return ret;
@@ -101,21 +100,19 @@ int arcpgu_drm_sim_init(struct drm_device *drm, struct device_node *np) goto error_encoder_cleanup; }
- ret = drm_mode_connector_attach_encoder(connector, &encoder->base);
- ret = drm_mode_connector_attach_encoder(connector, encoder); if (ret < 0) { dev_err(drm->dev, "could not attach connector to encoder\n"); drm_connector_unregister(connector); goto error_connector_cleanup; }
- arcpgu_connector->encoder_slave = encoder;
- return 0;
error_connector_cleanup: drm_connector_cleanup(connector);
error_encoder_cleanup:
- drm_encoder_cleanup(&encoder->base);
- drm_encoder_cleanup(encoder); return ret;
}
Hi Daniel,
On Wed, 2018-01-17 at 14:43 +0100, Daniel Vetter wrote:
drm_encoder_slave is the old way to write bridge drivers, for i2c bridges only. It's deprecated, and definitely should not be used in new drivers.
What's even strange is that arcpgu doesn't even use any of this, it really only wants a plain normal drm_encoder. Nuke all the surplus real estate.
As of today we use either use adv7511 encoder or dw-hdmi. And I guess proposed change is OK for both bridge versions, rigth?
-Alexey
On Wed, Jan 17, 2018 at 01:55:55PM +0000, Alexey Brodkin wrote:
Hi Daniel,
On Wed, 2018-01-17 at 14:43 +0100, Daniel Vetter wrote:
drm_encoder_slave is the old way to write bridge drivers, for i2c bridges only. It's deprecated, and definitely should not be used in new drivers.
What's even strange is that arcpgu doesn't even use any of this, it really only wants a plain normal drm_encoder. Nuke all the surplus real estate.
As of today we use either use adv7511 encoder or dw-hdmi. And I guess proposed change is OK for both bridge versions, rigth?
drm_encoder_slave is something completely different from drm_bridge. The latter will keep working. -Daniel
drm_encoder_slave is the old way to write bridge drivers, for i2c bridges only. It's deprecated, and definitely should not be used in new drivers. This has absolutely nothing to do with the new bridge driver infrastructure implemented by drm_bridge.
What's even strange is that arcpgu doesn't even use any of this, it really only wants a plain normal drm_encoder. Nuke all the surplus real estate.
v2: Actually git add after compile testing ...
v3: Clarify commit message and stop including drm_encoder_slave.h.
Cc: Laurent Pinchart laurent.pinchart@ideasonboard.com Cc: Alexey Brodkin abrodkin@synopsys.com Reviewed-by: Laurent Pinchart laurent.pinchart@ideasonboard.com Signed-off-by: Daniel Vetter daniel.vetter@intel.com --- drivers/gpu/drm/arc/arcpgu_hdmi.c | 3 ++- drivers/gpu/drm/arc/arcpgu_sim.c | 16 ++++++---------- 2 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/drivers/gpu/drm/arc/arcpgu_hdmi.c b/drivers/gpu/drm/arc/arcpgu_hdmi.c index 0ce7f398bcff..977dfa55162f 100644 --- a/drivers/gpu/drm/arc/arcpgu_hdmi.c +++ b/drivers/gpu/drm/arc/arcpgu_hdmi.c @@ -15,7 +15,8 @@ */
#include <drm/drm_crtc.h> -#include <drm/drm_encoder_slave.h> +#include <drm/drm_encoder.h> +#include <drm/drm_device.h>
#include "arcpgu.h"
diff --git a/drivers/gpu/drm/arc/arcpgu_sim.c b/drivers/gpu/drm/arc/arcpgu_sim.c index bca3a678c955..b8f6f9a5dfbe 100644 --- a/drivers/gpu/drm/arc/arcpgu_sim.c +++ b/drivers/gpu/drm/arc/arcpgu_sim.c @@ -15,7 +15,6 @@ */
#include <drm/drm_crtc_helper.h> -#include <drm/drm_encoder_slave.h> #include <drm/drm_atomic_helper.h>
#include "arcpgu.h" @@ -29,7 +28,6 @@
struct arcpgu_drm_connector { struct drm_connector connector; - struct drm_encoder_slave *encoder_slave; };
static int arcpgu_drm_connector_get_modes(struct drm_connector *connector) @@ -68,7 +66,7 @@ static struct drm_encoder_funcs arcpgu_drm_encoder_funcs = { int arcpgu_drm_sim_init(struct drm_device *drm, struct device_node *np) { struct arcpgu_drm_connector *arcpgu_connector; - struct drm_encoder_slave *encoder; + struct drm_encoder *encoder; struct drm_connector *connector; int ret;
@@ -76,10 +74,10 @@ int arcpgu_drm_sim_init(struct drm_device *drm, struct device_node *np) if (encoder == NULL) return -ENOMEM;
- encoder->base.possible_crtcs = 1; - encoder->base.possible_clones = 0; + encoder->possible_crtcs = 1; + encoder->possible_clones = 0;
- ret = drm_encoder_init(drm, &encoder->base, &arcpgu_drm_encoder_funcs, + ret = drm_encoder_init(drm, encoder, &arcpgu_drm_encoder_funcs, DRM_MODE_ENCODER_VIRTUAL, NULL); if (ret) return ret; @@ -101,21 +99,19 @@ int arcpgu_drm_sim_init(struct drm_device *drm, struct device_node *np) goto error_encoder_cleanup; }
- ret = drm_mode_connector_attach_encoder(connector, &encoder->base); + ret = drm_mode_connector_attach_encoder(connector, encoder); if (ret < 0) { dev_err(drm->dev, "could not attach connector to encoder\n"); drm_connector_unregister(connector); goto error_connector_cleanup; }
- arcpgu_connector->encoder_slave = encoder; - return 0;
error_connector_cleanup: drm_connector_cleanup(connector);
error_encoder_cleanup: - drm_encoder_cleanup(&encoder->base); + drm_encoder_cleanup(encoder); return ret; }
On Wed, Jan 17, 2018 at 03:17:55PM +0100, Daniel Vetter wrote:
drm_encoder_slave is the old way to write bridge drivers, for i2c bridges only. It's deprecated, and definitely should not be used in new drivers. This has absolutely nothing to do with the new bridge driver infrastructure implemented by drm_bridge.
What's even strange is that arcpgu doesn't even use any of this, it really only wants a plain normal drm_encoder. Nuke all the surplus real estate.
v2: Actually git add after compile testing ...
v3: Clarify commit message and stop including drm_encoder_slave.h.
Cc: Laurent Pinchart laurent.pinchart@ideasonboard.com Cc: Alexey Brodkin abrodkin@synopsys.com Reviewed-by: Laurent Pinchart laurent.pinchart@ideasonboard.com Signed-off-by: Daniel Vetter daniel.vetter@intel.com
I assumed this is ok and applied it to drm-misc-next. -Daniel
drivers/gpu/drm/arc/arcpgu_hdmi.c | 3 ++- drivers/gpu/drm/arc/arcpgu_sim.c | 16 ++++++---------- 2 files changed, 8 insertions(+), 11 deletions(-)
diff --git a/drivers/gpu/drm/arc/arcpgu_hdmi.c b/drivers/gpu/drm/arc/arcpgu_hdmi.c index 0ce7f398bcff..977dfa55162f 100644 --- a/drivers/gpu/drm/arc/arcpgu_hdmi.c +++ b/drivers/gpu/drm/arc/arcpgu_hdmi.c @@ -15,7 +15,8 @@ */
#include <drm/drm_crtc.h> -#include <drm/drm_encoder_slave.h> +#include <drm/drm_encoder.h> +#include <drm/drm_device.h>
#include "arcpgu.h"
diff --git a/drivers/gpu/drm/arc/arcpgu_sim.c b/drivers/gpu/drm/arc/arcpgu_sim.c index bca3a678c955..b8f6f9a5dfbe 100644 --- a/drivers/gpu/drm/arc/arcpgu_sim.c +++ b/drivers/gpu/drm/arc/arcpgu_sim.c @@ -15,7 +15,6 @@ */
#include <drm/drm_crtc_helper.h> -#include <drm/drm_encoder_slave.h> #include <drm/drm_atomic_helper.h>
#include "arcpgu.h" @@ -29,7 +28,6 @@
struct arcpgu_drm_connector { struct drm_connector connector;
- struct drm_encoder_slave *encoder_slave;
};
static int arcpgu_drm_connector_get_modes(struct drm_connector *connector) @@ -68,7 +66,7 @@ static struct drm_encoder_funcs arcpgu_drm_encoder_funcs = { int arcpgu_drm_sim_init(struct drm_device *drm, struct device_node *np) { struct arcpgu_drm_connector *arcpgu_connector;
- struct drm_encoder_slave *encoder;
- struct drm_encoder *encoder; struct drm_connector *connector; int ret;
@@ -76,10 +74,10 @@ int arcpgu_drm_sim_init(struct drm_device *drm, struct device_node *np) if (encoder == NULL) return -ENOMEM;
- encoder->base.possible_crtcs = 1;
- encoder->base.possible_clones = 0;
- encoder->possible_crtcs = 1;
- encoder->possible_clones = 0;
- ret = drm_encoder_init(drm, &encoder->base, &arcpgu_drm_encoder_funcs,
- ret = drm_encoder_init(drm, encoder, &arcpgu_drm_encoder_funcs, DRM_MODE_ENCODER_VIRTUAL, NULL); if (ret) return ret;
@@ -101,21 +99,19 @@ int arcpgu_drm_sim_init(struct drm_device *drm, struct device_node *np) goto error_encoder_cleanup; }
- ret = drm_mode_connector_attach_encoder(connector, &encoder->base);
- ret = drm_mode_connector_attach_encoder(connector, encoder); if (ret < 0) { dev_err(drm->dev, "could not attach connector to encoder\n"); drm_connector_unregister(connector); goto error_connector_cleanup; }
- arcpgu_connector->encoder_slave = encoder;
- return 0;
error_connector_cleanup: drm_connector_cleanup(connector);
error_encoder_cleanup:
- drm_encoder_cleanup(&encoder->base);
- drm_encoder_cleanup(encoder); return ret;
}
2.15.1
Hi Daniel,
On Tue, 2018-01-30 at 10:15 +0100, Daniel Vetter wrote:
On Wed, Jan 17, 2018 at 03:17:55PM +0100, Daniel Vetter wrote:
drm_encoder_slave is the old way to write bridge drivers, for i2c bridges only. It's deprecated, and definitely should not be used in new drivers. This has absolutely nothing to do with the new bridge driver infrastructure implemented by drm_bridge.
What's even strange is that arcpgu doesn't even use any of this, it really only wants a plain normal drm_encoder. Nuke all the surplus real estate.
v2: Actually git add after compile testing ...
v3: Clarify commit message and stop including drm_encoder_slave.h.
Cc: Laurent Pinchart laurent.pinchart@ideasonboard.com Cc: Alexey Brodkin abrodkin@synopsys.com Reviewed-by: Laurent Pinchart laurent.pinchart@ideasonboard.com Signed-off-by: Daniel Vetter daniel.vetter@intel.com
I assumed this is ok and applied it to drm-misc-next. -Daniel
Not sure but I still cannot see anything arcpgu-related here https://cgit.freedesktop.org/drm-misc/log/
Am I looking at the wrong place?
-Alexey
On Tue, Jan 30, 2018 at 5:44 PM, Alexey Brodkin Alexey.Brodkin@synopsys.com wrote:
Hi Daniel,
On Tue, 2018-01-30 at 10:15 +0100, Daniel Vetter wrote:
On Wed, Jan 17, 2018 at 03:17:55PM +0100, Daniel Vetter wrote:
drm_encoder_slave is the old way to write bridge drivers, for i2c bridges only. It's deprecated, and definitely should not be used in new drivers. This has absolutely nothing to do with the new bridge driver infrastructure implemented by drm_bridge.
What's even strange is that arcpgu doesn't even use any of this, it really only wants a plain normal drm_encoder. Nuke all the surplus real estate.
v2: Actually git add after compile testing ...
v3: Clarify commit message and stop including drm_encoder_slave.h.
Cc: Laurent Pinchart laurent.pinchart@ideasonboard.com Cc: Alexey Brodkin abrodkin@synopsys.com Reviewed-by: Laurent Pinchart laurent.pinchart@ideasonboard.com Signed-off-by: Daniel Vetter daniel.vetter@intel.com
I assumed this is ok and applied it to drm-misc-next. -Daniel
Not sure but I still cannot see anything arcpgu-related here https://cgit.freedesktop.org/drm-misc/log/
Am I looking at the wrong place?
Build test script got stuck, pushed for real now. -Daniel
Hi Daniel,
On Tue, 2018-01-30 at 18:07 +0100, Daniel Vetter wrote:
On Tue, Jan 30, 2018 at 5:44 PM, Alexey Brodkin Alexey.Brodkin@synopsys.com wrote:
Hi Daniel,
On Tue, 2018-01-30 at 10:15 +0100, Daniel Vetter wrote:
On Wed, Jan 17, 2018 at 03:17:55PM +0100, Daniel Vetter wrote:
drm_encoder_slave is the old way to write bridge drivers, for i2c bridges only. It's deprecated, and definitely should not be used in new drivers. This has absolutely nothing to do with the new bridge driver infrastructure implemented by drm_bridge.
What's even strange is that arcpgu doesn't even use any of this, it really only wants a plain normal drm_encoder. Nuke all the surplus real estate.
v2: Actually git add after compile testing ...
v3: Clarify commit message and stop including drm_encoder_slave.h.
Cc: Laurent Pinchart laurent.pinchart@ideasonboard.com Cc: Alexey Brodkin abrodkin@synopsys.com Reviewed-by: Laurent Pinchart laurent.pinchart@ideasonboard.com Signed-off-by: Daniel Vetter daniel.vetter@intel.com
I assumed this is ok and applied it to drm-misc-next. -Daniel
Not sure but I still cannot see anything arcpgu-related here https://urldefense.proofpoint.com/v2/url?u=https-3A__cgit.freedesktop.org_dr... ViXO7breS55ytWkhpk5R81I&m=ZsFKo3w8gSf8Ul8_sl5RG8BACV1SwqgPV3wf6m4YtVM&s=f9P3-3L_o6CCd_1IQjGPNtAPAOtlO8rj2D2X8T5v_xw&e=
Am I looking at the wrong place?
Build test script got stuck, pushed for real now.
Thanks!
Gave it a try and it works perfectly fine. If it still makes any sense...
Acked-by: Alexey Brodkin abrodkin@synopsys.com
Hi Daniel,
I love your patch! Yet something to improve:
[auto build test ERROR on drm/drm-next] [also build test ERROR on v4.15-rc8 next-20180119] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Daniel-Vetter/drm-arcpgu-remove-drm... base: git://people.freedesktop.org/~airlied/linux.git drm-next config: x86_64-randconfig-x008-201802 (attached as .config) compiler: gcc-7 (Debian 7.2.0-12) 7.2.1 20171025 reproduce: # save the attached .config to linux build tree make ARCH=x86_64
All errors (new ones prefixed by >>):
drivers/gpu//drm/arc/arcpgu_sim.c: In function 'arcpgu_drm_sim_init':
drivers/gpu//drm/arc/arcpgu_sim.c:116:22: error: passing argument 1 of 'drm_encoder_cleanup' from incompatible pointer type [-Werror=incompatible-pointer-types]
drm_encoder_cleanup(&encoder->base); ^ In file included from include/drm/drm_modeset_helper_vtables.h:33:0, from include/drm/drm_crtc_helper.h:43, from drivers/gpu//drm/arc/arcpgu_sim.c:17: include/drm/drm_encoder.h:232:6: note: expected 'struct drm_encoder *' but argument is of type 'struct drm_mode_object *' void drm_encoder_cleanup(struct drm_encoder *encoder); ^~~~~~~~~~~~~~~~~~~ cc1: some warnings being treated as errors
vim +/drm_encoder_cleanup +116 drivers/gpu//drm/arc/arcpgu_sim.c
a189d28e Ruud Derwig 2016-06-06 66 a189d28e Ruud Derwig 2016-06-06 67 int arcpgu_drm_sim_init(struct drm_device *drm, struct device_node *np) a189d28e Ruud Derwig 2016-06-06 68 { a189d28e Ruud Derwig 2016-06-06 69 struct arcpgu_drm_connector *arcpgu_connector; 70fbd4a0 Daniel Vetter 2018-01-17 70 struct drm_encoder *encoder; a189d28e Ruud Derwig 2016-06-06 71 struct drm_connector *connector; a189d28e Ruud Derwig 2016-06-06 72 int ret; a189d28e Ruud Derwig 2016-06-06 73 a189d28e Ruud Derwig 2016-06-06 74 encoder = devm_kzalloc(drm->dev, sizeof(*encoder), GFP_KERNEL); a189d28e Ruud Derwig 2016-06-06 75 if (encoder == NULL) a189d28e Ruud Derwig 2016-06-06 76 return -ENOMEM; a189d28e Ruud Derwig 2016-06-06 77 70fbd4a0 Daniel Vetter 2018-01-17 78 encoder->possible_crtcs = 1; 70fbd4a0 Daniel Vetter 2018-01-17 79 encoder->possible_clones = 0; a189d28e Ruud Derwig 2016-06-06 80 70fbd4a0 Daniel Vetter 2018-01-17 81 ret = drm_encoder_init(drm, encoder, &arcpgu_drm_encoder_funcs, a189d28e Ruud Derwig 2016-06-06 82 DRM_MODE_ENCODER_VIRTUAL, NULL); a189d28e Ruud Derwig 2016-06-06 83 if (ret) a189d28e Ruud Derwig 2016-06-06 84 return ret; a189d28e Ruud Derwig 2016-06-06 85 a189d28e Ruud Derwig 2016-06-06 86 arcpgu_connector = devm_kzalloc(drm->dev, sizeof(*arcpgu_connector), a189d28e Ruud Derwig 2016-06-06 87 GFP_KERNEL); a189d28e Ruud Derwig 2016-06-06 88 if (!arcpgu_connector) { a189d28e Ruud Derwig 2016-06-06 89 ret = -ENOMEM; a189d28e Ruud Derwig 2016-06-06 90 goto error_encoder_cleanup; a189d28e Ruud Derwig 2016-06-06 91 } a189d28e Ruud Derwig 2016-06-06 92 a189d28e Ruud Derwig 2016-06-06 93 connector = &arcpgu_connector->connector; a189d28e Ruud Derwig 2016-06-06 94 drm_connector_helper_add(connector, &arcpgu_drm_connector_helper_funcs); a189d28e Ruud Derwig 2016-06-06 95 a189d28e Ruud Derwig 2016-06-06 96 ret = drm_connector_init(drm, connector, &arcpgu_drm_connector_funcs, a189d28e Ruud Derwig 2016-06-06 97 DRM_MODE_CONNECTOR_VIRTUAL); a189d28e Ruud Derwig 2016-06-06 98 if (ret < 0) { a189d28e Ruud Derwig 2016-06-06 99 dev_err(drm->dev, "failed to initialize drm connector\n"); a189d28e Ruud Derwig 2016-06-06 100 goto error_encoder_cleanup; a189d28e Ruud Derwig 2016-06-06 101 } a189d28e Ruud Derwig 2016-06-06 102 70fbd4a0 Daniel Vetter 2018-01-17 103 ret = drm_mode_connector_attach_encoder(connector, encoder); a189d28e Ruud Derwig 2016-06-06 104 if (ret < 0) { a189d28e Ruud Derwig 2016-06-06 105 dev_err(drm->dev, "could not attach connector to encoder\n"); a189d28e Ruud Derwig 2016-06-06 106 drm_connector_unregister(connector); a189d28e Ruud Derwig 2016-06-06 107 goto error_connector_cleanup; a189d28e Ruud Derwig 2016-06-06 108 } a189d28e Ruud Derwig 2016-06-06 109 a189d28e Ruud Derwig 2016-06-06 110 return 0; a189d28e Ruud Derwig 2016-06-06 111 a189d28e Ruud Derwig 2016-06-06 112 error_connector_cleanup: a189d28e Ruud Derwig 2016-06-06 113 drm_connector_cleanup(connector); a189d28e Ruud Derwig 2016-06-06 114 a189d28e Ruud Derwig 2016-06-06 115 error_encoder_cleanup: a189d28e Ruud Derwig 2016-06-06 @116 drm_encoder_cleanup(&encoder->base);
:::::: The code at line 116 was first introduced by commit :::::: a189d28e5edea70f20995547ddc84c79b2f76c03 drm/arcpgu: Make ARC PGU usable on simulation platforms
:::::: TO: Ruud Derwig rderwig@synopsys.com :::::: CC: Alexey Brodkin abrodkin@synopsys.com
--- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
Hi Daniel,
I love your patch! Perhaps something to improve:
[auto build test WARNING on drm/drm-next] [also build test WARNING on v4.15-rc8 next-20180119] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Daniel-Vetter/drm-arcpgu-remove-drm... base: git://people.freedesktop.org/~airlied/linux.git drm-next reproduce: # apt-get install sparse make ARCH=x86_64 allmodconfig make C=1 CF=-D__CHECK_ENDIAN__
sparse warnings: (new ones prefixed by >>)
drivers/gpu/drm/arc/arcpgu_sim.c:116:30: sparse: incorrect type in argument 1 (different base types) @@ expected struct drm_encoder @@ got strustruct drm_encoder @@
drivers/gpu/drm/arc/arcpgu_sim.c:116:30: expected struct drm_encoder drivers/gpu/drm/arc/arcpgu_sim.c:116:30: got struct drm_mode_object drivers/gpu/drm/arc/arcpgu_sim.c: In function 'arcpgu_drm_sim_init': drivers/gpu/drm/arc/arcpgu_sim.c:116:22: error: passing argument 1 of 'drm_encoder_cleanup' from incompatible pointer type drm_encoder_cleanup(&encoder->base); ^ In file included from include/drm/drm_modeset_helper_vtables.h:33:0, from include/drm/drm_crtc_helper.h:43, from drivers/gpu/drm/arc/arcpgu_sim.c:17: include/drm/drm_encoder.h:232:6: note: expected 'struct drm_encoder but argument is of type 'struct drm_mode_object void drm_encoder_cleanup(struct drm_encoder ^~~~~~~~~~~~~~~~~~~ cc1: some warnings being treated as errors
vim +116 drivers/gpu/drm/arc/arcpgu_sim.c
a189d28e Ruud Derwig 2016-06-06 66 a189d28e Ruud Derwig 2016-06-06 67 int arcpgu_drm_sim_init(struct drm_device *drm, struct device_node *np) a189d28e Ruud Derwig 2016-06-06 68 { a189d28e Ruud Derwig 2016-06-06 69 struct arcpgu_drm_connector *arcpgu_connector; 70fbd4a0 Daniel Vetter 2018-01-17 70 struct drm_encoder *encoder; a189d28e Ruud Derwig 2016-06-06 71 struct drm_connector *connector; a189d28e Ruud Derwig 2016-06-06 72 int ret; a189d28e Ruud Derwig 2016-06-06 73 a189d28e Ruud Derwig 2016-06-06 74 encoder = devm_kzalloc(drm->dev, sizeof(*encoder), GFP_KERNEL); a189d28e Ruud Derwig 2016-06-06 75 if (encoder == NULL) a189d28e Ruud Derwig 2016-06-06 76 return -ENOMEM; a189d28e Ruud Derwig 2016-06-06 77 70fbd4a0 Daniel Vetter 2018-01-17 78 encoder->possible_crtcs = 1; 70fbd4a0 Daniel Vetter 2018-01-17 79 encoder->possible_clones = 0; a189d28e Ruud Derwig 2016-06-06 80 70fbd4a0 Daniel Vetter 2018-01-17 81 ret = drm_encoder_init(drm, encoder, &arcpgu_drm_encoder_funcs, a189d28e Ruud Derwig 2016-06-06 82 DRM_MODE_ENCODER_VIRTUAL, NULL); a189d28e Ruud Derwig 2016-06-06 83 if (ret) a189d28e Ruud Derwig 2016-06-06 84 return ret; a189d28e Ruud Derwig 2016-06-06 85 a189d28e Ruud Derwig 2016-06-06 86 arcpgu_connector = devm_kzalloc(drm->dev, sizeof(*arcpgu_connector), a189d28e Ruud Derwig 2016-06-06 87 GFP_KERNEL); a189d28e Ruud Derwig 2016-06-06 88 if (!arcpgu_connector) { a189d28e Ruud Derwig 2016-06-06 89 ret = -ENOMEM; a189d28e Ruud Derwig 2016-06-06 90 goto error_encoder_cleanup; a189d28e Ruud Derwig 2016-06-06 91 } a189d28e Ruud Derwig 2016-06-06 92 a189d28e Ruud Derwig 2016-06-06 93 connector = &arcpgu_connector->connector; a189d28e Ruud Derwig 2016-06-06 94 drm_connector_helper_add(connector, &arcpgu_drm_connector_helper_funcs); a189d28e Ruud Derwig 2016-06-06 95 a189d28e Ruud Derwig 2016-06-06 96 ret = drm_connector_init(drm, connector, &arcpgu_drm_connector_funcs, a189d28e Ruud Derwig 2016-06-06 97 DRM_MODE_CONNECTOR_VIRTUAL); a189d28e Ruud Derwig 2016-06-06 98 if (ret < 0) { a189d28e Ruud Derwig 2016-06-06 99 dev_err(drm->dev, "failed to initialize drm connector\n"); a189d28e Ruud Derwig 2016-06-06 100 goto error_encoder_cleanup; a189d28e Ruud Derwig 2016-06-06 101 } a189d28e Ruud Derwig 2016-06-06 102 70fbd4a0 Daniel Vetter 2018-01-17 103 ret = drm_mode_connector_attach_encoder(connector, encoder); a189d28e Ruud Derwig 2016-06-06 104 if (ret < 0) { a189d28e Ruud Derwig 2016-06-06 105 dev_err(drm->dev, "could not attach connector to encoder\n"); a189d28e Ruud Derwig 2016-06-06 106 drm_connector_unregister(connector); a189d28e Ruud Derwig 2016-06-06 107 goto error_connector_cleanup; a189d28e Ruud Derwig 2016-06-06 108 } a189d28e Ruud Derwig 2016-06-06 109 a189d28e Ruud Derwig 2016-06-06 110 return 0; a189d28e Ruud Derwig 2016-06-06 111 a189d28e Ruud Derwig 2016-06-06 112 error_connector_cleanup: a189d28e Ruud Derwig 2016-06-06 113 drm_connector_cleanup(connector); a189d28e Ruud Derwig 2016-06-06 114 a189d28e Ruud Derwig 2016-06-06 115 error_encoder_cleanup: a189d28e Ruud Derwig 2016-06-06 @116 drm_encoder_cleanup(&encoder->base);
:::::: The code at line 116 was first introduced by commit :::::: a189d28e5edea70f20995547ddc84c79b2f76c03 drm/arcpgu: Make ARC PGU usable on simulation platforms
:::::: TO: Ruud Derwig rderwig@synopsys.com :::::: CC: Alexey Brodkin abrodkin@synopsys.com
--- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
dri-devel@lists.freedesktop.org