Skip to content

Commit

Permalink
Fix DRM overlays when using fkms
Browse files Browse the repository at this point in the history
This is part of the fix for getting display overlays to work when
using DRM with fkms (rather than kms). A Linux kernel update is also
required, but this change will be needed too so that the code will
run correctly.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
  • Loading branch information
davidplowman authored and chrisruk committed Oct 17, 2022
1 parent ff16fc4 commit 5f2ccf4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions picamera2/previews/drm_preview.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,12 @@ def render_drm(self, picam2, completed_request):
self.overlay_plane = self.resman.reserve_overlay_plane(self.crtc, pykms.PixelFormat.ABGR8888)
if self.overlay_plane is None:
raise RuntimeError("Failed to reserve DRM overlay plane")
# Want "coverage" mode, not pre-multiplied alpha.
self.overlay_plane.set_prop("pixel blend mode", 1)
# Want "coverage" mode, not pre-multiplied alpha. fkms doesn't seem to have this
# property so we suppress the error, but it seems to have the right behaviour anyway.
try:
self.overlay_plane.set_prop("pixel blend mode", 1)
except RuntimeError:
pass

if completed_request is not None:
fb = completed_request.request.buffers[stream]
Expand Down

0 comments on commit 5f2ccf4

Please sign in to comment.