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_RGB_PLANE_H
     17 #define ANN_RGB_PLANE_H
     18 
     19 #include <utils/KeyedVector.h>
     20 #include <Hwcomposer.h>
     21 #include <common/buffers/BufferCache.h>
     22 #include <DisplayPlane.h>
     23 
     24 #include <linux/psb_drm.h>
     25 
     26 namespace android {
     27 namespace intel {
     28 
     29 class AnnRGBPlane : public DisplayPlane {
     30 public:
     31     AnnRGBPlane(int index, int type, int disp);
     32     virtual ~AnnRGBPlane();
     33 public:
     34     // hardware operations
     35     bool enable();
     36     bool disable();
     37     bool reset();
     38     bool isDisabled();
     39     bool flip(void *ctx);
     40     void postFlip();
     41 
     42     void* getContext() const;
     43     void setZOrderConfig(ZOrderConfig& config, void *nativeConfig);
     44 
     45     bool setDataBuffer(uint32_t handle);
     46 protected:
     47     bool setDataBuffer(BufferMapper& mapper);
     48     bool enablePlane(bool enabled);
     49 private:
     50     void setFramebufferTarget(uint32_t handle);
     51 protected:
     52     struct intel_dc_plane_ctx mContext;
     53 
     54 private:
     55     // scaling buffer vector max size
     56     enum {
     57         MAX_SCALING_BUF_COUNT = 3,
     58     };
     59     KeyedVector<uint32_t, uint32_t> mScalingBufferMap;
     60 };
     61 
     62 } // namespace intel
     63 } // namespace android
     64 
     65 #endif /* ANN_RGB_PLANE_H */
     66