~hikiko/mir/mir.unity8-desktop-session

« back to all changes in this revision

Viewing changes to src/server/compositor/switching_bundle.h

  • Committer: Package Import Robot
  • Author(s): Ubuntu daily release, Daniel van Vugt, Ubuntu daily release
  • Date: 2013-11-20 07:36:15 UTC
  • mfrom: (1.1.52)
  • Revision ID: package-import@ubuntu.com-20131120073615-47my1n59hszj1y6z
Tags: 0.1.1+14.04.20131120-0ubuntu1
[ Daniel van Vugt ]
* New upstream release 0.1.1
  - Add unit tests for V/H scroll events.
  - surfaces: avoid publishing some internal headers, tidy up default
    configuration, integrate surfaces report.
  - client: Add mir_connection_drm_set_gbm_device()
  - graphics: avoid publishing some internal headers.
  - Fixed: unity-system-compositor FTBFS on trusty against new Mir
    (libmirserver9) (LP: #1244192)
  - compositor: avoid publishing some internal headers.
  - shell: Add set_lifecycle_state() to the Session interface.
  - frontend: avoid publishing some internal headers
  - logging: avoid publishing some internal headers.
  - Allow specifying the nested server name by passing --name= or setting
    MIR_SERVER_NAME=.
  - graphics,gbm: Inform the EGL platform about the used gbm device when
    using the native GBM platform
  - examples: Restore GL state after initializing buffers, fixing crashes 
    observed in render_surfaces (LP: #1234563)
  - Continue refactoring the mir android display classes.
  - shell: Hoist focus control functions needed by unity-mir into
    FocusController interface
  - client: Remove the timeout for detecting server crashes
  - Avoid a race condition that could lead to spurious failures of server
    shutdown tests (LP: #1245336)
  - test_client_input.cpp: Bump reception time-out in client test fixture.
    (LP: #1227683)
  - Ensure StubBufferAllocator returns buffers with the properties requested,
    and not the same old hardcoded constants.
  - Update docs and scripting for trusty.
  - compositor: Make DefaultDisplayBufferCompositorFactory private to the
    compositor component.
  - Ignore warnings clang treats as errors, about unused functions being
    generated from macros in <lttng/tracepoint.h> (LP: #1246590)
  - Add resize() support to BufferBundle. This is the first step and lowest
    level of surface resize support.
  - Clean up constants relating to SwitchingBundle.
  - Fix the armhf chroot setup script to point to the right library, so
    cross compiling can work again (LP: #1246975)
  - shell: avoid publishing some internal headers.
  - input: avoid publishing some internal headers.
* Bump timeouts used in socket testing. It seems 100ms isn't always
  enough, which leads to spurious test failures (LP: #1252144) (LP:
  #1252144)
* Fix uninitialized variable causing random drm_auth_magic test
  failures. (LP: #1252144). (LP: #1252144)

[ Ubuntu daily release ]
* Automatic snapshot from revision 1165

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
class SwitchingBundle : public BufferBundle 
39
39
{
40
40
public:
 
41
    enum {min_buffers = 1, max_buffers = 5};
 
42
 
41
43
    SwitchingBundle(int nbuffers,
42
44
                    const std::shared_ptr<graphics::GraphicBufferAllocator> &,
43
45
                    const graphics::BufferProperties &);
55
57
    void allow_framedropping(bool dropping_allowed);
56
58
    bool framedropping_allowed() const;
57
59
 
 
60
    /**
 
61
     * Change the dimensions of the buffers contained in the bundle. For
 
62
     * client_acquire, the change is guaranteed to be immediate. For
 
63
     * compositors and snapshotters however, the change may be delayed by
 
64
     * nbuffers frames while old frames of the old size are consumed.
 
65
     */
 
66
    void resize(const geometry::Size &newsize) override;
 
67
 
58
68
private:
59
69
    graphics::BufferProperties bundle_properties;
60
70
    std::shared_ptr<graphics::GraphicBufferAllocator> gralloc;
68
78
 
69
79
    const std::shared_ptr<graphics::Buffer> &alloc_buffer(int slot);
70
80
 
71
 
    enum {MAX_NBUFFERS = 5};
72
81
    struct SharedBuffer
73
82
    {
74
83
        std::shared_ptr<graphics::Buffer> buf;
75
84
        int users = 0; // presently just a count of compositors sharing the buf
76
85
    };
77
 
    SharedBuffer ring[MAX_NBUFFERS];
 
86
    SharedBuffer ring[max_buffers];
78
87
 
79
88
    const int nbuffers;
80
89
    int first_compositor;
86
95
    int snapshot;
87
96
    int nsnapshotters;
88
97
 
89
 
    std::mutex guard;
 
98
    mutable std::mutex guard;
90
99
    std::condition_variable cond;
91
100
 
92
101
    unsigned long last_consumed;