summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew F. Davis2019-06-11 16:12:15 -0500
committerAndrew F. Davis2019-06-28 10:32:54 -0500
commite1169308505be6fa48f0243fd4c26e0fa3be13f4 (patch)
treec4e3fc8cec1d9c54f34e92f39d111ca3a5081879
parentbd3c633485b9a895acda7b42d311a4d31529f208 (diff)
downloadhardware-ti-am65x-e1169308505be6fa48f0243fd4c26e0fa3be13f4.tar.gz
hardware-ti-am65x-e1169308505be6fa48f0243fd4c26e0fa3be13f4.tar.xz
hardware-ti-am65x-e1169308505be6fa48f0243fd4c26e0fa3be13f4.zip
libhwcomposer: Remove unneeded is_overlay parameter from DRMFramebuffer
Checking the image buffer for extra planes should always be done and all callers of this constructor set this parameter to true. Remove the check for is_overlay and always take the true path. Signed-off-by: Andrew F. Davis <afd@ti.com>
-rw-r--r--libhwcomposer/display.cpp2
-rw-r--r--libhwcomposer/drmfb.cpp30
-rw-r--r--libhwcomposer/drmfb.h2
3 files changed, 16 insertions, 18 deletions
diff --git a/libhwcomposer/display.cpp b/libhwcomposer/display.cpp
index f5f094e..ccb1c02 100644
--- a/libhwcomposer/display.cpp
+++ b/libhwcomposer/display.cpp
@@ -164,7 +164,7 @@ int HWCDisplay::update_display(drm_plane_props_t* planeProp)
164 164
165 KMSDisplay* kdisp = &this->disp_link; 165 KMSDisplay* kdisp = &this->disp_link;
166 166
167 planeProp->fb_info = new DRMFramebuffer(kdisp->card->fd(), handle, false); 167 planeProp->fb_info = new DRMFramebuffer(kdisp->card->fd(), handle);
168 this->pending_fb_infos.push_back(planeProp->fb_info); 168 this->pending_fb_infos.push_back(planeProp->fb_info);
169 169
170 planeProp->crtc_id = kdisp->crtc->id(); 170 planeProp->crtc_id = kdisp->crtc->id();
diff --git a/libhwcomposer/drmfb.cpp b/libhwcomposer/drmfb.cpp
index 17ff42e..0c193d7 100644
--- a/libhwcomposer/drmfb.cpp
+++ b/libhwcomposer/drmfb.cpp
@@ -25,7 +25,7 @@
25#include "format.h" 25#include "format.h"
26#include "hal_public.h" 26#include "hal_public.h"
27 27
28DRMFramebuffer::DRMFramebuffer(int drm_fd, buffer_handle_t handle, bool is_overlay) : 28DRMFramebuffer::DRMFramebuffer(int drm_fd, buffer_handle_t handle) :
29 bo(), pitches(), offsets() 29 bo(), pitches(), offsets()
30{ 30{
31 if (!handle) 31 if (!handle)
@@ -47,21 +47,19 @@ DRMFramebuffer::DRMFramebuffer(int drm_fd, buffer_handle_t handle, bool is_overl
47 this->offsets[0] = 0; 47 this->offsets[0] = 0;
48 this->drm_fd = drm_fd; 48 this->drm_fd = drm_fd;
49 49
50 if (is_overlay) { 50 switch (this->format) {
51 switch (this->format) { 51 case DRM_FORMAT_NV12:
52 case DRM_FORMAT_NV12: 52 this->bo[1] = gem_handle;
53 this->bo[1] = gem_handle; 53 this->pitches[1] = this->pitches[0];
54 this->pitches[1] = this->pitches[0]; 54 this->offsets[1] = this->pitches[0] * img_hnd->iHeight;
55 this->offsets[1] = this->pitches[0] * img_hnd->iHeight; 55 break;
56 break; 56 case DRM_FORMAT_ARGB8888:
57 case DRM_FORMAT_ARGB8888: 57 case DRM_FORMAT_XRGB8888:
58 case DRM_FORMAT_XRGB8888: 58 case DRM_FORMAT_RGB565:
59 case DRM_FORMAT_RGB565: 59 break;
60 break; 60 default:
61 default: 61 ALOGE("Bad format for overlay");
62 ALOGE("Bad format for overlay"); 62 return;
63 return;
64 }
65 } 63 }
66 64
67 ret = drmModeAddFB2(drm_fd, this->width, this->height, 65 ret = drmModeAddFB2(drm_fd, this->width, this->height,
diff --git a/libhwcomposer/drmfb.h b/libhwcomposer/drmfb.h
index 1efff0d..3ad057d 100644
--- a/libhwcomposer/drmfb.h
+++ b/libhwcomposer/drmfb.h
@@ -21,7 +21,7 @@
21class DRMFramebuffer 21class DRMFramebuffer
22{ 22{
23 public: 23 public:
24 DRMFramebuffer(int drm_fd, buffer_handle_t handle, bool is_overlay); 24 DRMFramebuffer(int drm_fd, buffer_handle_t handle);
25 ~DRMFramebuffer(); 25 ~DRMFramebuffer();
26 26
27 uint32_t width; 27 uint32_t width;