Skip to contentSkip to conversation

drm/udl: Convert to simple-pipe helpers and clean up

PATCH New Thomas Zimmermann 1 participant 10 messages Dec 10, 2019

Subsystems (3)
lore
Share & tools
lore

Thomas Zimmermann

author maintainer
#0 lore raw

v3 cover drm/udl: Convert to simple-pipe helpers and clean up

With only a single display pipeline and primary plane, udl is perfect for simple-pipe helpers. Patches 1 to 4 do the convertion. This enables atomic modesetting for udl devices.

Patches 5 to 8 clean up handling of color depth and framebuffers. With universal planes that come with simple pipe, display updates can be implemented with DRM's damage handlers. The primary plane's formats array allows to export the correct preferred color depth. The original value was choosen for maximum compatibility, but did not represent the device's capability.

Patch 9 removes udl's remaining, unused fb code.

The patchset has been tested by running the fb console, X11 and Weston on a DisplayLink adapter. Posting v3 for (hopefully) final comments.

v3:
* use symbolic names for blanking ops
* cosmetic changes
v2:
* rebased on the recent udl damage-handler patchset
* moved atomic suspend/resume conversion into separate patch
* don't call drm_connector_{register,unregister}()

Thomas Zimmermann (9):
drm/udl: Init connector before encoder and CRTC drm/udl: Convert to struct drm_simple_display_pipe drm/udl: Switch to atomic suspend/resume helpers drm/udl: Inline DPMS code into CRTC enable and disable functions drm/udl: Set preferred color depth to 16 bpp
drm/udl: Convert to drm_atomic_helper_dirtyfb() drm/udl: Remove struct udl_device.active_fb_16 drm/udl: Move udl_handle_damage() into udl_modeset.c drm/udl: Remove udl_fb.c

 drivers/gpu/drm/udl/Makefile        |   2 +-
 drivers/gpu/drm/udl/udl_connector.c |  21 +-
 drivers/gpu/drm/udl/udl_drv.c       |  11 +-
 drivers/gpu/drm/udl/udl_drv.h       |  29 +--
 drivers/gpu/drm/udl/udl_encoder.c   |  70 ------
 drivers/gpu/drm/udl/udl_fb.c        | 222 -----------------
 drivers/gpu/drm/udl/udl_main.c      |   3 -
 drivers/gpu/drm/udl/udl_modeset.c   | 369 ++++++++++++++++------------
 8 files changed, 238 insertions(+), 489 deletions(-)
 delete mode 100644 drivers/gpu/drm/udl/udl_encoder.c
 delete mode 100644 drivers/gpu/drm/udl/udl_fb.c

--
2.24.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

author maintainer
#1 lore raw

PATCH v3 1/9 drm/udl: Init connector before encoder and CRTC

To mimic simple-pipe, we initialize the connector before the rest of the display pipeline.

v2:
* remove unnecessary calls to drm_connector_{register,unregister}()

---
 drivers/gpu/drm/udl/udl_connector.c |  9 +++------
 drivers/gpu/drm/udl/udl_drv.h       |  2 +-
 drivers/gpu/drm/udl/udl_modeset.c   | 16 ++++++++++++++--
 3 files changed, 18 insertions(+), 9 deletions(-)
drivers/gpu/drm/udl/udl_connector.c +3 -6
index b4ae3e89a7b4..b1d2f38e37e0 100644
@@ -104,7 +104,6 @@ static void udl_connector_destroy(struct drm_connector *connector)
 					struct udl_drm_connector,
 					connector);
 
-	drm_connector_unregister(connector);
 	drm_connector_cleanup(connector);
 	kfree(udl_connector->edid);
 	kfree(connector);
@@ -123,24 +122,22 @@ static const struct drm_connector_funcs udl_connector_funcs = {
 	.set_property = udl_connector_set_property,
 };
 
-int udl_connector_init(struct drm_device *dev, struct drm_encoder *encoder)
+struct drm_connector *udl_connector_init(struct drm_device *dev)
 {
 	struct udl_drm_connector *udl_connector;
 	struct drm_connector *connector;
 
 	udl_connector = kzalloc(sizeof(struct udl_drm_connector), GFP_KERNEL);
 	if (!udl_connector)
-		return -ENOMEM;
+		return ERR_PTR(-ENOMEM);
 
 	connector = &udl_connector->connector;
 	drm_connector_init(dev, connector, &udl_connector_funcs,
 			   DRM_MODE_CONNECTOR_DVII);
 	drm_connector_helper_add(connector, &udl_connector_helper_funcs);
 
-	drm_connector_register(connector);
-	drm_connector_attach_encoder(connector, encoder);
 	connector->polled = DRM_CONNECTOR_POLL_HPD |
 		DRM_CONNECTOR_POLL_CONNECT | DRM_CONNECTOR_POLL_DISCONNECT;
 
-	return 0;
+	return connector;
 }
drivers/gpu/drm/udl/udl_drv.h +1 -1
index 4de00bddef39..e6a669f6f204 100644
@@ -73,7 +73,7 @@ struct udl_device {
 int udl_modeset_init(struct drm_device *dev);
 void udl_modeset_restore(struct drm_device *dev);
 void udl_modeset_cleanup(struct drm_device *dev);
-int udl_connector_init(struct drm_device *dev, struct drm_encoder *encoder);
+struct drm_connector *udl_connector_init(struct drm_device *dev);
 
 struct drm_encoder *udl_encoder_init(struct drm_device *dev);
 
drivers/gpu/drm/udl/udl_modeset.c +14 -2
index 91af25caed64..5bb1522036c7 100644
@@ -421,7 +421,10 @@ static const struct drm_mode_config_funcs udl_mode_funcs = {
 
 int udl_modeset_init(struct drm_device *dev)
 {
+	struct drm_connector *connector;
 	struct drm_encoder *encoder;
+	int ret;
+
 	drm_mode_config_init(dev);
 
 	dev->mode_config.min_width = 640;
@@ -435,13 +438,22 @@ int udl_modeset_init(struct drm_device *dev)
 
 	dev->mode_config.funcs = &udl_mode_funcs;
 
+	connector = udl_connector_init(dev);
+	if (IS_ERR(connector)) {
+		ret = PTR_ERR(connector);
+		goto err_drm_mode_config_cleanup;
+	}
+
 	udl_crtc_init(dev);
 
 	encoder = udl_encoder_init(dev);
-
-	udl_connector_init(dev, encoder);
+	drm_connector_attach_encoder(connector, encoder);
 
 	return 0;
+
+err_drm_mode_config_cleanup:
+	drm_mode_config_cleanup(dev);
+	return ret;
 }
 
 void udl_modeset_restore(struct drm_device *dev)
Signature · 6 lines
2.24.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author maintainer
#2 lore raw

PATCH v3 2/9 drm/udl: Convert to struct drm_simple_display_pipe

In reply to Thomas Zimmermann

Udl has a single display pipeline with a primary plane; perfect for simple-pipe helpers. Convert it over. The old encoder and CRTC code becomes unused and obsolete.

Exported formats for the primary plane are RGB565 and XRGB8888, with the latter being emulated. The 16-bit format is the default and what is used when communicating with the device.

This patch enables atomic modesetting for udl devices.

v3:
* remove unused field crtc from struct udl_device
* set crtc_state->no_vblank at beginning of enable()
v2:
* move suspend/resume changes into separate patch
* remove non-atomic code

---
 drivers/gpu/drm/udl/Makefile        |   2 +-
 drivers/gpu/drm/udl/udl_connector.c |  12 +-
 drivers/gpu/drm/udl/udl_drv.c       |   2 +-
 drivers/gpu/drm/udl/udl_drv.h       |   7 +-
 drivers/gpu/drm/udl/udl_encoder.c   |  70 ------------
 drivers/gpu/drm/udl/udl_modeset.c   | 170 +++++++++++++---------------
 6 files changed, 86 insertions(+), 177 deletions(-)
 delete mode 100644 drivers/gpu/drm/udl/udl_encoder.c
drivers/gpu/drm/udl/Makefile +1 -1
index 9c42820ae33d..177ce74f4cf4 100644
@@ -1,4 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0-only
-udl-y := udl_drv.o udl_modeset.o udl_connector.o udl_encoder.o udl_main.o udl_fb.o udl_transfer.o udl_gem.o
+udl-y := udl_drv.o udl_modeset.o udl_connector.o udl_main.o udl_fb.o udl_transfer.o udl_gem.o
 
 obj-$(CONFIG_DRM_UDL) := udl.o
drivers/gpu/drm/udl/udl_connector.c +4 -8
index b1d2f38e37e0..e9671d38b4a0 100644
@@ -7,6 +7,7 @@
  * Copyright (C) 2009 Bernie Thompson <[email protected]>
  */
 
+#include <drm/drm_atomic_state_helper.h>
 #include <drm/drm_crtc_helper.h>
 #include <drm/drm_probe_helper.h>
 
@@ -90,13 +91,6 @@ udl_detect(struct drm_connector *connector, bool force)
 	return connector_status_connected;
 }
 
-static int udl_connector_set_property(struct drm_connector *connector,
-				      struct drm_property *property,
-				      uint64_t val)
-{
-	return 0;
-}
-
 static void udl_connector_destroy(struct drm_connector *connector)
 {
 	struct udl_drm_connector *udl_connector =
@@ -116,10 +110,12 @@ static const struct drm_connector_helper_funcs udl_connector_helper_funcs = {
 
 static const struct drm_connector_funcs udl_connector_funcs = {
 	.dpms = drm_helper_connector_dpms,
+	.reset = drm_atomic_helper_connector_reset,
 	.detect = udl_detect,
 	.fill_modes = drm_helper_probe_single_connector_modes,
 	.destroy = udl_connector_destroy,
-	.set_property = udl_connector_set_property,
+	.atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
+	.atomic_destroy_state   = drm_atomic_helper_connector_destroy_state,
 };
 
 struct drm_connector *udl_connector_init(struct drm_device *dev)
drivers/gpu/drm/udl/udl_drv.c +1 -1
index d5783fa32c5b..aeb96920757c 100644
@@ -45,7 +45,7 @@ static void udl_driver_release(struct drm_device *dev)
 }
 
 static struct drm_driver driver = {
-	.driver_features = DRIVER_MODESET | DRIVER_GEM,
+	.driver_features = DRIVER_ATOMIC | DRIVER_GEM | DRIVER_MODESET,
 	.release = udl_driver_release,
 
 	/* gem hooks */
drivers/gpu/drm/udl/udl_drv.h +3 -4
index e6a669f6f204..c7f32c41f649 100644
@@ -17,8 +17,8 @@
 #include <drm/drm_device.h>
 #include <drm/drm_framebuffer.h>
 #include <drm/drm_gem.h>
+#include <drm/drm_simple_kms_helper.h>
 
-struct drm_encoder;
 struct drm_mode_create_dumb;
 
 #define DRIVER_NAME		"udl"
@@ -51,7 +51,8 @@ struct udl_device {
 	struct drm_device drm;
 	struct device *dev;
 	struct usb_device *udev;
-	struct drm_crtc *crtc;
+
+	struct drm_simple_display_pipe display_pipe;
 
 	/* active framebuffer on the 16-bit channel */
 	const struct drm_framebuffer *active_fb_16;
@@ -75,8 +76,6 @@ void udl_modeset_restore(struct drm_device *dev);
 void udl_modeset_cleanup(struct drm_device *dev);
 struct drm_connector *udl_connector_init(struct drm_device *dev);
 
-struct drm_encoder *udl_encoder_init(struct drm_device *dev);
-
 struct urb *udl_get_urb(struct drm_device *dev);
 
 int udl_submit_urb(struct drm_device *dev, struct urb *urb, size_t len);
drivers/gpu/drm/udl/udl_encoder.c deleted +0 -70

70 lines not on this page · raw message

drivers/gpu/drm/udl/udl_modeset.c +77 -93

258 lines not on this page · raw message

Signature · 6 lines
2.24.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author maintainer
#3 lore raw

PATCH v3 3/9 drm/udl: Switch to atomic suspend/resume helpers

In reply to Thomas Zimmermann

We can use the generic suspend/resume helpers for atomic modesetting. Switch udl over.

---
 drivers/gpu/drm/udl/udl_drv.c     |  7 ++-----
 drivers/gpu/drm/udl/udl_drv.h     |  1 -
 drivers/gpu/drm/udl/udl_modeset.c | 14 --------------
 3 files changed, 2 insertions(+), 20 deletions(-)
drivers/gpu/drm/udl/udl_drv.c +2 -5
index aeb96920757c..b3fa6bf41acc 100644
@@ -21,17 +21,14 @@ static int udl_usb_suspend(struct usb_interface *interface,
 {
 	struct drm_device *dev = usb_get_intfdata(interface);
 
-	drm_kms_helper_poll_disable(dev);
-	return 0;
+	return drm_mode_config_helper_suspend(dev);
 }
 
 static int udl_usb_resume(struct usb_interface *interface)
 {
 	struct drm_device *dev = usb_get_intfdata(interface);
 
-	drm_kms_helper_poll_enable(dev);
-	udl_modeset_restore(dev);
-	return 0;
+	return drm_mode_config_helper_resume(dev);
 }
 
 DEFINE_DRM_GEM_FOPS(udl_driver_fops);
drivers/gpu/drm/udl/udl_drv.h +0 -1
index c7f32c41f649..e98d70487eab 100644
@@ -72,7 +72,6 @@ struct udl_device {
 
 /* modeset */
 int udl_modeset_init(struct drm_device *dev);
-void udl_modeset_restore(struct drm_device *dev);
 void udl_modeset_cleanup(struct drm_device *dev);
 struct drm_connector *udl_connector_init(struct drm_device *dev);
 
drivers/gpu/drm/udl/udl_modeset.c +0 -14
index 36b7844e8cf4..cde6b7ff9599 100644
@@ -438,20 +438,6 @@ int udl_modeset_init(struct drm_device *dev)
 	return ret;
 }
 
-void udl_modeset_restore(struct drm_device *dev)
-{
-	struct udl_device *udl = dev->dev_private;
-	struct drm_crtc *crtc = &udl->display_pipe.crtc;
-	struct drm_plane *primary = &udl->display_pipe.plane;
-	struct drm_framebuffer *fb = primary->fb;
-
-	if (!fb)
-		return;
-
-	udl_crtc_dpms(crtc, DRM_MODE_DPMS_ON);
-	udl_handle_damage(fb, 0, 0, fb->width, fb->height);
-}
-
 void udl_modeset_cleanup(struct drm_device *dev)
 {
 	drm_mode_config_cleanup(dev);
Signature · 6 lines
2.24.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author maintainer
#4 lore raw

PATCH v3 4/9 drm/udl: Inline DPMS code into CRTC enable and disable functions

In reply to Thomas Zimmermann

DPMS functionality is only used by the CRTC's enable and disable functions. Inline the code. The patch also adds symbolic constants for the blank regsiter and constants; accoding to udlfb, which is a bit more detailed than DRM's udl.

v3:
* use symbolic constants for blank, according to udlfb driver

---
 drivers/gpu/drm/udl/udl_drv.h     |  9 ++++
 drivers/gpu/drm/udl/udl_modeset.c | 88 ++++++++++---------------------
 2 files changed, 38 insertions(+), 59 deletions(-)
drivers/gpu/drm/udl/udl_drv.h +9 -0
index e98d70487eab..89c0539c758e 100644
@@ -110,4 +110,13 @@ int udl_drop_usb(struct drm_device *dev);
 #define CMD_WRITE_COPY16 "\xAF\x6A" /**< 16 bit copy command. */
 #define CMD_WRITE_RLX16  "\xAF\x6B" /**< 16 bit extended run length command. */
 
+/* On/Off for driving the DisplayLink framebuffer to the display */
+#define UDL_REG_BLANK_MODE		0x1f
+
+#define UDL_BLANK_MODE_ON		0x00 /* hsync and vsync on, visible */
+#define UDL_BLANK_MODE_BLANKED		0x01 /* hsync and vsync on, blanked */
+#define UDL_BLANK_MODE_VSYNC_OFF	0x03 /* vsync off, blanked */
+#define UDL_BLANK_MODE_HSYNC_OFF	0x05 /* hsync off, blanked */
+#define UDL_BLANK_MODE_POWERDOWN	0x07 /* powered off; requires modeset */
+
 #endif
drivers/gpu/drm/udl/udl_modeset.c +29 -59

124 lines not on this page · raw message

Signature · 6 lines
2.24.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author maintainer
#5 lore raw

PATCH v3 5/9 drm/udl: Set preferred color depth to 16 bpp

In reply to Thomas Zimmermann

The current default color depth of 24 bpp is not even supported by the driver. Being the native format for communicating with the adapter, 16 bpp is the correct choice.

---
 drivers/gpu/drm/udl/udl_drv.c     | 2 +-
 drivers/gpu/drm/udl/udl_modeset.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/udl/udl_drv.c +1 -1
index b3fa6bf41acc..e6c1cd77d4d4 100644
@@ -105,7 +105,7 @@ static int udl_usb_probe(struct usb_interface *interface,
 
 	DRM_INFO("Initialized udl on minor %d\n", udl->drm.primary->index);
 
-	r = drm_fbdev_generic_setup(&udl->drm, 16);
+	r = drm_fbdev_generic_setup(&udl->drm, 0);
 	if (r)
 		goto err_drm_dev_unregister;
 
drivers/gpu/drm/udl/udl_modeset.c +1 -1
index fc7aa8cb8296..943e937837e1 100644
@@ -380,7 +380,7 @@ int udl_modeset_init(struct drm_device *dev)
 	dev->mode_config.max_height = 2048;
 
 	dev->mode_config.prefer_shadow = 0;
-	dev->mode_config.preferred_depth = 24;
+	dev->mode_config.preferred_depth = 16;
 
 	dev->mode_config.funcs = &udl_mode_funcs;
 
Signature · 6 lines
2.24.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author maintainer
#6 lore raw

PATCH v3 6/9 drm/udl: Convert to drm_atomic_helper_dirtyfb()

In reply to Thomas Zimmermann

The infrastruture for atomic modesetting allows us to use the generic code for dirty-FB and damage handling. Switch over udl and remove the driver's implementation. The simple-pipe's update function now picks up the primary plane's damage and updates a minimal region of the screen.

---
 drivers/gpu/drm/udl/udl_drv.h     |  5 ---
 drivers/gpu/drm/udl/udl_fb.c      | 52 -------------------------------
 drivers/gpu/drm/udl/udl_modeset.c | 11 +++++--
 3 files changed, 8 insertions(+), 60 deletions(-)
drivers/gpu/drm/udl/udl_drv.h +0 -5
index 89c0539c758e..1ade917cd8d7 100644
@@ -83,11 +83,6 @@ void udl_urb_completion(struct urb *urb);
 int udl_init(struct udl_device *udl);
 void udl_fini(struct drm_device *dev);
 
-struct drm_framebuffer *
-udl_fb_user_fb_create(struct drm_device *dev,
-		      struct drm_file *file,
-		      const struct drm_mode_fb_cmd2 *mode_cmd);
-
 int udl_render_hline(struct drm_device *dev, int log_bpp, struct urb **urb_ptr,
 		     const char *front, char **urb_buf_ptr,
 		     u32 byte_offset, u32 device_byte_offset, u32 byte_width);
drivers/gpu/drm/udl/udl_fb.c +0 -52

63 lines not on this page · raw message

drivers/gpu/drm/udl/udl_modeset.c +8 -3
index 943e937837e1..75f239e92c89 100644
@@ -11,6 +11,7 @@
 
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_crtc_helper.h>
+#include <drm/drm_damage_helper.h>
 #include <drm/drm_gem_framebuffer_helper.h>
 #include <drm/drm_modeset_helper_vtables.h>
 #include <drm/drm_vblank.h>
@@ -332,7 +333,9 @@ udl_simple_display_pipe_update(struct drm_simple_display_pipe *pipe,
 {
 	struct drm_device *dev = pipe->crtc.dev;
 	struct udl_device *udl = dev->dev_private;
-	struct drm_framebuffer *fb = pipe->plane.state->fb;
+	struct drm_plane_state *state = pipe->plane.state;
+	struct drm_framebuffer *fb = state->fb;
+	struct drm_rect rect;
 
 	spin_lock(&udl->active_fb_16_lock);
 	udl->active_fb_16 = fb;
@@ -341,7 +344,9 @@ udl_simple_display_pipe_update(struct drm_simple_display_pipe *pipe,
 	if (!fb)
 		return;
 
-	udl_handle_damage(fb, 0, 0, fb->width, fb->height);
+	if (drm_atomic_helper_damage_merged(old_plane_state, state, &rect))
+		udl_handle_damage(fb, rect.x1, rect.y1, rect.x2 - rect.x1,
+				  rect.y2 - rect.y1);
 }
 
 static const
@@ -359,7 +364,7 @@ struct drm_simple_display_pipe_funcs udl_simple_display_pipe_funcs = {
  */
 
 static const struct drm_mode_config_funcs udl_mode_funcs = {
-	.fb_create = udl_fb_user_fb_create,
+	.fb_create = drm_gem_fb_create_with_dirty,
 	.atomic_check  = drm_atomic_helper_check,
 	.atomic_commit = drm_atomic_helper_commit,
 };
Signature · 6 lines
2.24.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author maintainer
#7 lore raw

PATCH v3 7/9 drm/udl: Remove struct udl_device.active_fb_16

In reply to Thomas Zimmermann

The udl driver stores the currently active framebuffer to know from where to accept damage updates.

With the conversion to plane-state damage handling, this is not necessary any longer. The currently active framebuffer and damaged area are always stored in the plane state.

---
 drivers/gpu/drm/udl/udl_drv.h     | 4 ----
 drivers/gpu/drm/udl/udl_fb.c      | 8 --------
 drivers/gpu/drm/udl/udl_main.c    | 3 ---
 drivers/gpu/drm/udl/udl_modeset.c | 9 ---------
 4 files changed, 24 deletions(-)
drivers/gpu/drm/udl/udl_drv.h +0 -4
index 1ade917cd8d7..dd58b9a51669 100644
@@ -54,10 +54,6 @@ struct udl_device {
 
 	struct drm_simple_display_pipe display_pipe;
 
-	/* active framebuffer on the 16-bit channel */
-	const struct drm_framebuffer *active_fb_16;
-	spinlock_t active_fb_16_lock;
-
 	struct mutex gem_lock;
 
 	int sku_pixel_limit;
drivers/gpu/drm/udl/udl_fb.c +0 -8
index 98cc2ab3a916..397c62142978 100644
@@ -87,7 +87,6 @@ int udl_handle_damage(struct drm_framebuffer *fb, int x, int y,
 		      int width, int height)
 {
 	struct drm_device *dev = fb->dev;
-	struct udl_device *udl = to_udl(dev);
 	struct dma_buf_attachment *import_attach = fb->obj[0]->import_attach;
 	int i, ret, tmp_ret;
 	char *cmd;
@@ -96,13 +95,6 @@ int udl_handle_damage(struct drm_framebuffer *fb, int x, int y,
 	int log_bpp;
 	void *vaddr;
 
-	spin_lock(&udl->active_fb_16_lock);
-	if (udl->active_fb_16 != fb) {
-		spin_unlock(&udl->active_fb_16_lock);
-		return 0;
-	}
-	spin_unlock(&udl->active_fb_16_lock);
-
 	ret = udl_log_cpp(fb->format->cpp[0]);
 	if (ret < 0)
 		return ret;
drivers/gpu/drm/udl/udl_main.c +0 -3
index ff3e98666e8c..538718919916 100644
@@ -314,9 +314,6 @@ int udl_init(struct udl_device *udl)
 
 	DRM_DEBUG("\n");
 
-	udl->active_fb_16 = NULL;
-	spin_lock_init(&udl->active_fb_16_lock);
-
 	mutex_init(&udl->gem_lock);
 
 	if (!udl_parse_vendor_descriptor(dev, udl->udev)) {
drivers/gpu/drm/udl/udl_modeset.c +0 -9
index 75f239e92c89..deac5e303604 100644
@@ -284,9 +284,6 @@ udl_simple_display_pipe_enable(struct drm_simple_display_pipe *pipe,
 
 	wrptr = udl_dummy_render(wrptr);
 
-	spin_lock(&udl->active_fb_16_lock);
-	udl->active_fb_16 = fb;
-	spin_unlock(&udl->active_fb_16_lock);
 	udl->mode_buf_len = wrptr - buf;
 
 	udl_handle_damage(fb, 0, 0, fb->width, fb->height);
@@ -331,16 +328,10 @@ static void
 udl_simple_display_pipe_update(struct drm_simple_display_pipe *pipe,
 			       struct drm_plane_state *old_plane_state)
 {
-	struct drm_device *dev = pipe->crtc.dev;
-	struct udl_device *udl = dev->dev_private;
 	struct drm_plane_state *state = pipe->plane.state;
 	struct drm_framebuffer *fb = state->fb;
 	struct drm_rect rect;
 
-	spin_lock(&udl->active_fb_16_lock);
-	udl->active_fb_16 = fb;
-	spin_unlock(&udl->active_fb_16_lock);
-
 	if (!fb)
 		return;
 
Signature · 6 lines
2.24.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author maintainer
#8 lore raw

PATCH v3 8/9 drm/udl: Move udl_handle_damage() into udl_modeset.c

In reply to Thomas Zimmermann

The only caller of udl_handle_damage() in the plane-update function in udl_modeset.c. Move udl_handle_damage() there.

v2:
* remove udl_fb.c in a separate patch

---
 drivers/gpu/drm/udl/udl_drv.h     |   3 -
 drivers/gpu/drm/udl/udl_fb.c      | 111 ------------------------------
 drivers/gpu/drm/udl/udl_modeset.c | 111 ++++++++++++++++++++++++++++++
 3 files changed, 111 insertions(+), 114 deletions(-)
drivers/gpu/drm/udl/udl_drv.h +0 -3
index dd58b9a51669..e67227c44cc4 100644
@@ -86,9 +86,6 @@ int udl_render_hline(struct drm_device *dev, int log_bpp, struct urb **urb_ptr,
 struct drm_gem_object *udl_driver_gem_create_object(struct drm_device *dev,
 						    size_t size);
 
-int udl_handle_damage(struct drm_framebuffer *fb, int x, int y,
-		      int width, int height);
-
 int udl_drop_usb(struct drm_device *dev);
 
 #define CMD_WRITE_RAW8   "\xAF\x60" /**< 8 bit raw write command. */
drivers/gpu/drm/udl/udl_fb.c +0 -111

120 lines not on this page · raw message

drivers/gpu/drm/udl/udl_modeset.c +111 -0

127 lines not on this page · raw message

Signature · 6 lines
2.24.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
author maintainer
#9 lore raw

PATCH v3 9/9 drm/udl: Remove udl_fb.c

In reply to Thomas Zimmermann

The remaining code in udl_fb.c is unused. Remove the file entirely.

---
 drivers/gpu/drm/udl/Makefile |  2 +-
 drivers/gpu/drm/udl/udl_fb.c | 51 ------------------------------------
 2 files changed, 1 insertion(+), 52 deletions(-)
 delete mode 100644 drivers/gpu/drm/udl/udl_fb.c
drivers/gpu/drm/udl/Makefile +1 -1
index 177ce74f4cf4..b50179bb4de0 100644
@@ -1,4 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0-only
-udl-y := udl_drv.o udl_modeset.o udl_connector.o udl_main.o udl_fb.o udl_transfer.o udl_gem.o
+udl-y := udl_drv.o udl_modeset.o udl_connector.o udl_main.o udl_transfer.o udl_gem.o
 
 obj-$(CONFIG_DRM_UDL) := udl.o
drivers/gpu/drm/udl/udl_fb.c deleted +0 -51

51 lines not on this page · raw message

Signature · 6 lines
2.24.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel