X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fui%2Fozone%2Fplatform%2Fdri%2Fhardware_display_controller.h;h=3a948f63b29baadefaa8c2354eef4e83ade5f18e;hb=1afa4dd80ef85af7c90efaea6959db1d92330844;hp=b26654d066eb9365d48f4bef061325e42ff0e6bc;hpb=90762837333c13ccf56f2ad88e4481fc71e8d281;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/ui/ozone/platform/dri/hardware_display_controller.h b/src/ui/ozone/platform/dri/hardware_display_controller.h index b26654d..3a948f6 100644 --- a/src/ui/ozone/platform/dri/hardware_display_controller.h +++ b/src/ui/ozone/platform/dri/hardware_display_controller.h @@ -14,7 +14,7 @@ #include "base/memory/scoped_ptr.h" #include "base/memory/scoped_vector.h" #include "base/memory/weak_ptr.h" -#include "ui/ozone/platform/dri/dri_wrapper.h" +#include "ui/ozone/platform/dri/overlay_plane.h" namespace gfx { class Point; @@ -22,31 +22,9 @@ class Point; namespace ui { -class CrtcState; +class CrtcController; class ScanoutBuffer; -struct OverlayPlane { - // Simpler constructor for the primary plane. - explicit OverlayPlane(scoped_refptr buffer); - - OverlayPlane(scoped_refptr buffer, - int z_order, - gfx::OverlayTransform plane_transform, - const gfx::Rect& display_bounds, - const gfx::RectF& crop_rect); - - ~OverlayPlane(); - - scoped_refptr buffer; - int z_order; - gfx::OverlayTransform plane_transform; - gfx::Rect display_bounds; - gfx::RectF crop_rect; - int overlay_plane; -}; - -typedef std::vector OverlayPlaneList; - // The HDCOz will handle modesettings and scannout operations for hardware // devices. // @@ -104,9 +82,7 @@ typedef std::vector OverlayPlaneList; class HardwareDisplayController : public base::SupportsWeakPtr { public: - HardwareDisplayController(DriWrapper* drm, - scoped_ptr state); - + explicit HardwareDisplayController(scoped_ptr controller); ~HardwareDisplayController(); // Performs the initial CRTC configuration. If successful, it will display the @@ -144,26 +120,16 @@ class HardwareDisplayController // BeginFrame can be triggered explicitly by Ozone. void WaitForPageFlipEvent(); - // Called when the page flip event occurred. The event is provided by the - // kernel when a VBlank event finished. This allows the controller to - // update internal state and propagate the update to the surface. - // The tuple (seconds, useconds) represents the event timestamp. |seconds| - // represents the number of seconds while |useconds| represents the - // microseconds (< 1 second) in the timestamp. - void OnPageFlipEvent(unsigned int frame, - unsigned int seconds, - unsigned int useconds); - // Set the hardware cursor to show the contents of |surface|. - bool SetCursor(scoped_refptr buffer); + bool SetCursor(const scoped_refptr& buffer); bool UnsetCursor(); // Moves the hardware cursor to |location|. bool MoveCursor(const gfx::Point& location); - void AddCrtc(scoped_ptr state); - scoped_ptr RemoveCrtc(uint32_t crtc); + void AddCrtc(scoped_ptr controller); + scoped_ptr RemoveCrtc(uint32_t crtc); bool HasCrtc(uint32_t crtc) const; bool IsMirrored() const; bool IsDisabled() const; @@ -173,43 +139,27 @@ class HardwareDisplayController void set_origin(const gfx::Point& origin) { origin_ = origin; } const drmModeModeInfo& get_mode() const { return mode_; }; - uint64_t get_time_of_last_flip() const { - return time_of_last_flip_; - }; - private: - bool ModesetCrtc(const scoped_refptr& buffer, - drmModeModeInfo mode, - CrtcState* state); - - bool SchedulePageFlipOnCrtc(const OverlayPlaneList& overlays, - CrtcState* state); + uint64_t GetTimeOfLastFlip() const; + private: // Buffers need to be declared first so that they are destroyed last. Needed // since the controllers may reference the buffers. OverlayPlaneList current_planes_; OverlayPlaneList pending_planes_; scoped_refptr cursor_buffer_; - // Object containing the connection to the graphics device and wraps the API - // calls to control it. - DriWrapper* drm_; - // Stores the CRTC configuration. This is used to identify monitors and // configure them. - ScopedVector crtc_states_; + ScopedVector crtc_controllers_; + + // Location of the controller on the screen. gfx::Point origin_; + + // The mode used by the last modesetting operation. drmModeModeInfo mode_; + bool is_disabled_; - uint64_t time_of_last_flip_; - - // Keeps track of the number of page flips scheduled but not yet serviced (in - // mirror mode each CRTC schedules its own page flip event). This value is - // changed as follows: - // 1) incremented when a successful SchedulePageFlipOnController() occurrs, - // 2) decremented when the page flip callback is triggered, - // 3) reset to 0 when a drmModeSetCrtc is called (via the DriWrapper). - uint32_t pending_page_flips_; DISALLOW_COPY_AND_ASSIGN(HardwareDisplayController); };