drm/amd/display: Add logging for aux DPCD access
authorEric Yang <Eric.Yang2@amd.com>
Tue, 6 Feb 2018 22:28:46 +0000 (17:28 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 19 Feb 2018 19:20:15 +0000 (14:20 -0500)
Add basic logging for DPCD access. Does not print
by default.

Currently only prints first byte of the data accessed.

Technical debt: Need to make it so that the entire
data block accessed is printed. Also need to log
address space that's not DPCD.

Signed-off-by: Eric Yang <Eric.Yang2@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/i2caux/aux_engine.c

index fc7a7d4ebca5fd4fee0c462fd7dc6619737b32ff..0b1db48fef36aea9a60d64df19f54f777635d59e 100644 (file)
@@ -284,6 +284,14 @@ static bool read_command(
                                msleep(engine->delay);
        } while (ctx.operation_succeeded && !ctx.transaction_complete);
 
+       if (request->payload.address_space ==
+               I2CAUX_TRANSACTION_ADDRESS_SPACE_DPCD) {
+               dm_logger_write(engine->base.ctx->logger, LOG_I2C_AUX, "READ: addr:0x%x  value:0x%x Result:%d",
+                               request->payload.address,
+                               request->payload.data[0],
+                               ctx.operation_succeeded);
+       }
+
        return ctx.operation_succeeded;
 }
 
@@ -484,6 +492,14 @@ static bool write_command(
                                msleep(engine->delay);
        } while (ctx.operation_succeeded && !ctx.transaction_complete);
 
+       if (request->payload.address_space ==
+               I2CAUX_TRANSACTION_ADDRESS_SPACE_DPCD) {
+               dm_logger_write(engine->base.ctx->logger, LOG_I2C_AUX, "WRITE: addr:0x%x  value:0x%x Result:%d",
+                               request->payload.address,
+                               request->payload.data[0],
+                               ctx.operation_succeeded);
+       }
+
        return ctx.operation_succeeded;
 }