mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-10 04:48:04 +09:00
UPSTREAM: drm/virtio: track virtual output state
Track whenever an virtual output (crtc) is enabled or disabled.
On atomic updates check for both framebuffer being present and crtc
being enabled to figure whenever the output is active or not.
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20180813152855.12863-1-kraxel@redhat.com
(cherry picked from commit 6c19787e10)
Signed-off-by: Greg Hartman <ghartman@google.com>
BUG: 139386237
Change-Id: I2957c2793f14a77ddf7084ade9b360ee40509dcb
This commit is contained in:
committed by
Alistair Delva
parent
64cfae1900
commit
21165d9f51
@@ -109,6 +109,9 @@ static void virtio_gpu_crtc_mode_set_nofb(struct drm_crtc *crtc)
|
||||
static void virtio_gpu_crtc_atomic_enable(struct drm_crtc *crtc,
|
||||
struct drm_crtc_state *old_state)
|
||||
{
|
||||
struct virtio_gpu_output *output = drm_crtc_to_virtio_gpu_output(crtc);
|
||||
|
||||
output->enabled = true;
|
||||
}
|
||||
|
||||
static void virtio_gpu_crtc_atomic_disable(struct drm_crtc *crtc,
|
||||
@@ -119,6 +122,7 @@ static void virtio_gpu_crtc_atomic_disable(struct drm_crtc *crtc,
|
||||
struct virtio_gpu_output *output = drm_crtc_to_virtio_gpu_output(crtc);
|
||||
|
||||
virtio_gpu_cmd_set_scanout(vgdev, output->index, 0, 0, 0, 0, 0);
|
||||
output->enabled = false;
|
||||
}
|
||||
|
||||
static int virtio_gpu_crtc_atomic_check(struct drm_crtc *crtc,
|
||||
|
||||
@@ -114,6 +114,7 @@ struct virtio_gpu_output {
|
||||
struct virtio_gpu_update_cursor cursor;
|
||||
int cur_x;
|
||||
int cur_y;
|
||||
bool enabled;
|
||||
};
|
||||
#define drm_crtc_to_virtio_gpu_output(x) \
|
||||
container_of(x, struct virtio_gpu_output, crtc)
|
||||
|
||||
@@ -152,7 +152,7 @@ static void virtio_gpu_primary_plane_update(struct drm_plane *plane,
|
||||
if (WARN_ON(!output))
|
||||
return;
|
||||
|
||||
if (plane->state->fb) {
|
||||
if (plane->state->fb && output->enabled) {
|
||||
vgfb = to_virtio_gpu_framebuffer(plane->state->fb);
|
||||
bo = gem_to_virtio_gpu_obj(vgfb->base.obj[0]);
|
||||
handle = bo->hw_res_handle;
|
||||
|
||||
Reference in New Issue
Block a user