Commit graph

55 commits

Author SHA1 Message Date
Fabien Sanglard
f5068a8398 Add HWC_ERROR define to hwcomposer specification
Change-Id: I5feb85626ab356f88874616f0cf475022a91fc27
2016-11-16 11:14:59 -08:00
Colin Cross
cc8d9f9fcb Avoid C-style cast warnings
hardware/libhardware/include was being included with -isystem, which
hides warnings.  Use a macro to convert modules to hw_device_t** to call
the open function that works in C++ and C.

Bug: 32018017
Test: m -j
Change-Id: If68bf15581975f1217fcab366cef7bc784894641
2016-10-07 13:10:20 -07:00
Dan Stoza
4e9221bd87 Hardware Composer 2.0
Headers for version 2.0 of the Hardware Composer HAL

Change-Id: Ie5c26a11b20b7e8f8c752ca51d5cbaf2cbaa9a45
2016-01-28 14:16:22 -08:00
Dan Stoza
811445a3f3 HWC 1.5: Add per-layer damage region
This adds an array of rects to hwc_layer_1_t that define which
portions of that layer's source buffer have been modified. If there
are a non-zero number of rects, then any portion of the source buffer
not touched by one of the rects may safely be assumed to not have
been modified. If no rects are defined, then the whole source buffer
must be assumed to have been modified.

Change-Id: Id5efafee74602ed7d76609180e334ed203c23f7e
2015-02-25 13:42:18 -08:00
Riley Andrews
4a6788b02f Add interface for doing asynchonous cursor layer updates to hwcomposer
Change-Id: If2ab523b400cfb586c8e1fed98f2ebe3538c0419
2014-07-24 00:53:21 +00:00
Jeff Brown
842b906dd4 Add new HWC_POWER_MODE_DOZE_SUSPEND power state.
Change-Id: Ice194315bc51ca25732c9e30c809bd6b39f3718f
2014-07-18 21:28:19 -07:00
Dan Stoza
e83d10c1fc hwcomposer: Allow display configuration selection
Adds two functions to the HWC interface: one for querying the current
display configuration, and one for setting a new configuration. This
will enable DisplayManager to change the mode on demand.

Bug: 14320401
Change-Id: I556c509192b877b38b2103a78f937b3687f35546
2014-07-14 14:09:13 -07:00
Prashant Malani
0f0b6d5ccb Merge "hwcomposer: Add function pointer for setPowerMode() callback" 2014-06-10 21:44:22 +00:00
Prashant Malani
02b31986cb hwcomposer: Add function pointer for setPowerMode() callback
The blank HWC call is being replaced by a setPowerMode() call.
This incorporates all of the blank functionality, but provides added
support for display low power modes, if they are available in hardware.

Currently there are three supported modes:
- HWC_POWER_MODE_OFF    : Turn screen off.
- HWC_POWER_MODE_DOZE   : Put screen in low power mode.
- HWC_POWER_MODE_NORMAL : Turn screen on, and exit low power mode (if
                          display was previously in low power mode).

Where applicable, the device driver is expected to retain and restore
the low power mode state of the display during entry and exit from
suspend, respectively.

Bug: 13472578
Change-Id: I743ea3a2cb58247d14d7c47158b09a5309cca710
Signed-off-by: Prashant Malani <pmalani@google.com>
2014-06-12 17:11:03 +00:00
Dan Stoza
91699a82eb hwcomposer: Correct padding for 32/64-bit
The size of hwc_layer_1_t varies depending on whether we're building
for a 32- or 64-bit target. This change splits the padding into two
sections so that we can add more fields without changing the overall
size on either bitness.

Change-Id: Ib7c960a9feb0061586dc6398211d7d3dc012d573
2014-06-04 16:10:46 -07:00
Stewart Miles
84d35492b1 Described restrictions for common HAL object methods.
Inheritance of HAL object is performed by composing a child structure of a
single parent structure located at offset 0 followed by new data members
and function pointers in the child structure.

For example,

struct child {
  struct parent common;
  int a_data_member;
  void (*a_method)(struct child *c, int v);
};

HAL code assumes this layout when accessing child structures given a pointer
to a parent structure such that users write code like the following...

void child_method(struct *parent, int v) {
  struct child * c = (struct child*)parent;
  // do stuff with c
}

Code above will break if a member is added before "common" in "struct child".

This change adds comments that describe the restriction on the location of
parent HAL objects within a derived HAL object.  HAL objects that already
have comments that describe the required location of parent objects are not
modified.

Change-Id: Ibe4300275286ef275b2097534c84f1029d761d87
2014-05-12 12:35:37 -07:00
Jesse Hall
8c79c08578 Add HWC 1.4 with support for sideband video layers
Change-Id: Ie40668a8667e26f1d570a2f756f1178d0dcbbf5c
2014-03-11 12:02:11 -07:00
Rom Lemarchand
4c2aa4c223 HAL test: statically test the size of HAL structs
Ensure none of the HAL structs change size over time.
Issues might arise when making changes without taking the different
pointer sizes for specific architectures into account.

Change-Id: I63f00004a23f09b2f46df01e7c69296766a5d03f
2013-11-21 15:52:05 -08:00
Jesse Hall
7ccf148f50 Update HWC documentation for virtual displays
Bug: 8316155
Change-Id: I56598551b07082bfff90df160b103a4158e8c8c9
2013-11-13 14:48:15 -08:00
Jesse Hall
fc0ff2a870 Add HWC_DISPLAY_VIRTUAL and adjust display count constants
Both surfaceflinger and HWC implementations have been defining these
themselves, making future changes more difficult. Better to define
them centrally, where they can be updated easily.

Change-Id: I793158b858c84b2470b05f9ea77cc5a0c7e247f1
2013-08-16 11:13:36 -07:00
Mathias Agopian
3b4732c9d5 bump HWC version to 1.3, add support for float crop rectangle
Change-Id: I8601ecc9f39052000b872805be1637ee73b0d3e1
2013-07-10 15:03:00 -07:00
Jesse Hall
380f45dade Move virtual displays out of HWC 1.2, mark experimental
Bug: 8384764
Change-Id: I388ff3f46893b395e5c4187242f51ad7bb58da24
2013-05-07 12:03:27 -07:00
Mathias Agopian
e3e0a570a8 add support for plane-alpha in HWC
Change-Id: Ied228e689ca892c505fbd811fd2b8579287e4ac6
2013-02-04 20:47:13 -08:00
Jesse Hall
af05c912e1 am a8c06116: Merge "Remove remnants of HWC 0.x"
* commit 'a8c061169752cbaf335a35e49568b7fe7d7e83cd':
  Remove remnants of HWC 0.x
2013-01-14 09:49:11 -08:00
Jesse Hall
71b9c1fab9 Remove remnants of HWC 0.x
Change-Id: I85f4b95e8db44998abc07686a554d3e802a6a4a9
2013-01-10 18:17:14 -08:00
Mathias Agopian
48697f6dc2 Fix HWC documentation.
Specify more clearly the behavior of compositionType
and hints.

Change-Id: I9abdccedd904b2fba783381bf9e2f8975ede8d67
2012-11-20 15:23:25 -08:00
Jamie Gennis
c7545189c8 hwcomposer: Specify set() call error behavior.
Bug: 7308829
Change-Id: Ibab6f0d2929860f02c17d6ffadb326fc0c333c4d
2012-10-08 19:25:20 -07:00
Jesse Hall
d91697ab8f Document reentrancy and error conditions
The hotplug callback is non-reentrant. The display config functions
return an error if called for a disconnected display type.

Change-Id: I52d11a53f9b30a7c39e98b0a9b07eb97a3d2becd
2012-09-19 22:53:30 -07:00
Jesse Hall
6b01e2eaf7 Layer flags won't change between prepare and set
Change-Id: I0f25766976e4f783066e5b6fd917d1769906e43e
2012-09-14 17:21:22 -07:00
Jesse Hall
7cb03d79b3 Add outbuf fields for HWC 1.2 virtual displays
Also rename HWC_DISPLAY_RESOLUTION_* to HWC_DISPLAY_WIDTH and
HWC_DISPLAY_HEIGHT for consistency.

Change-Id: Iabe6db0816f6f6eaaac24c3c9ae554177bcabf1d
2012-09-12 09:41:57 -07:00
Jesse Hall
2c13759c61 Add new HWC 1.1 queries and hotplug callback
Change-Id: I40164e60b33174e98a3843ec99f1680b1bb1c675
2012-08-31 09:25:46 -07:00
Jesse Hall
0a0a41653d Simplify and clean up legacy decisions
During the HWC 0.x evolution, some fields were left optional or
organized strangely to avoid breaking backwards compatibility. Since
we're breaking it in the transition to HWC 1.0 anyway, we can clean
these up a little.

* The current callbacks are now registered immediately after the
  device is opened and guaranteed to be present, so the implementation
  can rely on them being present.

* The hwc_methods_t structure is gone, with its two methods folded
  into the main hwc_composer_device_1_t.

* All methods and callbacks are now required except dump(). New
  methods and callbacks we add in the future will still be optional
  for backwards compatibility.

Change-Id: I5d58774a5144016993c12df3dd6ad2a5d746bee9
2012-08-22 12:10:06 -07:00
Jesse Hall
43b51d9fdd Add NUM_DISPLAY_TYPES query and refine display list semantics
Change-Id: I740859bfa2b126edcdf06f7b2c8208770bc864f9
2012-08-22 12:10:06 -07:00
Jesse Hall
43923defb7 Merge "HWC 1.1: add FRAMEBUFFER_TARGET layer type" into jb-mr1-dev 2012-08-20 16:34:03 -07:00
Jesse Hall
d18c83fc04 HWC 1.1: add FRAMEBUFFER_TARGET layer type
Change-Id: I61965c343dceb4137bc439b49ea90ec13183b719
2012-08-16 16:21:13 -07:00
Colin Cross
705d2912b7 hwc: update blank documentation to specify that blank is synchronous
Change the documentation of the blank function in the hw composer to
specify that the screen state transition must be complete when the
function returns.

Change-Id: Ibd0a9cdef13991c36cabada5fc0e4f7bb8fa7af9
2012-08-16 14:46:45 -07:00
Jesse Hall
ac3f7e195c Simplify prepare and set semantics (comments only)
Documentation updated for semantic changes vs. HWC 0.x:

* Prepare won't be called with NULL pointers. This used to be used to
  disable hardware composition, though that wasn't documented. Now
  we'll call prepare with non-NULL pointers but the layer list will
  have zero layers.

* Set won't be called with NULL pointers. This used to cause the
  display to turn off; that is now done by calling the blank() method,
  which is no longer optional.

Change-Id: I9c69dc34f64e499a5ba5f8729836e7c216f8c733
2012-08-07 16:08:35 -07:00
Jesse Hall
f9d6cd7dee Add multi-display and flip fence to HWC
Change-Id: I3b0446050648e2b386ffb32976c9943b6fd9793d
2012-08-07 12:26:59 -07:00
Jesse Hall
85ab59a147 Revert "Add multi-display and flip fence to HWC"
This reverts commit 1d51b2b9fc713da6de18117bc19508ecdfde4f23

Change-Id: I1ae46d8cae1cb3064800cd24df56347b05eb6059
2012-07-31 12:16:24 -07:00
Jesse Hall
65bed1f947 Add multi-display and flip fence to HWC
Change-Id: I31b4fc293220bc51169971df93347dd35fdc30ef
2012-07-30 16:52:21 -07:00
Colin Cross
38fccf483b hwcomposer: add a new blank operation
Add a new blank operation to be called by surfaceflinger when the screen
turns on or off.  Also rev the API version to 1.1 for the new field.

Change-Id: I266fb33f66184538e34cfc319f63cf809dcb2f18
2012-07-13 15:49:04 -07:00
Jesse Hall
d479ad22a0 Introduce HWC_DEVICE_API_VERSION_1_0
The new version adds an acquire and release fence to each layer,
providing explicit producer->hwc and hwc->producer synchronization.

Change-Id: Ibd6e3c7b3515c012c767246e6d6514274fdef01d
2012-06-18 15:53:25 -07:00
Mathias Agopian
e291f71e0a split hwcomposer.h
hwcomposer_defs.h now contains enums, which are essentially names.
This won't change when we rev the h/w composer API (new ones will be added instead).

we do this to avoid having to abstract all these constants in higher
level APIs; instead hwcomposer_defs.h can be included without exposing
the hwcomposer's data structures (which are a lot more fragile wrt.
backward compatibility)

Change-Id: Ifb514f64de02a599fdd2d31c188327209ccb0ffc
2012-05-13 22:49:06 -07:00
Jamie Gennis
6b7adef0ef hwcomposer: clarify vsync timestamp meaning
This change clarifies the meaning of the HWC vsync timestamp to specify that
the timestamp must be relative to the system monotonic clock.

Change-Id: I4386ce90511fd5b8f8e988917da637d84d86f026
2012-04-30 12:57:11 -07:00
Mathias Agopian
eb67160b99 fix typo in documentation
Change-Id: I2c55034c25edd466180cd9c5718c2ad568aeedff
2012-04-24 15:42:37 -07:00
Mathias Agopian
6d3fec70d8 improve hwc VSYNC documentation
Change-Id: I5820d8fa183701ebbc0a825cf27bd0004b47d62e
2012-04-10 21:22:28 -07:00
Mathias Agopian
b08d45dff6 add support for VSYNC events in h/w composer HAL
Change-Id: Ic19a41ae522a236f45957e50c792934d987b116a
2012-04-03 11:45:41 -07:00
Mathias Agopian
81c323dd54 improve HWC versioning
Change-Id: Ieb50629f23c0d2b7af12c5541a8278a0979d2ee4
2012-03-25 01:11:43 -07:00
Mathias Agopian
eb8fb50814 add support for setting the background color
this is a revision of the h/w composer API. This change
is binary backward compatible.

Change-Id: Id4cf43447594db9049f7e2c44ea08157ca725129
2012-03-24 15:29:07 -07:00
Jamie Gennis
9c5466b616 HWComposer: update the hwc_layer::handle docs
Change-Id: I3c1211146b2e5f84546724c86f344bd2e63bd55c
2011-12-20 14:33:52 -08:00
Mathias Agopian
71212e3fca improve h/w composer documentation
Change-Id: Ia3f47c1750f5a436037e4391d6744d63639ee099
2011-11-21 17:35:15 -08:00
Mathias Agopian
fb410365ca improve hw composer documentation
Change-Id: I39363e37417991b9853309154d6691240e706acf
2011-11-16 16:05:56 -08:00
Mathias Agopian
d6afef62ff Add a h/w composer HAL API to allow the HAL to trigger a redraw
This is useful in various situations, for instance if the HAL
wants to change its compositing strategy.

Bug: 4488017
Change-Id: Idc410c689af30a2c9613dc3141e323d6e02a5648
2011-08-01 20:45:24 -07:00
Erik Gilling
158549c894 gralloc: add dump hooks to gralloc/hwcomposer
Change-Id: I27bf46103b4d1d547c42a6de4f3270a6dfd7b7ec
2010-12-08 15:31:40 -08:00
Erik Gilling
e99520400f gralloc: add padding to alloc_device_t and hwc_composer_device_t
also adds version #defines

Change-Id: I89f19fc7811ea9c9efb579a9f6abb4c3d9011bbf
2010-12-08 15:16:52 -08:00