Merge tag 'amd-drm-fixes-5.16-2021-12-15' of https://gitlab.freedesktop.org/agd5f...
authorDave Airlie <airlied@redhat.com>
Fri, 17 Dec 2021 05:01:00 +0000 (15:01 +1000)
committerDave Airlie <airlied@redhat.com>
Fri, 17 Dec 2021 05:01:01 +0000 (15:01 +1000)
amd-drm-fixes-5.16-2021-12-15:

amdgpu:
- Fix RLC register offset
- GMC fix
- Properly cache SMU FW version on Yellow Carp
- Fix missing callback on DCN3.1
- Reset DMCUB before HW init
- Fix for GMC powergating on PCO
- Fix a possible memory leak in GPU metrics table handling on RN

Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Alex Deucher <alexander.deucher@amd.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211216035239.5787-1-alexander.deucher@amd.com
drivers/gpu/drm/ast/ast_mode.c
drivers/gpu/drm/drm_fb_helper.c
drivers/gpu/drm/i915/display/intel_dmc.c
drivers/gpu/drm/tiny/simpledrm.c

index 1e30eae..d5c98f7 100644 (file)
@@ -1121,7 +1121,10 @@ static void ast_crtc_reset(struct drm_crtc *crtc)
        if (crtc->state)
                crtc->funcs->atomic_destroy_state(crtc, crtc->state);
 
-       __drm_atomic_helper_crtc_reset(crtc, &ast_state->base);
+       if (ast_state)
+               __drm_atomic_helper_crtc_reset(crtc, &ast_state->base);
+       else
+               __drm_atomic_helper_crtc_reset(crtc, NULL);
 }
 
 static struct drm_crtc_state *
index 8e7a124..22bf690 100644 (file)
@@ -1743,7 +1743,13 @@ void drm_fb_helper_fill_info(struct fb_info *info,
                               sizes->fb_width, sizes->fb_height);
 
        info->par = fb_helper;
-       snprintf(info->fix.id, sizeof(info->fix.id), "%s",
+       /*
+        * The DRM drivers fbdev emulation device name can be confusing if the
+        * driver name also has a "drm" suffix on it. Leading to names such as
+        * "simpledrmdrmfb" in /proc/fb. Unfortunately, it's an uAPI and can't
+        * be changed due user-space tools (e.g: pm-utils) matching against it.
+        */
+       snprintf(info->fix.id, sizeof(info->fix.id), "%sdrmfb",
                 fb_helper->dev->driver->name);
 
 }
index 2dc9d63..aef6952 100644 (file)
@@ -596,7 +596,7 @@ static void parse_dmc_fw(struct drm_i915_private *dev_priv,
                        continue;
 
                offset = readcount + dmc->dmc_info[id].dmc_offset * 4;
-               if (fw->size - offset < 0) {
+               if (offset > fw->size) {
                        drm_err(&dev_priv->drm, "Reading beyond the fw_size\n");
                        continue;
                }
index 481b48b..5a6e898 100644 (file)
@@ -458,7 +458,7 @@ static struct drm_display_mode simpledrm_mode(unsigned int width,
 {
        struct drm_display_mode mode = { SIMPLEDRM_MODE(width, height) };
 
-       mode.clock = 60 /* Hz */ * mode.hdisplay * mode.vdisplay;
+       mode.clock = mode.hdisplay * mode.vdisplay * 60 / 1000 /* kHz */;
        drm_mode_set_name(&mode);
 
        return mode;