Commit graph

3 commits

Author SHA1 Message Date
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
Naseer Ahmed
88ef190fcf hardware: Add field for number of framebuffers supported
Change-Id: Iec29018a956d2c048ce077c48fd3995a4ca6f72a
2012-07-09 22:09:13 -07:00
Mathias Agopian
5337b10289 split fb.h out of gralloc.h
fb and gralloc are part of the same HAL for now,
but for clarity we split them into these two headers.

Change-Id: I8e9e3068e47f0d94dd7c145d72fdc2e9fff24af5
2011-05-12 16:21:49 -07:00