Skip to contentSkip to conversation

drm/cirrus: Don't pretend to operate hardware

PATCH In review Thomas Zimmermann 3 participants 9 messages Oct 29, 2024 – Nov 25, 2024

Subsystems (4)
lore
Share & tools
lore

Thomas Zimmermann

author maintainer
#0 lore raw

cover drm/cirrus: Don't pretend to operate hardware

The cirrus driver is only for qemu's emulation of that hardware. The two patches in this series update cirrus to reflect this.

(The driver is still obsolete. Use something else if possible.)

Thomas Zimmermann (2):
drm/cirrus: Use virtual encoder and connector types drm/cirrus: Rename to cirrus-qemu

 MAINTAINERS                                      | 2 +-
 drivers/gpu/drm/tiny/Makefile                    | 2 +-
 drivers/gpu/drm/tiny/{cirrus.c => cirrus-qemu.c} | 6 +++---
 3 files changed, 5 insertions(+), 5 deletions(-)
 rename drivers/gpu/drm/tiny/{cirrus.c => cirrus-qemu.c} (99%)
Signature · 1 line
2.46.0
author maintainer
#1 lore raw

PATCH 1/2 drm/cirrus: Use virtual encoder and connector types

The cirrus driver only works on emulated Cirrus hardware. Use the correct types for encoder and connector.

---
 drivers/gpu/drm/tiny/cirrus.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/tiny/cirrus.c +2 -2
index f06a2be71f60..0231bdf94b8a 100644
@@ -587,14 +587,14 @@ static int cirrus_pipe_init(struct cirrus_device *cirrus)
 
 	encoder = &cirrus->encoder;
 	ret = drm_encoder_init(dev, encoder, &cirrus_encoder_funcs,
-			       DRM_MODE_ENCODER_DAC, NULL);
+			       DRM_MODE_ENCODER_VIRTUAL, NULL);
 	if (ret)
 		return ret;
 	encoder->possible_crtcs = drm_crtc_mask(crtc);
 
 	connector = &cirrus->connector;
 	ret = drm_connector_init(dev, connector, &cirrus_connector_funcs,
-				 DRM_MODE_CONNECTOR_VGA);
+				 DRM_MODE_CONNECTOR_VIRTUAL);
 	if (ret)
 		return ret;
 	drm_connector_helper_add(connector, &cirrus_connector_helper_funcs);
Signature · 1 line
2.46.0
#2 lore raw

Re: [PATCH 1/2] drm/cirrus: Use virtual encoder and connector types

Quoted 16 lines · Thomas Zimmermann

The cirrus driver only works on emulated Cirrus hardware. Use the correct types for encoder and connector.

---
 drivers/gpu/drm/tiny/cirrus.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/tiny/cirrus.c +0 -0
index f06a2be71f60..0231bdf94b8a 100644
@@ -587,14 +587,14 @@ static int cirrus_pipe_init(struct cirrus_device *cirrus)
 
 	encoder = &cirrus->encoder;
 	ret = drm_encoder_init(dev, encoder, &cirrus_encoder_funcs,

drivers/gpu/drm/tiny/cirrus.c static int cirrus_pipe_init(struct cirrus_device *cirrus) · line 597

Quoted 10 lines
drivers/gpu/drm/tiny/cirrus.c +2 -2
-			       DRM_MODE_ENCODER_DAC, NULL);
+			       DRM_MODE_ENCODER_VIRTUAL, NULL);
 	if (ret)
 		return ret;
 	encoder->possible_crtcs = drm_crtc_mask(crtc);
 
 	connector = &cirrus->connector;
 	ret = drm_connector_init(dev, connector, &cirrus_connector_funcs,
-				 DRM_MODE_CONNECTOR_VGA);
+				 DRM_MODE_CONNECTOR_VIRTUAL);

This will also remove the EDID property from this connector. I'm not sore if that is an expected behaviour or not.

Quoted 6 lines
drivers/gpu/drm/tiny/cirrus.c +0 -0
 	if (ret)
 		return ret;
 	drm_connector_helper_add(connector, &cirrus_connector_helper_funcs);
Signature · 1 line
2.46.0
Signature · 2 lines
With best wishes
Dmitry
author maintainer
#3 lore raw

Re: [PATCH 1/2] drm/cirrus: Use virtual encoder and connector types

Hi

Am 23.11.24 um 17:28 schrieb Dmitry Baryshkov:

Quoted 23 lines · Thomas Zimmermann
Quoted 22 lines

The cirrus driver only works on emulated Cirrus hardware. Use the correct types for encoder and connector.

---
  drivers/gpu/drm/tiny/cirrus.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/tiny/cirrus.c +1 -1
index f06a2be71f60..0231bdf94b8a 100644
@@ -587,14 +587,14 @@ static int cirrus_pipe_init(struct cirrus_device *cirrus)
 
  	encoder = &cirrus->encoder;
  	ret = drm_encoder_init(dev, encoder, &cirrus_encoder_funcs,
-			       DRM_MODE_ENCODER_DAC, NULL);
+			       DRM_MODE_ENCODER_VIRTUAL, NULL);
  	if (ret)
  		return ret;
  	encoder->possible_crtcs = drm_crtc_mask(crtc);
 
Quoted 6 lines

drivers/gpu/drm/tiny/cirrus.c static int cirrus_pipe_init(struct cirrus_device *cirrus) · line 597

Quoted 4 lines
drivers/gpu/drm/tiny/cirrus.c +1 -1
  	connector = &cirrus->connector;
  	ret = drm_connector_init(dev, connector, &cirrus_connector_funcs,
-				 DRM_MODE_CONNECTOR_VGA);
+				 DRM_MODE_CONNECTOR_VIRTUAL);

This will also remove the EDID property from this connector. I'm not sore if that is an expected behaviour or not.

Indeed. That's a positive side effect IMHO. The cirrus emulation nor driver provides an EDID. By removing the property, we stop pretending that there could be one. I'll mention this in the changelog before committing.

Best regards
Thomas

Quoted 7 lines
Quoted 7 lines
drivers/gpu/drm/tiny/cirrus.c +0 -0
  	if (ret)
  		return ret;
  	drm_connector_helper_add(connector, &cirrus_connector_helper_funcs);
Signature · 1 line
2.46.0
Signature · 7 lines
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)
maintainer
#4 lore raw

Re: [PATCH 1/2] drm/cirrus: Use virtual encoder and connector types

In reply to Dmitry Baryshkov
Quoted 11 lines · Dmitry Baryshkov

drivers/gpu/drm/tiny/cirrus.c static int cirrus_pipe_init(struct cirrus_device *cirrus) · line 597

Quoted 7 lines · Thomas Zimmermann

The cirrus driver only works on emulated Cirrus hardware. Use the correct types for encoder and connector.

drivers/gpu/drm/tiny/cirrus.c +1 -1
 	connector = &cirrus->connector;
 	ret = drm_connector_init(dev, connector, &cirrus_connector_funcs,
-				 DRM_MODE_CONNECTOR_VGA);
+				 DRM_MODE_CONNECTOR_VIRTUAL);

This will also remove the EDID property from this connector. I'm not sore if that is an expected behaviour or not.

Well, the qemu cirrus emulation does not actually provide an EDID, so this is probably a good thing (even if possibly not intentional).

take care,
Gerd

author maintainer
#5 lore raw

PATCH 2/2 drm/cirrus: Rename to cirrus-qemu

In reply to Thomas Zimmermann

This driver is only for Qemu's emulated Cirrus hardware. Name it accordingly.

---
 MAINTAINERS                                      | 2 +-
 drivers/gpu/drm/tiny/Makefile                    | 2 +-
 drivers/gpu/drm/tiny/{cirrus.c => cirrus-qemu.c} | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
 rename drivers/gpu/drm/tiny/{cirrus.c => cirrus-qemu.c} (99%)
MAINTAINERS +1 -1
index ccf87fa14cf7..33ba56fe322c 100644
@@ -7312,7 +7312,7 @@ L:	[email protected]
 S:	Obsolete
 W:	https://www.kraxel.org/blog/2014/10/qemu-using-cirrus-considered-harmful/
 T:	git https://gitlab.freedesktop.org/drm/misc/kernel.git
-F:	drivers/gpu/drm/tiny/cirrus.c
+F:	drivers/gpu/drm/tiny/cirrus-qemu.c
 
 DRM DRIVER FOR QXL VIRTUAL GPU
 M:	Dave Airlie <[email protected]>
drivers/gpu/drm/tiny/Makefile +1 -1
index 4aaf56f8707d..60816d2eb4ff 100644
@@ -2,7 +2,7 @@
 
 obj-$(CONFIG_DRM_ARCPGU)		+= arcpgu.o
 obj-$(CONFIG_DRM_BOCHS)			+= bochs.o
-obj-$(CONFIG_DRM_CIRRUS_QEMU)		+= cirrus.o
+obj-$(CONFIG_DRM_CIRRUS_QEMU)		+= cirrus-qemu.o
 obj-$(CONFIG_DRM_GM12U320)		+= gm12u320.o
 obj-$(CONFIG_DRM_OFDRM)			+= ofdrm.o
 obj-$(CONFIG_DRM_PANEL_MIPI_DBI)	+= panel-mipi-dbi.o
drivers/gpu/drm/tiny/cirrus-qemu.c renamed from drivers/gpu/drm/tiny/cirrus.c +1 -1
similarity index 99%
rename from drivers/gpu/drm/tiny/cirrus.c
rename to drivers/gpu/drm/tiny/cirrus-qemu.c
index 0231bdf94b8a..eaae559dc431 100644
@@ -46,7 +46,7 @@
 #include <drm/drm_module.h>
 #include <drm/drm_probe_helper.h>
 
-#define DRIVER_NAME "cirrus"
+#define DRIVER_NAME "cirrus-qemu"
 #define DRIVER_DESC "qemu cirrus vga"
 #define DRIVER_DATE "2019"
 #define DRIVER_MAJOR 2
Signature · 1 line
2.46.0
author maintainer
#6 lore raw
In reply to Thomas Zimmermann

ping

Am 29.10.24 um 15:34 schrieb Thomas Zimmermann:

Quoted 15 lines

The cirrus driver is only for qemu's emulation of that hardware. The two patches in this series update cirrus to reflect this.

(The driver is still obsolete. Use something else if possible.)

Thomas Zimmermann (2):
drm/cirrus: Use virtual encoder and connector types drm/cirrus: Rename to cirrus-qemu

  MAINTAINERS                                      | 2 +-
  drivers/gpu/drm/tiny/Makefile                    | 2 +-
  drivers/gpu/drm/tiny/{cirrus.c => cirrus-qemu.c} | 6 +++---
  3 files changed, 5 insertions(+), 5 deletions(-)

rename drivers/gpu/drm/tiny/{cirrus.c => cirrus-qemu.c} (99%)

Signature · 7 lines
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)
author maintainer
#7 lore raw
In reply to Thomas Zimmermann

ping ping

Am 29.10.24 um 15:34 schrieb Thomas Zimmermann:

Quoted 15 lines

The cirrus driver is only for qemu's emulation of that hardware. The two patches in this series update cirrus to reflect this.

(The driver is still obsolete. Use something else if possible.)

Thomas Zimmermann (2):
drm/cirrus: Use virtual encoder and connector types drm/cirrus: Rename to cirrus-qemu

  MAINTAINERS                                      | 2 +-
  drivers/gpu/drm/tiny/Makefile                    | 2 +-
  drivers/gpu/drm/tiny/{cirrus.c => cirrus-qemu.c} | 6 +++---
  3 files changed, 5 insertions(+), 5 deletions(-)

rename drivers/gpu/drm/tiny/{cirrus.c => cirrus-qemu.c} (99%)

Signature · 7 lines
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)
maintainer Acked-by
#8 lore raw
Quoted 4 lines · Thomas Zimmermann

ping ping

Quoted 2 lines

drm/cirrus: Use virtual encoder and connector types drm/cirrus: Rename to cirrus-qemu

Hmm, matter of taste. I would not have invested that effort, but I have no objections either. So:

take care,
Gerd