drm/vc4: crtc: Provide a CRTC name
authorMaxime Ripard <maxime@cerno.tech>
Wed, 23 Nov 2022 15:26:02 +0000 (16:26 +0100)
committerMaxime Ripard <maxime@cerno.tech>
Mon, 28 Nov 2022 10:51:20 +0000 (11:51 +0100)
It's fairly hard to figure out the instance of the CRTC affected by an
atomic change using the default name.

Since we can provide our own to the CRTC initialization functions, let's
do so to make the debugging sessions easier.

Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20221123-rpi-kunit-tests-v1-20-051a0bb60a16@cerno.tech
drivers/gpu/drm/vc4/vc4_crtc.c
drivers/gpu/drm/vc4/vc4_drv.h
drivers/gpu/drm/vc4/vc4_txp.c

index 1ea190d..333529e 100644 (file)
@@ -1133,6 +1133,7 @@ static const struct drm_crtc_helper_funcs vc4_crtc_helper_funcs = {
 
 static const struct vc4_pv_data bcm2835_pv0_data = {
        .base = {
+               .name = "pixelvalve-0",
                .debugfs_name = "crtc0_regs",
                .hvs_available_channels = BIT(0),
                .hvs_output = 0,
@@ -1147,6 +1148,7 @@ static const struct vc4_pv_data bcm2835_pv0_data = {
 
 static const struct vc4_pv_data bcm2835_pv1_data = {
        .base = {
+               .name = "pixelvalve-1",
                .debugfs_name = "crtc1_regs",
                .hvs_available_channels = BIT(2),
                .hvs_output = 2,
@@ -1161,6 +1163,7 @@ static const struct vc4_pv_data bcm2835_pv1_data = {
 
 static const struct vc4_pv_data bcm2835_pv2_data = {
        .base = {
+               .name = "pixelvalve-2",
                .debugfs_name = "crtc2_regs",
                .hvs_available_channels = BIT(1),
                .hvs_output = 1,
@@ -1175,6 +1178,7 @@ static const struct vc4_pv_data bcm2835_pv2_data = {
 
 static const struct vc4_pv_data bcm2711_pv0_data = {
        .base = {
+               .name = "pixelvalve-0",
                .debugfs_name = "crtc0_regs",
                .hvs_available_channels = BIT(0),
                .hvs_output = 0,
@@ -1189,6 +1193,7 @@ static const struct vc4_pv_data bcm2711_pv0_data = {
 
 static const struct vc4_pv_data bcm2711_pv1_data = {
        .base = {
+               .name = "pixelvalve-1",
                .debugfs_name = "crtc1_regs",
                .hvs_available_channels = BIT(0) | BIT(1) | BIT(2),
                .hvs_output = 3,
@@ -1203,6 +1208,7 @@ static const struct vc4_pv_data bcm2711_pv1_data = {
 
 static const struct vc4_pv_data bcm2711_pv2_data = {
        .base = {
+               .name = "pixelvalve-2",
                .debugfs_name = "crtc2_regs",
                .hvs_available_channels = BIT(0) | BIT(1) | BIT(2),
                .hvs_output = 4,
@@ -1216,6 +1222,7 @@ static const struct vc4_pv_data bcm2711_pv2_data = {
 
 static const struct vc4_pv_data bcm2711_pv3_data = {
        .base = {
+               .name = "pixelvalve-3",
                .debugfs_name = "crtc3_regs",
                .hvs_available_channels = BIT(1),
                .hvs_output = 1,
@@ -1229,6 +1236,7 @@ static const struct vc4_pv_data bcm2711_pv3_data = {
 
 static const struct vc4_pv_data bcm2711_pv4_data = {
        .base = {
+               .name = "pixelvalve-4",
                .debugfs_name = "crtc4_regs",
                .hvs_available_channels = BIT(0) | BIT(1) | BIT(2),
                .hvs_output = 5,
@@ -1308,7 +1316,7 @@ int vc4_crtc_init(struct drm_device *drm, struct platform_device *pdev,
        vc4_crtc->feeds_txp = feeds_txp;
        spin_lock_init(&vc4_crtc->irq_lock);
        ret = drmm_crtc_init_with_planes(drm, crtc, primary_plane, NULL,
-                                        crtc_funcs, NULL);
+                                        crtc_funcs, data->name);
        if (ret)
                return ret;
 
index 31ce73f..6af615c 100644 (file)
@@ -473,6 +473,8 @@ to_vc4_encoder(const struct drm_encoder *encoder)
 }
 
 struct vc4_crtc_data {
+       const char *name;
+
        const char *debugfs_name;
 
        /* Bitmask of channels (FIFOs) of the HVS that the output can source from */
index 841da24..4f7ce5d 100644 (file)
@@ -480,6 +480,7 @@ static irqreturn_t vc4_txp_interrupt(int irq, void *data)
 }
 
 static const struct vc4_crtc_data vc4_txp_crtc_data = {
+       .name = "txp",
        .debugfs_name = "txp_regs",
        .hvs_available_channels = BIT(2),
        .hvs_output = 2,