summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2022-08-26 08:41:42 +0200
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2022-08-26 08:41:42 +0200
commitce1ce7d06acc1d7a383e5bff9b4ed876832da157 (patch)
treee75fcba3aa2fe2c2cbe5791a4d77c68936b88a7c
parentMerge "Make recovery/fastbootd USB VID/PID configurable." am: 512edf4a43 am: fa1855a52a (diff)
parentMerge "minui: Add API to support multiple connectors detection" am: ece44b945b (diff)
downloadandroid_bootable_recovery-ce1ce7d06acc1d7a383e5bff9b4ed876832da157.tar
android_bootable_recovery-ce1ce7d06acc1d7a383e5bff9b4ed876832da157.tar.gz
android_bootable_recovery-ce1ce7d06acc1d7a383e5bff9b4ed876832da157.tar.bz2
android_bootable_recovery-ce1ce7d06acc1d7a383e5bff9b4ed876832da157.tar.lz
android_bootable_recovery-ce1ce7d06acc1d7a383e5bff9b4ed876832da157.tar.xz
android_bootable_recovery-ce1ce7d06acc1d7a383e5bff9b4ed876832da157.tar.zst
android_bootable_recovery-ce1ce7d06acc1d7a383e5bff9b4ed876832da157.zip
-rw-r--r--minui/graphics.cpp4
-rw-r--r--minui/graphics.h5
-rw-r--r--minui/graphics_drm.cpp4
-rw-r--r--minui/graphics_drm.h1
-rw-r--r--minui/graphics_fbdev.cpp5
-rw-r--r--minui/graphics_fbdev.h1
-rw-r--r--minui/include/minui/minui.h1
7 files changed, 20 insertions, 1 deletions
diff --git a/minui/graphics.cpp b/minui/graphics.cpp
index b24c2b114..41a366112 100644
--- a/minui/graphics.cpp
+++ b/minui/graphics.cpp
@@ -502,3 +502,7 @@ void gr_fb_blank(bool blank, int index) {
void gr_rotate(GRRotation rot) {
rotation = rot;
}
+
+bool gr_has_multiple_connectors() {
+ return gr_backend->HasMultipleConnectors();
+}
diff --git a/minui/graphics.h b/minui/graphics.h
index 5408c93e9..ff063ae23 100644
--- a/minui/graphics.h
+++ b/minui/graphics.h
@@ -40,8 +40,11 @@ class MinuiBackend {
// Blank (or unblank) the specific screen.
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.
- virtual ~MinuiBackend() {};
+ virtual ~MinuiBackend() = default;
};
#endif // _GRAPHICS_H_
diff --git a/minui/graphics_drm.cpp b/minui/graphics_drm.cpp
index c55702276..6c3a5bdee 100644
--- a/minui/graphics_drm.cpp
+++ b/minui/graphics_drm.cpp
@@ -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,
drmModeConnector* connector) {
// Find the encoder. If we already have one, just use it.
diff --git a/minui/graphics_drm.h b/minui/graphics_drm.h
index fe3beaff9..a8c9886e5 100644
--- a/minui/graphics_drm.h
+++ b/minui/graphics_drm.h
@@ -60,6 +60,7 @@ class MinuiBackendDrm : public MinuiBackend {
GRSurface* Flip() override;
void Blank(bool) override;
void Blank(bool blank, DrmConnector index) override;
+ bool HasMultipleConnectors() override;
private:
void DrmDisableCrtc(int drm_fd, drmModeCrtc* crtc);
diff --git a/minui/graphics_fbdev.cpp b/minui/graphics_fbdev.cpp
index 1cb0c0ab8..4a7d3252b 100644
--- a/minui/graphics_fbdev.cpp
+++ b/minui/graphics_fbdev.cpp
@@ -47,6 +47,11 @@ void MinuiBackendFbdev::Blank(bool blank, DrmConnector 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) {
if (n > 1 || !double_buffered) return;
diff --git a/minui/graphics_fbdev.h b/minui/graphics_fbdev.h
index 7e193c4ff..c772428dc 100644
--- a/minui/graphics_fbdev.h
+++ b/minui/graphics_fbdev.h
@@ -57,6 +57,7 @@ class MinuiBackendFbdev : public MinuiBackend {
GRSurface* Flip() override;
void Blank(bool) override;
void Blank(bool blank, DrmConnector index) override;
+ bool HasMultipleConnectors() override;
private:
void SetDisplayedFramebuffer(size_t n);
diff --git a/minui/include/minui/minui.h b/minui/include/minui/minui.h
index f9be82f52..2353ed3b9 100644
--- a/minui/include/minui/minui.h
+++ b/minui/include/minui/minui.h
@@ -129,6 +129,7 @@ int gr_fb_height();
void gr_flip();
void gr_fb_blank(bool blank);
void gr_fb_blank(bool blank, int index);
+bool gr_has_multiple_connectors();
// Clears entire surface to current color.
void gr_clear();