drm/amd/display: provide an interface to query firmware version
authorAnthony Koo <Anthony.Koo@amd.com>
Thu, 8 Feb 2018 04:25:43 +0000 (23:25 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 19 Feb 2018 19:20:14 +0000 (14:20 -0500)
Signed-off-by: Anthony Koo <Anthony.Koo@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/core/dc.c
drivers/gpu/drm/amd/display/dc/dc.h
drivers/gpu/drm/amd/display/dc/dce/dce_dmcu.c
drivers/gpu/drm/amd/display/dc/inc/hw/dmcu.h

index 8583d9e05721e15f3f05c65d14f3737f7b0fcaad..77a1bf233c3c8cb39dcb1eed7b817e052345f36a 100644 (file)
@@ -39,6 +39,7 @@
 #include "bios_parser_interface.h"
 #include "include/irq_service_interface.h"
 #include "transform.h"
+#include "dmcu.h"
 #include "dpp.h"
 #include "timing_generator.h"
 #include "virtual/virtual_link_encoder.h"
@@ -609,6 +610,12 @@ struct dc *dc_create(const struct dc_init_data *init_params)
        dc->caps.max_audios = dc->res_pool->audio_count;
        dc->caps.linear_pitch_alignment = 64;
 
+       /* Populate versioning information */
+       dc->versions.dc_ver = DC_VER;
+
+       if (dc->res_pool->dmcu != NULL)
+               dc->versions.dmcu_version = dc->res_pool->dmcu->dmcu_version;
+
        dc->config = init_params->flags;
 
        dm_logger_write(dc->ctx->logger, LOG_DC,
index a512b05303e2b9af2e17a9b8244fa43650c96b29..5bb0e5defaf4370d08474ce1c27b3272ed09c4b0 100644 (file)
 /*******************************************************************************
  * Display Core Interfaces
  ******************************************************************************/
+struct dmcu_version {
+       unsigned int date;
+       unsigned int month;
+       unsigned int year;
+       unsigned int interface_version;
+};
+
+struct dc_versions {
+       const char *dc_ver;
+       struct dmcu_version dmcu_version;
+};
+
 struct dc_caps {
        uint32_t max_streams;
        uint32_t max_links;
@@ -221,6 +233,7 @@ struct dc_state;
 struct resource_pool;
 struct dce_hwseq;
 struct dc {
+       struct dc_versions versions;
        struct dc_caps caps;
        struct dc_cap_funcs cap_funcs;
        struct dc_config config;
index 48e21ead3142d44c59ec41fbe5472618cc16cc84..2ee3d9bf1062212e16142ba80141ea4e3a5ddcf4 100644 (file)
@@ -360,7 +360,7 @@ static void dcn10_get_dmcu_version(struct dmcu *dmcu)
        dmcu->dmcu_version.year = ((REG_READ(DMCU_IRAM_RD_DATA) << 8) |
                                                REG_READ(DMCU_IRAM_RD_DATA));
        dmcu->dmcu_version.month = REG_READ(DMCU_IRAM_RD_DATA);
-       dmcu->dmcu_version.day = REG_READ(DMCU_IRAM_RD_DATA);
+       dmcu->dmcu_version.date = REG_READ(DMCU_IRAM_RD_DATA);
 
        /* Disable write access to IRAM to allow dynamic sleep state */
        REG_UPDATE_2(DMCU_RAM_ACCESS_CTRL,
index ce206355461b1e4496b80f76dd5e42a1ad38a11f..de60f940030da69864a5e9e705a2e408c9af12f2 100644 (file)
@@ -32,13 +32,6 @@ enum dmcu_state {
        DMCU_RUNNING = 1
 };
 
-struct dmcu_version {
-       unsigned int day;
-       unsigned int month;
-       unsigned int year;
-       unsigned int interface_version;
-};
-
 struct dmcu {
        struct dc_context *ctx;
        const struct dmcu_funcs *funcs;