From: Thomas Zimmermann <tzimmermann@suse.de>
To: airlied@redhat.com, sean@poorly.run, daniel@ffwll.ch
Cc: Thomas Zimmermann <tzimmermann@suse.de>, dri-devel@lists.freedesktop.org
Subject: [PATCH 11/16] drm/udl: Move register constants to udl_proto.h
Date: Mon, 19 Sep 2022 15:04:03 +0200 [thread overview]
Message-ID: <20220919130408.21486-12-tzimmermann@suse.de> (raw)
In-Reply-To: <20220919130408.21486-1-tzimmermann@suse.de>
Move the existing register constants to a new file in preparation of
adding more of them. Renaming is intentional. No functional changes.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
drivers/gpu/drm/udl/udl_drv.h | 9 ---------
drivers/gpu/drm/udl/udl_modeset.c | 11 +++++------
drivers/gpu/drm/udl/udl_proto.h | 16 ++++++++++++++++
3 files changed, 21 insertions(+), 15 deletions(-)
create mode 100644 drivers/gpu/drm/udl/udl_proto.h
diff --git a/drivers/gpu/drm/udl/udl_drv.h b/drivers/gpu/drm/udl/udl_drv.h
index b090b6cebdc4..580989087c54 100644
--- a/drivers/gpu/drm/udl/udl_drv.h
+++ b/drivers/gpu/drm/udl/udl_drv.h
@@ -112,13 +112,4 @@ int udl_select_std_channel(struct udl_device *udl);
#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
diff --git a/drivers/gpu/drm/udl/udl_modeset.c b/drivers/gpu/drm/udl/udl_modeset.c
index 6fa4c8b5c2c6..e80ed218563e 100644
--- a/drivers/gpu/drm/udl/udl_modeset.c
+++ b/drivers/gpu/drm/udl/udl_modeset.c
@@ -24,8 +24,7 @@
#include <drm/drm_vblank.h>
#include "udl_drv.h"
-
-#define UDL_COLOR_DEPTH_16BPP 0
+#include "udl_proto.h"
/*
* All DisplayLink bulk operations start with 0xAF, followed by specific code
@@ -52,7 +51,7 @@ static char *udl_vidreg_unlock(char *buf)
static char *udl_set_blank_mode(char *buf, u8 mode)
{
- return udl_set_register(buf, UDL_REG_BLANK_MODE, mode);
+ return udl_set_register(buf, UDL_REG_BLANKMODE, mode);
}
static char *udl_set_color_depth(char *buf, u8 selection)
@@ -367,13 +366,13 @@ static void udl_crtc_helper_atomic_enable(struct drm_crtc *crtc, struct drm_atom
buf = (char *)urb->transfer_buffer;
buf = udl_vidreg_lock(buf);
- buf = udl_set_color_depth(buf, UDL_COLOR_DEPTH_16BPP);
+ buf = udl_set_color_depth(buf, UDL_COLORDEPTH_16BPP);
/* set base for 16bpp segment to 0 */
buf = udl_set_base16bpp(buf, 0);
/* set base for 8bpp segment to end of fb */
buf = udl_set_base8bpp(buf, 2 * mode->vdisplay * mode->hdisplay);
buf = udl_set_vid_cmds(buf, mode);
- buf = udl_set_blank_mode(buf, UDL_BLANK_MODE_ON);
+ buf = udl_set_blank_mode(buf, UDL_BLANKMODE_ON);
buf = udl_vidreg_unlock(buf);
buf = udl_dummy_render(buf);
@@ -399,7 +398,7 @@ static void udl_crtc_helper_atomic_disable(struct drm_crtc *crtc, struct drm_ato
buf = (char *)urb->transfer_buffer;
buf = udl_vidreg_lock(buf);
- buf = udl_set_blank_mode(buf, UDL_BLANK_MODE_POWERDOWN);
+ buf = udl_set_blank_mode(buf, UDL_BLANKMODE_POWERDOWN);
buf = udl_vidreg_unlock(buf);
buf = udl_dummy_render(buf);
diff --git a/drivers/gpu/drm/udl/udl_proto.h b/drivers/gpu/drm/udl/udl_proto.h
new file mode 100644
index 000000000000..3f5b8e832b99
--- /dev/null
+++ b/drivers/gpu/drm/udl/udl_proto.h
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef UDL_PROTO_H
+#define UDL_PROTO_H
+
+#define UDL_COLORDEPTH_16BPP 0
+
+/* On/Off for driving the DisplayLink framebuffer to the display */
+#define UDL_REG_BLANKMODE 0x1f
+#define UDL_BLANKMODE_ON 0x00 /* hsync and vsync on, visible */
+#define UDL_BLANKMODE_BLANKED 0x01 /* hsync and vsync on, blanked */
+#define UDL_BLANKMODE_VSYNC_OFF 0x03 /* vsync off, blanked */
+#define UDL_BLANKMODE_HSYNC_OFF 0x05 /* hsync off, blanked */
+#define UDL_BLANKMODE_POWERDOWN 0x07 /* powered off; requires modeset */
+
+#endif
--
2.37.3
next prev parent reply other threads:[~2022-09-19 13:05 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-19 13:03 [PATCH 00/16] drm/udl: Better modesetting, hot-unplug, protocol Thomas Zimmermann
2022-09-19 13:03 ` [PATCH 01/16] drm/udl: Rename struct udl_drm_connector to struct udl_connector Thomas Zimmermann
2022-09-29 12:51 ` Javier Martinez Canillas
2022-09-19 13:03 ` [PATCH 02/16] drm/udl: Test pixel limit in mode-config's mode-valid function Thomas Zimmermann
2022-09-29 13:20 ` Javier Martinez Canillas
2022-09-29 13:53 ` Thomas Zimmermann
2022-09-19 13:03 ` [PATCH 03/16] drm/udl: Use USB timeout constant when reading EDID Thomas Zimmermann
2022-09-29 13:23 ` Javier Martinez Canillas
2022-09-19 13:03 ` [PATCH 04/16] drm/udl: Various improvements to the connector Thomas Zimmermann
2022-09-29 13:44 ` Javier Martinez Canillas
2022-09-19 13:03 ` [PATCH 05/16] drm/udl: Move connector to modesetting code Thomas Zimmermann
2022-09-29 13:47 ` Javier Martinez Canillas
2022-09-19 13:03 ` [PATCH 06/16] drm/udl: Remove udl_simple_display_pipe_mode_valid() Thomas Zimmermann
2022-09-29 13:49 ` Javier Martinez Canillas
2022-09-19 13:03 ` [PATCH 07/16] drm/udl: Convert to atomic-modesetting helpers Thomas Zimmermann
2022-09-29 14:21 ` Javier Martinez Canillas
2022-09-19 13:04 ` [PATCH 08/16] drm/udl: Simplify modesetting in CRTC's enable function Thomas Zimmermann
2022-09-29 14:28 ` Javier Martinez Canillas
2022-09-19 13:04 ` [PATCH 09/16] drm/udl: Support DRM hot-unplugging Thomas Zimmermann
2022-10-04 22:17 ` Javier Martinez Canillas
2022-09-19 13:04 ` [PATCH 10/16] drm/udl: Use damage iterator Thomas Zimmermann
2022-10-04 22:28 ` Javier Martinez Canillas
2022-10-05 15:26 ` Thomas Zimmermann
2022-09-19 13:04 ` Thomas Zimmermann [this message]
2022-10-04 22:39 ` [PATCH 11/16] drm/udl: Move register constants to udl_proto.h Javier Martinez Canillas
2022-09-19 13:04 ` [PATCH 12/16] drm/udl: Add constants for display-mode registers Thomas Zimmermann
2022-10-04 22:50 ` Javier Martinez Canillas
2022-09-19 13:04 ` [PATCH 13/16] drm/udl: Add register constants for color depth Thomas Zimmermann
2022-10-04 22:51 ` Javier Martinez Canillas
2022-09-19 13:04 ` [PATCH 14/16] drm/udl: Add register constants for video locks Thomas Zimmermann
2022-10-04 22:52 ` Javier Martinez Canillas
2022-09-19 13:04 ` [PATCH 15/16] drm/udl: Add register constants for framebuffer scanout addresses Thomas Zimmermann
2022-10-04 22:59 ` Javier Martinez Canillas
2022-10-05 14:56 ` Thomas Zimmermann
2022-09-19 13:04 ` [PATCH 16/16] drm/udl: Add constants for commands Thomas Zimmermann
2022-10-04 23:00 ` Javier Martinez Canillas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220919130408.21486-12-tzimmermann@suse.de \
--to=tzimmermann@suse.de \
--cc=airlied@redhat.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=sean@poorly.run \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.