Merge "minui: Add API to support multiple connectors detection" am: ece44b945b
am: 56b4f0b779
am: ce1ce7d06a
Original change: https://android-review.googlesource.com/c/platform/bootable/recovery/+/2188757 Change-Id: Ic045dcbe85d428170a9ea766ae9800eb3b33ec58 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
commit
1fdf619d9e
7 changed files with 20 additions and 1 deletions
|
@ -502,3 +502,7 @@ void gr_fb_blank(bool blank, int index) {
|
||||||
void gr_rotate(GRRotation rot) {
|
void gr_rotate(GRRotation rot) {
|
||||||
rotation = rot;
|
rotation = rot;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool gr_has_multiple_connectors() {
|
||||||
|
return gr_backend->HasMultipleConnectors();
|
||||||
|
}
|
||||||
|
|
|
@ -40,8 +40,11 @@ class MinuiBackend {
|
||||||
// Blank (or unblank) the specific screen.
|
// Blank (or unblank) the specific screen.
|
||||||
virtual void Blank(bool blank, DrmConnector index) = 0;
|
virtual void Blank(bool blank, DrmConnector index) = 0;
|
||||||
|
|
||||||
|
// Return true if the device supports multiple connectors.
|
||||||
|
virtual bool HasMultipleConnectors() = 0;
|
||||||
|
|
||||||
// Device cleanup when drawing is done.
|
// Device cleanup when drawing is done.
|
||||||
virtual ~MinuiBackend() {};
|
virtual ~MinuiBackend() = default;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _GRAPHICS_H_
|
#endif // _GRAPHICS_H_
|
||||||
|
|
|
@ -200,6 +200,10 @@ void MinuiBackendDrm::Blank(bool blank, DrmConnector index) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool MinuiBackendDrm::HasMultipleConnectors() {
|
||||||
|
return (drm[DRM_SEC].GRSurfaceDrms[0] && drm[DRM_SEC].GRSurfaceDrms[1]);
|
||||||
|
}
|
||||||
|
|
||||||
static drmModeCrtc* find_crtc_for_connector(int fd, drmModeRes* resources,
|
static drmModeCrtc* find_crtc_for_connector(int fd, drmModeRes* resources,
|
||||||
drmModeConnector* connector) {
|
drmModeConnector* connector) {
|
||||||
// Find the encoder. If we already have one, just use it.
|
// Find the encoder. If we already have one, just use it.
|
||||||
|
|
|
@ -60,6 +60,7 @@ class MinuiBackendDrm : public MinuiBackend {
|
||||||
GRSurface* Flip() override;
|
GRSurface* Flip() override;
|
||||||
void Blank(bool) override;
|
void Blank(bool) override;
|
||||||
void Blank(bool blank, DrmConnector index) override;
|
void Blank(bool blank, DrmConnector index) override;
|
||||||
|
bool HasMultipleConnectors() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void DrmDisableCrtc(int drm_fd, drmModeCrtc* crtc);
|
void DrmDisableCrtc(int drm_fd, drmModeCrtc* crtc);
|
||||||
|
|
|
@ -47,6 +47,11 @@ void MinuiBackendFbdev::Blank(bool blank, DrmConnector index) {
|
||||||
fprintf(stderr, "Unsupported multiple connectors, blank = %d, index = %d\n", blank, index);
|
fprintf(stderr, "Unsupported multiple connectors, blank = %d, index = %d\n", blank, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool MinuiBackendFbdev::HasMultipleConnectors() {
|
||||||
|
fprintf(stderr, "Unsupported multiple connectors\n");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void MinuiBackendFbdev::SetDisplayedFramebuffer(size_t n) {
|
void MinuiBackendFbdev::SetDisplayedFramebuffer(size_t n) {
|
||||||
if (n > 1 || !double_buffered) return;
|
if (n > 1 || !double_buffered) return;
|
||||||
|
|
||||||
|
|
|
@ -57,6 +57,7 @@ class MinuiBackendFbdev : public MinuiBackend {
|
||||||
GRSurface* Flip() override;
|
GRSurface* Flip() override;
|
||||||
void Blank(bool) override;
|
void Blank(bool) override;
|
||||||
void Blank(bool blank, DrmConnector index) override;
|
void Blank(bool blank, DrmConnector index) override;
|
||||||
|
bool HasMultipleConnectors() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void SetDisplayedFramebuffer(size_t n);
|
void SetDisplayedFramebuffer(size_t n);
|
||||||
|
|
|
@ -129,6 +129,7 @@ int gr_fb_height();
|
||||||
void gr_flip();
|
void gr_flip();
|
||||||
void gr_fb_blank(bool blank);
|
void gr_fb_blank(bool blank);
|
||||||
void gr_fb_blank(bool blank, int index);
|
void gr_fb_blank(bool blank, int index);
|
||||||
|
bool gr_has_multiple_connectors();
|
||||||
|
|
||||||
// Clears entire surface to current color.
|
// Clears entire surface to current color.
|
||||||
void gr_clear();
|
void gr_clear();
|
||||||
|
|
Loading…
Reference in a new issue