Home | History | Annotate | Download | only in anniedale
      1 /*
      2 // Copyright(c)2014 IntelCorporation
      3 //
      4 // LicensedundertheApacheLicense,Version2.0(the"License");
      5 // youmaynotusethisfileexceptincompliancewiththeLicense.
      6 // YoumayobtainacopyoftheLicenseat
      7 //
      8 // http://www.apache.org/licenses/LICENSE-2.0
      9 //
     10 // Unlessrequiredbyapplicablelaworagreedtoinwriting,software
     11 // distributedundertheLicenseisdistributedonan"ASIS"BASIS,
     12 // WITHOUTWARRANTIESORCONDITIONSOFANYKIND,eitherexpressorimplied.
     13 // SeetheLicenseforthespecificlanguagegoverningpermissionsand
     14 // limitationsundertheLicense.
     15 */
     16 #ifndef ANN_OVERLAY_PLANE_H
     17 #define ANN_OVERLAY_PLANE_H
     18 
     19 #include <utils/KeyedVector.h>
     20 #include <hal_public.h>
     21 #include <DisplayPlane.h>
     22 #include <BufferMapper.h>
     23 #include <ips/common/Wsbm.h>
     24 #include <ips/common/OverlayPlaneBase.h>
     25 #include <ips/common/RotationBufferProvider.h>
     26 
     27 namespace android {
     28 namespace intel {
     29 
     30 class AnnOverlayPlane : public OverlayPlaneBase {
     31 public:
     32     AnnOverlayPlane(int index, int disp);
     33     virtual ~AnnOverlayPlane();
     34 
     35     bool setDataBuffer(uint32_t handle);
     36 
     37     virtual void setTransform(int transform);
     38     virtual void setZOrderConfig(ZOrderConfig& config, void *nativeConfig);
     39 
     40     // plane operations
     41     virtual bool flip(void *ctx);
     42     virtual bool reset();
     43     virtual bool enable();
     44     virtual bool disable();
     45     virtual void postFlip();
     46     virtual void* getContext() const;
     47     virtual bool initialize(uint32_t bufferCount);
     48     virtual void deinitialize();
     49     virtual bool rotatedBufferReady(BufferMapper& mapper, BufferMapper* &rotatedMapper);
     50     virtual bool useOverlayRotation(BufferMapper& mapper);
     51 
     52 private:
     53     void signalVideoRotation(BufferMapper& mapper);
     54     bool isSettingRotBitAllowed();
     55 protected:
     56     virtual bool setDataBuffer(BufferMapper& mapper);
     57     virtual bool flush(uint32_t flags);
     58     virtual bool bufferOffsetSetup(BufferMapper& mapper);
     59     virtual bool coordinateSetup(BufferMapper& mapper);
     60     virtual bool scalingSetup(BufferMapper& mapper);
     61 
     62     virtual void resetBackBuffer(int buf);
     63 
     64     RotationBufferProvider *mRotationBufProvider;
     65 
     66     // rotation config
     67     uint32_t mRotationConfig;
     68     // z order config
     69     uint32_t mZOrderConfig;
     70     bool mUseOverlayRotation;
     71     // hardware context
     72     struct intel_dc_plane_ctx mContext;
     73 
     74 };
     75 
     76 } // namespace intel
     77 } // namespace android
     78 
     79 #endif /* ANN_OVERLAY_PLANE_H */
     80 
     81