drm_hwcomposer: Clean up Backend interface
Backend::Validate function signature reflects the corresponding HWC2 function signature. The return value and arguments are redundant. - Remove the return value, since Validate never fails and it wasn't used anyways. - Remove the out params, since the same information can be (and is) determined by comparing the SfType and ValidatedType for each layer Change-Id: I659f7e0b03f183c38ca0a6996c0546eb263e7b99 Signed-off-by: Drew Davenport <ddavenport@google.com>
This commit is contained in:
parent
001432a693
commit
9de3f5cdd3
6 changed files with 8 additions and 28 deletions
|
|
@ -41,11 +41,7 @@ HwcLayer *GetCursorLayer(const std::vector<HwcLayer *> &layers) {
|
|||
|
||||
} // namespace
|
||||
|
||||
HWC2::Error Backend::ValidateDisplay(HwcDisplay *display, uint32_t *num_types,
|
||||
uint32_t *num_requests) {
|
||||
*num_types = 0;
|
||||
*num_requests = 0;
|
||||
|
||||
void Backend::ValidateDisplay(HwcDisplay *display) {
|
||||
auto layers = display->GetOrderLayersByZPos();
|
||||
|
||||
auto flatcon = display->GetFlatCon();
|
||||
|
|
@ -59,8 +55,7 @@ HWC2::Error Backend::ValidateDisplay(HwcDisplay *display, uint32_t *num_types,
|
|||
if (should_flatten) {
|
||||
display->total_stats().frames_flattened_++;
|
||||
MarkValidated(layers, 0, layers.size(), /*use_cursor_plane=*/false);
|
||||
*num_types = layers.size();
|
||||
return HWC2::Error::HasChanges;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -108,14 +103,12 @@ HWC2::Error Backend::ValidateDisplay(HwcDisplay *display, uint32_t *num_types,
|
|||
MarkValidated(layers, client_start, client_size, use_cursor_plane);
|
||||
}
|
||||
|
||||
*num_types = client_size;
|
||||
display->total_stats().gpu_pixops_ += CalcPixOps(layers, client_start,
|
||||
client_size);
|
||||
display->total_stats().total_pixops_ += CalcPixOps(layers, 0, layers.size());
|
||||
if (use_cursor_plane) {
|
||||
++display->total_stats().cursor_plane_frames_;
|
||||
}
|
||||
return *num_types != 0 ? HWC2::Error::HasChanges : HWC2::Error::None;
|
||||
}
|
||||
|
||||
std::tuple<int, size_t> Backend::GetClientLayers(
|
||||
|
|
|
|||
|
|
@ -23,8 +23,7 @@ namespace android {
|
|||
class Backend {
|
||||
public:
|
||||
virtual ~Backend() = default;
|
||||
virtual HWC2::Error ValidateDisplay(HwcDisplay *display, uint32_t *num_types,
|
||||
uint32_t *num_requests);
|
||||
virtual void ValidateDisplay(HwcDisplay *display);
|
||||
virtual std::tuple<int, size_t> GetClientLayers(
|
||||
HwcDisplay *display, const std::vector<HwcLayer *> &layers,
|
||||
bool use_cursor_plane);
|
||||
|
|
|
|||
|
|
@ -20,14 +20,10 @@
|
|||
|
||||
namespace android {
|
||||
|
||||
HWC2::Error BackendClient::ValidateDisplay(HwcDisplay *display,
|
||||
uint32_t *num_types,
|
||||
uint32_t * /*num_requests*/) {
|
||||
void BackendClient::ValidateDisplay(HwcDisplay *display) {
|
||||
for (auto &[layer_handle, layer] : display->layers()) {
|
||||
layer.SetValidatedType(HWC2::Composition::Client);
|
||||
++*num_types;
|
||||
}
|
||||
return HWC2::Error::HasChanges;
|
||||
}
|
||||
|
||||
// clang-format off
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ namespace android {
|
|||
|
||||
class BackendClient : public Backend {
|
||||
public:
|
||||
HWC2::Error ValidateDisplay(HwcDisplay *display, uint32_t *num_types,
|
||||
uint32_t *num_requests) override;
|
||||
void ValidateDisplay(HwcDisplay *display) override;
|
||||
};
|
||||
} // namespace android
|
||||
|
|
|
|||
|
|
@ -42,8 +42,6 @@ class BackendManager {
|
|||
BackendConstructorT backend_constructor);
|
||||
int SetBackendForDisplay(HwcDisplay *display);
|
||||
std::unique_ptr<Backend> GetBackendByName(std::string &name);
|
||||
HWC2::Error ValidateDisplay(HwcDisplay *display, uint32_t *num_types,
|
||||
uint32_t *num_requests);
|
||||
|
||||
private:
|
||||
BackendManager() = default;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue