Skip to content

Commit abbc7a3

Browse files
committed
drm/amdgpu: don't register a dirty callback for non-atomic
Some asics still support non-atomic code paths. Fixes: 66f9962 ("drm/amdgpu: use dirty framebuffer helper") Reported-by: Arthur Marsh <[email protected]> Reviewed-by: Hamza Mahfooz <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 88bab90 commit abbc7a3

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_display.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#include <linux/pm_runtime.h>
4040
#include <drm/drm_crtc_helper.h>
4141
#include <drm/drm_damage_helper.h>
42+
#include <drm/drm_drv.h>
4243
#include <drm/drm_edid.h>
4344
#include <drm/drm_gem_framebuffer_helper.h>
4445
#include <drm/drm_fb_helper.h>
@@ -497,6 +498,11 @@ bool amdgpu_display_ddc_probe(struct amdgpu_connector *amdgpu_connector,
497498
static const struct drm_framebuffer_funcs amdgpu_fb_funcs = {
498499
.destroy = drm_gem_fb_destroy,
499500
.create_handle = drm_gem_fb_create_handle,
501+
};
502+
503+
static const struct drm_framebuffer_funcs amdgpu_fb_funcs_atomic = {
504+
.destroy = drm_gem_fb_destroy,
505+
.create_handle = drm_gem_fb_create_handle,
500506
.dirty = drm_atomic_helper_dirtyfb,
501507
};
502508

@@ -1102,7 +1108,10 @@ static int amdgpu_display_gem_fb_verify_and_init(struct drm_device *dev,
11021108
if (ret)
11031109
goto err;
11041110

1105-
ret = drm_framebuffer_init(dev, &rfb->base, &amdgpu_fb_funcs);
1111+
if (drm_drv_uses_atomic_modeset(dev))
1112+
ret = drm_framebuffer_init(dev, &rfb->base, &amdgpu_fb_funcs_atomic);
1113+
else
1114+
ret = drm_framebuffer_init(dev, &rfb->base, &amdgpu_fb_funcs);
11061115
if (ret)
11071116
goto err;
11081117

0 commit comments

Comments
 (0)