|
39 | 39 | #include <linux/pm_runtime.h>
|
40 | 40 | #include <drm/drm_crtc_helper.h>
|
41 | 41 | #include <drm/drm_damage_helper.h>
|
| 42 | +#include <drm/drm_drv.h> |
42 | 43 | #include <drm/drm_edid.h>
|
43 | 44 | #include <drm/drm_gem_framebuffer_helper.h>
|
44 | 45 | #include <drm/drm_fb_helper.h>
|
@@ -497,6 +498,11 @@ bool amdgpu_display_ddc_probe(struct amdgpu_connector *amdgpu_connector,
|
497 | 498 | static const struct drm_framebuffer_funcs amdgpu_fb_funcs = {
|
498 | 499 | .destroy = drm_gem_fb_destroy,
|
499 | 500 | .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, |
500 | 506 | .dirty = drm_atomic_helper_dirtyfb,
|
501 | 507 | };
|
502 | 508 |
|
@@ -1102,7 +1108,10 @@ static int amdgpu_display_gem_fb_verify_and_init(struct drm_device *dev,
|
1102 | 1108 | if (ret)
|
1103 | 1109 | goto err;
|
1104 | 1110 |
|
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); |
1106 | 1115 | if (ret)
|
1107 | 1116 | goto err;
|
1108 | 1117 |
|
|
0 commit comments