Skip to content

Commit 841bed6

Browse files
committed
Merge branch 'linux-5.15-trunk/at91/drm-fixes' into linux-5.15-mchp
2 parents ce33bba + a0190a2 commit 841bed6

4 files changed

Lines changed: 46 additions & 2 deletions

File tree

drivers/gpu/drm/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ config DRM_DEBUG_DP_MST_TOPOLOGY_REFS
103103
config DRM_FBDEV_EMULATION
104104
bool "Enable legacy fbdev support for your modesetting driver"
105105
depends on DRM
106-
depends on FB
107106
select DRM_KMS_HELPER
107+
select FB
108108
select FB_CFB_FILLRECT
109109
select FB_CFB_COPYAREA
110110
select FB_CFB_IMAGEBLIT

drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313

1414
#include <linux/regmap.h>
1515

16+
#include <drm/drm_crtc.h>
17+
#include <drm/drm_encoder.h>
18+
#include <drm/drm_modes.h>
1619
#include <drm/drm_plane.h>
1720
#include <drm/drm_modes.h>
1821
#include <drm/drm_crtc.h>

drivers/gpu/drm/drm_atomic_helper.c

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1460,7 +1460,42 @@ int drm_atomic_helper_wait_for_fences(struct drm_device *dev,
14601460
EXPORT_SYMBOL(drm_atomic_helper_wait_for_fences);
14611461

14621462
/**
1463-
* drm_atomic_helper_wait_for_vblanks - wait for vblank on CRTCs
1463+
* drm_atomic_helper_framebuffer_changed - check if framebuffer has changed
1464+
* @dev: DRM device
1465+
* @old_state: atomic state object with old state structures
1466+
* @crtc: DRM crtc
1467+
*
1468+
* Checks whether the framebuffer used for this CRTC changes as a result of
1469+
* the atomic update. This is useful for drivers which cannot use
1470+
* drm_atomic_helper_wait_for_vblanks() and need to reimplement its
1471+
* functionality.
1472+
*
1473+
* Returns:
1474+
* true if the framebuffer changed.
1475+
*/
1476+
bool drm_atomic_helper_framebuffer_changed(struct drm_device *dev,
1477+
struct drm_atomic_state *old_state,
1478+
struct drm_crtc *crtc)
1479+
{
1480+
struct drm_plane *plane;
1481+
struct drm_plane_state *old_plane_state;
1482+
int i;
1483+
1484+
for_each_old_plane_in_state(old_state, plane, old_plane_state, i) {
1485+
if (plane->state->crtc != crtc &&
1486+
old_plane_state->crtc != crtc)
1487+
continue;
1488+
1489+
if (plane->state->fb != old_plane_state->fb)
1490+
return true;
1491+
}
1492+
1493+
return false;
1494+
}
1495+
EXPORT_SYMBOL(drm_atomic_helper_framebuffer_changed);
1496+
1497+
/**
1498+
* drm_atomic_helper_wait_for_vblanks - wait for vblank on crtcs
14641499
* @dev: DRM device
14651500
* @old_state: atomic state object with old state structures
14661501
*
@@ -1494,6 +1529,9 @@ drm_atomic_helper_wait_for_vblanks(struct drm_device *dev,
14941529
if (!new_crtc_state->active)
14951530
continue;
14961531

1532+
if (!drm_atomic_helper_framebuffer_changed(dev,
1533+
old_state, crtc))
1534+
continue;
14971535
ret = drm_crtc_vblank_get(crtc);
14981536
if (ret != 0)
14991537
continue;

include/drm/drm_atomic_helper.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ void drm_atomic_helper_async_commit(struct drm_device *dev,
6363
int drm_atomic_helper_wait_for_fences(struct drm_device *dev,
6464
struct drm_atomic_state *state,
6565
bool pre_swap);
66+
bool drm_atomic_helper_framebuffer_changed(struct drm_device *dev,
67+
struct drm_atomic_state *old_state,
68+
struct drm_crtc *crtc);
6669

6770
void drm_atomic_helper_wait_for_vblanks(struct drm_device *dev,
6871
struct drm_atomic_state *old_state);

0 commit comments

Comments
 (0)