[hwc] drm_hwcomposer: fix warnings on unused variables and parameters

Message ID 20171129162106.10541-1-robh@kernel.org
State New
Headers show
Series
  • [hwc] drm_hwcomposer: fix warnings on unused variables and parameters
Related show

Commit Message

Rob Herring Nov. 29, 2017, 4:21 p.m.
AOSP master now builds by default with -Werror, so fix all the warnings.
All the warnings are related to unused variables and parameters.

Signed-off-by: Rob Herring <robh@kernel.org>
---
 drmcrtc.cpp              | 7 +------
 drmcrtc.h                | 6 ------
 drmdisplaycompositor.cpp | 3 ---
 drmencoder.cpp           | 1 -
 drmencoder.h             | 2 --
 drmhwctwo.cpp            | 3 +--
 glworker.cpp             | 1 -
 platform.cpp             | 4 ++--
 8 files changed, 4 insertions(+), 23 deletions(-)

Comments

Robert Foss Nov. 30, 2017, 2:33 p.m. | #1
Hey Rob,

I applied and tested this patch, and it looks good to me.

Feel free to add my SB/TB.


Rob.

On Wed, 2017-11-29 at 10:21 -0600, Rob Herring wrote:
> AOSP master now builds by default with -Werror, so fix all the

> warnings.

> All the warnings are related to unused variables and parameters.

> 

> Signed-off-by: Rob Herring <robh@kernel.org>

> ---

>  drmcrtc.cpp              | 7 +------

>  drmcrtc.h                | 6 ------

>  drmdisplaycompositor.cpp | 3 ---

>  drmencoder.cpp           | 1 -

>  drmencoder.h             | 2 --

>  drmhwctwo.cpp            | 3 +--

>  glworker.cpp             | 1 -

>  platform.cpp             | 4 ++--

>  8 files changed, 4 insertions(+), 23 deletions(-)

> 

> diff --git a/drmcrtc.cpp b/drmcrtc.cpp

> index c1398699d40d..1b354fe3db61 100644

> --- a/drmcrtc.cpp

> +++ b/drmcrtc.cpp

> @@ -31,12 +31,7 @@ DrmCrtc::DrmCrtc(DrmResources *drm, drmModeCrtcPtr

> c, unsigned pipe)

>        id_(c->crtc_id),

>        pipe_(pipe),

>        display_(-1),

> -      x_(c->x),

> -      y_(c->y),

> -      width_(c->width),

> -      height_(c->height),

> -      mode_(&c->mode),

> -      mode_valid_(c->mode_valid) {

> +      mode_(&c->mode) {

>  }

>  

>  int DrmCrtc::Init() {

> diff --git a/drmcrtc.h b/drmcrtc.h

> index 2e8c8118a21d..c5a559968b87 100644

> --- a/drmcrtc.h

> +++ b/drmcrtc.h

> @@ -54,13 +54,7 @@ class DrmCrtc {

>    unsigned pipe_;

>    int display_;

>  

> -  uint32_t x_;

> -  uint32_t y_;

> -  uint32_t width_;

> -  uint32_t height_;

> -

>    DrmMode mode_;

> -  bool mode_valid_;

>  

>    DrmProperty active_property_;

>    DrmProperty mode_property_;

> diff --git a/drmdisplaycompositor.cpp b/drmdisplaycompositor.cpp

> index dceb78d452c4..acd13b834e2a 100644

> --- a/drmdisplaycompositor.cpp

> +++ b/drmdisplaycompositor.cpp

> @@ -490,8 +490,6 @@ int

> DrmDisplayCompositor::CommitFrame(DrmDisplayComposition

> *display_comp,

>    std::vector<DrmHwcLayer> &layers = display_comp->layers();

>    std::vector<DrmCompositionPlane> &comp_planes =

>        display_comp->composition_planes();

> -  std::vector<DrmCompositionRegion> &pre_comp_regions =

> -      display_comp->pre_comp_regions();

>    uint64_t out_fences[drm_->crtcs().size()];

>  

>    DrmConnector *connector = drm_->GetConnectorForDisplay(display_);

> @@ -681,7 +679,6 @@ int

> DrmDisplayCompositor::CommitFrame(DrmDisplayComposition

> *display_comp,

>      }

>    }

>  

> -out:

>    if (!ret) {

>      uint32_t flags = DRM_MODE_ATOMIC_ALLOW_MODESET;

>      if (test_only)

> diff --git a/drmencoder.cpp b/drmencoder.cpp

> index 1d4ebdc591ad..3d762f34919d 100644

> --- a/drmencoder.cpp

> +++ b/drmencoder.cpp

> @@ -27,7 +27,6 @@ DrmEncoder::DrmEncoder(drmModeEncoderPtr e, DrmCrtc

> *current_crtc,

>                         const std::vector<DrmCrtc *> &possible_crtcs)

>      : id_(e->encoder_id),

>        crtc_(current_crtc),

> -      type_(e->encoder_type),

>        possible_crtcs_(possible_crtcs) {

>  }

>  

> diff --git a/drmencoder.h b/drmencoder.h

> index ed3c21e1923c..58ccbfbc5004 100644

> --- a/drmencoder.h

> +++ b/drmencoder.h

> @@ -45,8 +45,6 @@ class DrmEncoder {

>    uint32_t id_;

>    DrmCrtc *crtc_;

>  

> -  uint32_t type_;

> -

>    std::vector<DrmCrtc *> possible_crtcs_;

>  };

>  }

> diff --git a/drmhwctwo.cpp b/drmhwctwo.cpp

> index 54824b8ce1af..5ab4595bce96 100644

> --- a/drmhwctwo.cpp

> +++ b/drmhwctwo.cpp

> @@ -242,7 +242,6 @@ HWC2::Error

> DrmHwcTwo::HwcDisplay::RegisterVsyncCallback(

>  

>  HWC2::Error DrmHwcTwo::HwcDisplay::AcceptDisplayChanges() {

>    supported(__func__);

> -  uint32_t num_changes = 0;

>    for (std::pair<const hwc2_layer_t, DrmHwcTwo::HwcLayer> &l :

> layers_)

>      l.second.accept_type_change();

>    return HWC2::Error::None;

> @@ -614,7 +613,7 @@ HWC2::Error

> DrmHwcTwo::HwcDisplay::SetActiveConfig(hwc2_config_t config) {

>  HWC2::Error DrmHwcTwo::HwcDisplay::SetClientTarget(buffer_handle_t

> target,

>                                                     int32_t

> acquire_fence,

>                                                     int32_t

> dataspace,

> -                                                   hwc_region_t

> damage) {

> +                                                   hwc_region_t

> /*damage*/) {

>    supported(__func__);

>    UniqueFd uf(acquire_fence);

>  

> diff --git a/glworker.cpp b/glworker.cpp

> index e90576a75f1a..ca726bf573ba 100644

> --- a/glworker.cpp

> +++ b/glworker.cpp

> @@ -478,7 +478,6 @@ int GLWorkerCompositor::Init() {

>    const char *egl_extensions;

>    const char *gl_extensions;

>    EGLint num_configs;

> -  EGLint attribs[] = {EGL_WIDTH, 1, EGL_HEIGHT, 1, EGL_NONE,

> EGL_NONE};

>    EGLConfig egl_config;

>  

>    // clang-format off

> diff --git a/platform.cpp b/platform.cpp

> index e920872fa180..56ab37e12d94 100644

> --- a/platform.cpp

> +++ b/platform.cpp

> @@ -142,8 +142,8 @@ int PlanStageProtected::ProvisionPlanes(

>  

>  int PlanStagePrecomp::ProvisionPlanes(

>      std::vector<DrmCompositionPlane> *composition,

> -    std::map<size_t, DrmHwcLayer *> &layers, DrmCrtc *crtc,

> -    std::vector<DrmPlane *> *planes) {

> +    std::map<size_t, DrmHwcLayer *> &layers, DrmCrtc * /*crtc*/,

> +    std::vector<DrmPlane *> * /*planes*/) {

>    DrmCompositionPlane *precomp = GetPrecomp(composition);

>    if (!precomp || precomp->source_layers().empty())

>      return 0;

Patch

diff --git a/drmcrtc.cpp b/drmcrtc.cpp
index c1398699d40d..1b354fe3db61 100644
--- a/drmcrtc.cpp
+++ b/drmcrtc.cpp
@@ -31,12 +31,7 @@  DrmCrtc::DrmCrtc(DrmResources *drm, drmModeCrtcPtr c, unsigned pipe)
       id_(c->crtc_id),
       pipe_(pipe),
       display_(-1),
-      x_(c->x),
-      y_(c->y),
-      width_(c->width),
-      height_(c->height),
-      mode_(&c->mode),
-      mode_valid_(c->mode_valid) {
+      mode_(&c->mode) {
 }
 
 int DrmCrtc::Init() {
diff --git a/drmcrtc.h b/drmcrtc.h
index 2e8c8118a21d..c5a559968b87 100644
--- a/drmcrtc.h
+++ b/drmcrtc.h
@@ -54,13 +54,7 @@  class DrmCrtc {
   unsigned pipe_;
   int display_;
 
-  uint32_t x_;
-  uint32_t y_;
-  uint32_t width_;
-  uint32_t height_;
-
   DrmMode mode_;
-  bool mode_valid_;
 
   DrmProperty active_property_;
   DrmProperty mode_property_;
diff --git a/drmdisplaycompositor.cpp b/drmdisplaycompositor.cpp
index dceb78d452c4..acd13b834e2a 100644
--- a/drmdisplaycompositor.cpp
+++ b/drmdisplaycompositor.cpp
@@ -490,8 +490,6 @@  int DrmDisplayCompositor::CommitFrame(DrmDisplayComposition *display_comp,
   std::vector<DrmHwcLayer> &layers = display_comp->layers();
   std::vector<DrmCompositionPlane> &comp_planes =
       display_comp->composition_planes();
-  std::vector<DrmCompositionRegion> &pre_comp_regions =
-      display_comp->pre_comp_regions();
   uint64_t out_fences[drm_->crtcs().size()];
 
   DrmConnector *connector = drm_->GetConnectorForDisplay(display_);
@@ -681,7 +679,6 @@  int DrmDisplayCompositor::CommitFrame(DrmDisplayComposition *display_comp,
     }
   }
 
-out:
   if (!ret) {
     uint32_t flags = DRM_MODE_ATOMIC_ALLOW_MODESET;
     if (test_only)
diff --git a/drmencoder.cpp b/drmencoder.cpp
index 1d4ebdc591ad..3d762f34919d 100644
--- a/drmencoder.cpp
+++ b/drmencoder.cpp
@@ -27,7 +27,6 @@  DrmEncoder::DrmEncoder(drmModeEncoderPtr e, DrmCrtc *current_crtc,
                        const std::vector<DrmCrtc *> &possible_crtcs)
     : id_(e->encoder_id),
       crtc_(current_crtc),
-      type_(e->encoder_type),
       possible_crtcs_(possible_crtcs) {
 }
 
diff --git a/drmencoder.h b/drmencoder.h
index ed3c21e1923c..58ccbfbc5004 100644
--- a/drmencoder.h
+++ b/drmencoder.h
@@ -45,8 +45,6 @@  class DrmEncoder {
   uint32_t id_;
   DrmCrtc *crtc_;
 
-  uint32_t type_;
-
   std::vector<DrmCrtc *> possible_crtcs_;
 };
 }
diff --git a/drmhwctwo.cpp b/drmhwctwo.cpp
index 54824b8ce1af..5ab4595bce96 100644
--- a/drmhwctwo.cpp
+++ b/drmhwctwo.cpp
@@ -242,7 +242,6 @@  HWC2::Error DrmHwcTwo::HwcDisplay::RegisterVsyncCallback(
 
 HWC2::Error DrmHwcTwo::HwcDisplay::AcceptDisplayChanges() {
   supported(__func__);
-  uint32_t num_changes = 0;
   for (std::pair<const hwc2_layer_t, DrmHwcTwo::HwcLayer> &l : layers_)
     l.second.accept_type_change();
   return HWC2::Error::None;
@@ -614,7 +613,7 @@  HWC2::Error DrmHwcTwo::HwcDisplay::SetActiveConfig(hwc2_config_t config) {
 HWC2::Error DrmHwcTwo::HwcDisplay::SetClientTarget(buffer_handle_t target,
                                                    int32_t acquire_fence,
                                                    int32_t dataspace,
-                                                   hwc_region_t damage) {
+                                                   hwc_region_t /*damage*/) {
   supported(__func__);
   UniqueFd uf(acquire_fence);
 
diff --git a/glworker.cpp b/glworker.cpp
index e90576a75f1a..ca726bf573ba 100644
--- a/glworker.cpp
+++ b/glworker.cpp
@@ -478,7 +478,6 @@  int GLWorkerCompositor::Init() {
   const char *egl_extensions;
   const char *gl_extensions;
   EGLint num_configs;
-  EGLint attribs[] = {EGL_WIDTH, 1, EGL_HEIGHT, 1, EGL_NONE, EGL_NONE};
   EGLConfig egl_config;
 
   // clang-format off
diff --git a/platform.cpp b/platform.cpp
index e920872fa180..56ab37e12d94 100644
--- a/platform.cpp
+++ b/platform.cpp
@@ -142,8 +142,8 @@  int PlanStageProtected::ProvisionPlanes(
 
 int PlanStagePrecomp::ProvisionPlanes(
     std::vector<DrmCompositionPlane> *composition,
-    std::map<size_t, DrmHwcLayer *> &layers, DrmCrtc *crtc,
-    std::vector<DrmPlane *> *planes) {
+    std::map<size_t, DrmHwcLayer *> &layers, DrmCrtc * /*crtc*/,
+    std::vector<DrmPlane *> * /*planes*/) {
   DrmCompositionPlane *precomp = GetPrecomp(composition);
   if (!precomp || precomp->source_layers().empty())
     return 0;