Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drm/virtio: Send flip event based on backend setting #72

Open
wants to merge 1 commit into
base: celadon/u/mr0/master
Choose a base branch
from

Conversation

phreer
Copy link

@phreer phreer commented Dec 10, 2024

Cache out fences in atomic commit and signal them when the backend asks to. The backend is supposed to send to frontend the number of fences to signal when the backend presents a frame to users. Only in this way we can preserve the semantics of present fence.

Tracked-On: OAM-128370

@sysopenci
Copy link

Improper Commit Message
Tracked on not found in commit message,
make sure Tracked-On: Jira-ticket is present.

@phreer phreer changed the title drm/virtgio: Send flip event based on backend setting drm/virtio: Send flip event based on backend setting Dec 16, 2024
virtqueue_enable_cb(vgdev->vblank[output->index].vblank.vq);
do {
virtio_gpu_vblank_poll_arm(vgdev->vblank[output->index].vblank.vq);
} while (!virtqueue_enable_cb(vgdev->vblank[output->index].vblank.vq));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In which case, virtqueue_enable_cb will return false and need run multiple times, then success?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

robust enhance to avoid dead loop.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be safe enough to use like this. We can see the same usage in virtio-GPU.

Copy link

@feijiang1 feijiang1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two commits seems change same logic, should be combined together?

@phreer phreer force-pushed the virtgpu-present-fence branch 3 times, most recently from 0dc1620 to 0390a3c Compare December 23, 2024 02:45
@sysopenci sysopenci requested a review from feijiang1 December 23, 2024 05:31
Copy link
Contributor

@xzhan34 xzhan34 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@sysopenci
Copy link

Improper Commit Message
Tracked on not found in commit message,
make sure Tracked-On: Jira-ticket is present.

Introduce per-CRTC flip counter that should be incremented when flip
happens in back-end. Atomic commit worker should await change of the new
flip sequence rather than vblank sequence. Present fences are also
cached and signaled when flip happens.

We introduce flip sequence feature for backward compatibility, meaning
that we must wait for flip event only when we have flip sequence feature
negotiated. This is to avoid breaks old hypervisor/device model.

Tracked-On: OAM-128741
Signed-off-by: hangliu1 <[email protected]>
Signed-off-by: Xue, Bosheng <[email protected]>
Signed-off-by: Weifeng Liu <[email protected]>
Copy link
Contributor

@xzhan34 xzhan34 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

@feijiang1 feijiang1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants