2010-08-06 00:24:35 +02:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2010 The Android Open Source Project
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef ANDROID_INCLUDE_HARDWARE_HWCOMPOSER_H
|
|
|
|
#define ANDROID_INCLUDE_HARDWARE_HWCOMPOSER_H
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <sys/cdefs.h>
|
|
|
|
|
2010-12-01 21:25:00 +01:00
|
|
|
#include <hardware/gralloc.h>
|
2010-08-06 00:24:35 +02:00
|
|
|
#include <hardware/hardware.h>
|
|
|
|
#include <cutils/native_handle.h>
|
|
|
|
|
2012-05-14 07:49:06 +02:00
|
|
|
#include <hardware/hwcomposer_defs.h>
|
|
|
|
|
2010-08-06 00:24:35 +02:00
|
|
|
__BEGIN_DECLS
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
2010-12-08 03:46:04 +01:00
|
|
|
|
2012-06-06 08:41:37 +02:00
|
|
|
/* for compatibility */
|
2012-03-24 23:56:29 +01:00
|
|
|
#define HWC_MODULE_API_VERSION HWC_MODULE_API_VERSION_0_1
|
|
|
|
#define HWC_DEVICE_API_VERSION HWC_DEVICE_API_VERSION_0_1
|
2012-03-25 10:09:35 +02:00
|
|
|
#define HWC_API_VERSION HWC_DEVICE_API_VERSION
|
2010-12-08 03:46:04 +01:00
|
|
|
|
2012-06-06 08:41:37 +02:00
|
|
|
/* Users of this header can define HWC_REMOVE_DEPRECATED_VERSIONS to test that
|
|
|
|
* they still work with just the current version declared, before the
|
|
|
|
* deprecated versions are actually removed.
|
|
|
|
*
|
|
|
|
* To find code that still depends on the old versions, set the #define to 1
|
|
|
|
* here. Code that explicitly sets it to zero (rather than simply not defining
|
|
|
|
* it) will still see the old versions.
|
|
|
|
*/
|
|
|
|
#if !defined(HWC_REMOVE_DEPRECATED_VERSIONS)
|
|
|
|
#define HWC_REMOVE_DEPRECATED_VERSIONS 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
2010-08-06 00:24:35 +02:00
|
|
|
/**
|
|
|
|
* The id of this module
|
|
|
|
*/
|
|
|
|
#define HWC_HARDWARE_MODULE_ID "hwcomposer"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Name of the sensors device to open
|
|
|
|
*/
|
|
|
|
#define HWC_HARDWARE_COMPOSER "composer"
|
|
|
|
|
2012-06-06 08:41:37 +02:00
|
|
|
struct hwc_composer_device_1;
|
|
|
|
typedef struct hwc_methods_1 {
|
2012-03-24 23:56:29 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* eventControl(..., event, enabled)
|
2012-07-31 23:29:00 +02:00
|
|
|
* Enables or disables h/w composer events for a display.
|
2012-03-24 23:56:29 +01:00
|
|
|
*
|
|
|
|
* eventControl can be called from any thread and takes effect
|
|
|
|
* immediately.
|
|
|
|
*
|
|
|
|
* Supported events are:
|
|
|
|
* HWC_EVENT_VSYNC
|
|
|
|
*
|
|
|
|
* returns -EINVAL if the "event" parameter is not one of the value above
|
|
|
|
* or if the "enabled" parameter is not 0 or 1.
|
|
|
|
*/
|
|
|
|
int (*eventControl)(
|
2012-07-31 23:29:00 +02:00
|
|
|
struct hwc_composer_device_1* dev, int dpy,
|
|
|
|
int event, int enabled);
|
2012-03-24 23:56:29 +01:00
|
|
|
|
2012-07-13 02:54:59 +02:00
|
|
|
/*
|
|
|
|
* blank(..., blank)
|
2012-07-31 23:29:00 +02:00
|
|
|
* Blanks or unblanks a display's screen.
|
2012-07-13 02:54:59 +02:00
|
|
|
*
|
|
|
|
* Turns the screen off when blank is nonzero, on when blank is zero.
|
2012-08-01 00:18:32 +02:00
|
|
|
* Multiple sequential calls with the same blank value must be supported.
|
2012-07-13 02:54:59 +02:00
|
|
|
*
|
|
|
|
* returns 0 on success, negative on error.
|
|
|
|
*/
|
2012-07-31 23:29:00 +02:00
|
|
|
int (*blank)(struct hwc_composer_device_1* dev, int dpy, int blank);
|
2012-07-13 02:54:59 +02:00
|
|
|
|
2012-06-06 08:41:37 +02:00
|
|
|
} hwc_methods_1_t;
|
2012-03-24 23:56:29 +01:00
|
|
|
|
2010-08-06 00:24:35 +02:00
|
|
|
typedef struct hwc_rect {
|
|
|
|
int left;
|
|
|
|
int top;
|
|
|
|
int right;
|
|
|
|
int bottom;
|
|
|
|
} hwc_rect_t;
|
|
|
|
|
|
|
|
typedef struct hwc_region {
|
|
|
|
size_t numRects;
|
|
|
|
hwc_rect_t const* rects;
|
|
|
|
} hwc_region_t;
|
|
|
|
|
2012-02-04 00:54:11 +01:00
|
|
|
typedef struct hwc_color {
|
|
|
|
uint8_t r;
|
|
|
|
uint8_t g;
|
|
|
|
uint8_t b;
|
|
|
|
uint8_t a;
|
|
|
|
} hwc_color_t;
|
|
|
|
|
2012-06-06 08:41:37 +02:00
|
|
|
typedef struct hwc_layer_1 {
|
2010-08-06 00:24:35 +02:00
|
|
|
/*
|
2012-02-04 00:54:11 +01:00
|
|
|
* initially set to HWC_FRAMEBUFFER or HWC_BACKGROUND.
|
|
|
|
* HWC_FRAMEBUFFER
|
|
|
|
* indicates the layer will be drawn into the framebuffer
|
|
|
|
* using OpenGL ES.
|
|
|
|
* The HWC can toggle this value to HWC_OVERLAY, to indicate
|
|
|
|
* it will handle the layer.
|
|
|
|
*
|
|
|
|
* HWC_BACKGROUND
|
|
|
|
* indicates this is a special "background" layer. The only valid
|
|
|
|
* field is backgroundColor. HWC_BACKGROUND can only be used with
|
|
|
|
* HWC_API_VERSION >= 0.2
|
|
|
|
* The HWC can toggle this value to HWC_FRAMEBUFFER, to indicate
|
|
|
|
* it CANNOT handle the background color
|
|
|
|
*
|
2010-08-06 00:24:35 +02:00
|
|
|
*/
|
|
|
|
int32_t compositionType;
|
|
|
|
|
|
|
|
/* see hwc_layer_t::hints above */
|
|
|
|
uint32_t hints;
|
|
|
|
|
|
|
|
/* see hwc_layer_t::flags above */
|
|
|
|
uint32_t flags;
|
|
|
|
|
2012-02-04 00:54:11 +01:00
|
|
|
union {
|
|
|
|
/* color of the background. hwc_color_t.a is ignored */
|
|
|
|
hwc_color_t backgroundColor;
|
|
|
|
|
|
|
|
struct {
|
|
|
|
/* handle of buffer to compose. This handle is guaranteed to have been
|
|
|
|
* allocated from gralloc using the GRALLOC_USAGE_HW_COMPOSER usage flag. If
|
|
|
|
* the layer's handle is unchanged across two consecutive prepare calls and
|
|
|
|
* the HWC_GEOMETRY_CHANGED flag is not set for the second call then the
|
|
|
|
* HWComposer implementation may assume that the contents of the buffer have
|
|
|
|
* not changed. */
|
|
|
|
buffer_handle_t handle;
|
|
|
|
|
|
|
|
/* transformation to apply to the buffer during composition */
|
|
|
|
uint32_t transform;
|
|
|
|
|
|
|
|
/* blending to apply during composition */
|
|
|
|
int32_t blending;
|
|
|
|
|
|
|
|
/* area of the source to consider, the origin is the top-left corner of
|
|
|
|
* the buffer */
|
|
|
|
hwc_rect_t sourceCrop;
|
|
|
|
|
|
|
|
/* where to composite the sourceCrop onto the display. The sourceCrop
|
|
|
|
* is scaled using linear filtering to the displayFrame. The origin is the
|
|
|
|
* top-left corner of the screen.
|
|
|
|
*/
|
|
|
|
hwc_rect_t displayFrame;
|
|
|
|
|
|
|
|
/* visible region in screen space. The origin is the
|
|
|
|
* top-left corner of the screen.
|
|
|
|
* The visible region INCLUDES areas overlapped by a translucent layer.
|
|
|
|
*/
|
|
|
|
hwc_region_t visibleRegionScreen;
|
2012-06-06 08:41:37 +02:00
|
|
|
|
|
|
|
/* Sync fence object that will be signaled when the buffer's
|
|
|
|
* contents are available. May be -1 if the contents are already
|
|
|
|
* available. This field is only valid during set(), and should be
|
|
|
|
* ignored during prepare(). The set() call must not wait for the
|
|
|
|
* fence to be signaled before returning, but the HWC must wait for
|
|
|
|
* all buffers to be signaled before reading from them.
|
|
|
|
*
|
|
|
|
* The HWC takes ownership of the acquireFenceFd and is responsible
|
|
|
|
* for closing it when no longer needed.
|
|
|
|
*/
|
|
|
|
int acquireFenceFd;
|
|
|
|
|
|
|
|
/* During set() the HWC must set this field to a file descriptor for
|
|
|
|
* a sync fence object that will signal after the HWC has finished
|
|
|
|
* reading from the buffer. The field is ignored by prepare(). Each
|
|
|
|
* layer should have a unique file descriptor, even if more than one
|
|
|
|
* refer to the same underlying fence object; this allows each to be
|
|
|
|
* closed independently.
|
|
|
|
*
|
|
|
|
* If buffer reads can complete at significantly different times,
|
|
|
|
* then using independent fences is preferred. For example, if the
|
|
|
|
* HWC handles some layers with a blit engine and others with
|
|
|
|
* overlays, then the blit layers can be reused immediately after
|
|
|
|
* the blit completes, but the overlay layers can't be reused until
|
|
|
|
* a subsequent frame has been displayed.
|
|
|
|
*
|
|
|
|
* The HWC client taks ownership of the releaseFenceFd and is
|
|
|
|
* responsible for closing it when no longer needed.
|
|
|
|
*/
|
|
|
|
int releaseFenceFd;
|
2012-02-04 00:54:11 +01:00
|
|
|
};
|
|
|
|
};
|
2010-08-06 00:24:35 +02:00
|
|
|
|
2012-06-06 08:41:37 +02:00
|
|
|
/* Allow for expansion w/o breaking binary compatibility.
|
|
|
|
* Pad layer to 96 bytes, assuming 32-bit pointers.
|
|
|
|
*/
|
|
|
|
int32_t reserved[24 - 18];
|
|
|
|
|
|
|
|
} hwc_layer_1_t;
|
2010-08-06 00:24:35 +02:00
|
|
|
|
2012-07-31 23:29:00 +02:00
|
|
|
/* This represents a display, typically an EGLDisplay object */
|
|
|
|
typedef void* hwc_display_t;
|
|
|
|
|
|
|
|
/* This represents a surface, typically an EGLSurface object */
|
|
|
|
typedef void* hwc_surface_t;
|
|
|
|
|
2010-08-06 00:24:35 +02:00
|
|
|
/*
|
2012-07-31 23:29:00 +02:00
|
|
|
* hwc_display_contents_1_t::flags values
|
2010-08-06 00:24:35 +02:00
|
|
|
*/
|
|
|
|
enum {
|
|
|
|
/*
|
|
|
|
* HWC_GEOMETRY_CHANGED is set by SurfaceFlinger to indicate that the list
|
2012-06-06 08:41:37 +02:00
|
|
|
* passed to (*prepare)() has changed by more than just the buffer handles
|
|
|
|
* and acquire fences.
|
2010-08-06 00:24:35 +02:00
|
|
|
*/
|
|
|
|
HWC_GEOMETRY_CHANGED = 0x00000001,
|
|
|
|
};
|
|
|
|
|
2010-10-26 02:00:52 +02:00
|
|
|
/*
|
2012-07-31 23:29:00 +02:00
|
|
|
* Description of the contents to output on a display.
|
|
|
|
*
|
|
|
|
* This is the top-level structure passed to the prepare and set calls to
|
|
|
|
* negotiate and commit the composition of a display image.
|
2010-10-26 02:00:52 +02:00
|
|
|
*/
|
2012-07-31 23:29:00 +02:00
|
|
|
typedef struct hwc_display_contents_1 {
|
|
|
|
/* File descriptor referring to a Sync HAL fence object which will signal
|
|
|
|
* when this display image is no longer visible, i.e. when the following
|
|
|
|
* set() takes effect. The fence object is created and returned by the set
|
|
|
|
* call; this field will be -1 on entry to prepare and set. SurfaceFlinger
|
|
|
|
* will close the returned file descriptor.
|
|
|
|
*/
|
|
|
|
int flipFenceFd;
|
|
|
|
|
|
|
|
/* (dpy, sur) is the target of SurfaceFlinger's OpenGL ES composition.
|
|
|
|
* They aren't relevant to prepare. The set call should commit this surface
|
|
|
|
* atomically to the display along with any overlay layers.
|
|
|
|
*/
|
|
|
|
hwc_display_t dpy;
|
|
|
|
hwc_surface_t sur;
|
|
|
|
|
|
|
|
/* List of layers that will be composed on the display. The buffer handles
|
2012-08-01 00:18:32 +02:00
|
|
|
* in the list will be unique. If numHwLayers is 0, all composition will be
|
|
|
|
* performed by SurfaceFlinger.
|
2012-07-31 23:29:00 +02:00
|
|
|
*/
|
2010-08-06 00:24:35 +02:00
|
|
|
uint32_t flags;
|
|
|
|
size_t numHwLayers;
|
2012-06-06 08:41:37 +02:00
|
|
|
hwc_layer_1_t hwLayers[0];
|
2010-08-06 00:24:35 +02:00
|
|
|
|
2012-07-31 23:29:00 +02:00
|
|
|
} hwc_display_contents_1_t;
|
2010-08-06 00:24:35 +02:00
|
|
|
|
2011-08-02 01:34:42 +02:00
|
|
|
/* see hwc_composer_device::registerProcs()
|
|
|
|
* Any of the callbacks can be NULL, in which case the corresponding
|
|
|
|
* functionality is not supported.
|
|
|
|
*/
|
|
|
|
typedef struct hwc_procs {
|
|
|
|
/*
|
|
|
|
* (*invalidate)() triggers a screen refresh, in particular prepare and set
|
|
|
|
* will be called shortly after this call is made. Note that there is
|
|
|
|
* NO GUARANTEE that the screen refresh will happen after invalidate()
|
|
|
|
* returns (in particular, it could happen before).
|
|
|
|
* invalidate() is GUARANTEED TO NOT CALL BACK into the h/w composer HAL and
|
|
|
|
* it is safe to call invalidate() from any of hwc_composer_device
|
|
|
|
* hooks, unless noted otherwise.
|
|
|
|
*/
|
|
|
|
void (*invalidate)(struct hwc_procs* procs);
|
2012-03-24 23:56:29 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* (*vsync)() is called by the h/w composer HAL when a vsync event is
|
2012-07-31 23:29:00 +02:00
|
|
|
* received and HWC_EVENT_VSYNC is enabled on a display
|
|
|
|
* (see: hwc_event_control).
|
2012-03-24 23:56:29 +01:00
|
|
|
*
|
2012-07-31 23:29:00 +02:00
|
|
|
* the "dpy" parameter indicates which display the vsync event is for.
|
2012-04-30 21:57:11 +02:00
|
|
|
* the "timestamp" parameter is the system monotonic clock timestamp in
|
|
|
|
* nanosecond of when the vsync event happened.
|
2012-03-24 23:56:29 +01:00
|
|
|
*
|
|
|
|
* vsync() is GUARANTEED TO NOT CALL BACK into the h/w composer HAL.
|
|
|
|
*
|
|
|
|
* It is expected that vsync() is called from a thread of at least
|
2012-04-25 00:42:37 +02:00
|
|
|
* HAL_PRIORITY_URGENT_DISPLAY with as little latency as possible,
|
2012-03-24 23:56:29 +01:00
|
|
|
* typically less than 0.5 ms.
|
|
|
|
*
|
2012-04-11 06:22:28 +02:00
|
|
|
* It is a (silent) error to have HWC_EVENT_VSYNC enabled when calling
|
|
|
|
* hwc_composer_device.set(..., 0, 0, 0) (screen off). The implementation
|
|
|
|
* can either stop or continue to process VSYNC events, but must not
|
|
|
|
* crash or cause other problems.
|
2012-03-24 23:56:29 +01:00
|
|
|
*/
|
2012-07-31 23:29:00 +02:00
|
|
|
void (*vsync)(struct hwc_procs* procs, int dpy, int64_t timestamp);
|
2011-08-02 01:34:42 +02:00
|
|
|
} hwc_procs_t;
|
|
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
2010-08-06 00:24:35 +02:00
|
|
|
|
|
|
|
typedef struct hwc_module {
|
|
|
|
struct hw_module_t common;
|
|
|
|
} hwc_module_t;
|
|
|
|
|
2012-06-06 08:41:37 +02:00
|
|
|
typedef struct hwc_composer_device_1 {
|
2010-08-06 00:24:35 +02:00
|
|
|
struct hw_device_t common;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* (*prepare)() is called for each frame before composition and is used by
|
|
|
|
* SurfaceFlinger to determine what composition steps the HWC can handle.
|
|
|
|
*
|
|
|
|
* (*prepare)() can be called more than once, the last call prevails.
|
|
|
|
*
|
2012-07-31 23:29:00 +02:00
|
|
|
* The HWC responds by setting the compositionType field in each layer to
|
|
|
|
* either HWC_FRAMEBUFFER or HWC_OVERLAY. In the former case, the
|
|
|
|
* composition for the layer is handled by SurfaceFlinger with OpenGL ES,
|
|
|
|
* in the later case, the HWC will have to handle the layer's composition.
|
2010-08-06 00:24:35 +02:00
|
|
|
*
|
|
|
|
* (*prepare)() is called with HWC_GEOMETRY_CHANGED to indicate that the
|
|
|
|
* list's geometry has changed, that is, when more than just the buffer's
|
|
|
|
* handles have been updated. Typically this happens (but is not limited to)
|
|
|
|
* when a window is added, removed, resized or moved.
|
|
|
|
*
|
2012-08-01 00:18:32 +02:00
|
|
|
* The numDisplays parameter will always be greater than zero, displays
|
|
|
|
* will be non-NULL, and the array entries will be non-NULL.
|
|
|
|
*
|
2010-08-06 00:24:35 +02:00
|
|
|
* returns: 0 on success. An negative error code on error. If an error is
|
|
|
|
* returned, SurfaceFlinger will assume that none of the layer will be
|
|
|
|
* handled by the HWC.
|
|
|
|
*/
|
2012-06-06 08:41:37 +02:00
|
|
|
int (*prepare)(struct hwc_composer_device_1 *dev,
|
2012-07-31 23:29:00 +02:00
|
|
|
size_t numDisplays, hwc_display_contents_1_t** displays);
|
2010-08-06 00:24:35 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* (*set)() is used in place of eglSwapBuffers(), and assumes the same
|
|
|
|
* functionality, except it also commits the work list atomically with
|
|
|
|
* the actual eglSwapBuffers().
|
|
|
|
*
|
2012-07-31 23:29:00 +02:00
|
|
|
* The layer lists are guaranteed to be the same as the ones returned from
|
|
|
|
* the last call to (*prepare)().
|
2010-08-06 00:24:35 +02:00
|
|
|
*
|
2012-07-31 23:29:00 +02:00
|
|
|
* When this call returns the caller assumes that the displays will be
|
|
|
|
* updated in the near future with the content of their work lists, without
|
|
|
|
* artifacts during the transition from the previous frame.
|
2010-08-06 00:24:35 +02:00
|
|
|
*
|
2012-08-01 00:18:32 +02:00
|
|
|
* A display with zero layers indicates that the entire composition has
|
|
|
|
* been handled by SurfaceFlinger with OpenGL ES. In this case, (*set)()
|
|
|
|
* behaves just like eglSwapBuffers().
|
2010-08-06 00:24:35 +02:00
|
|
|
*
|
2012-08-01 00:18:32 +02:00
|
|
|
* The numDisplays parameter will always be greater than zero, displays
|
|
|
|
* will be non-NULL, and the array entries will be non-NULL.
|
2011-11-22 02:35:15 +01:00
|
|
|
*
|
2011-11-16 06:27:52 +01:00
|
|
|
* IMPORTANT NOTE: there is an implicit layer containing opaque black
|
2012-07-31 23:29:00 +02:00
|
|
|
* pixels behind all the layers in the list. It is the responsibility of
|
|
|
|
* the hwcomposer module to make sure black pixels are output (or blended
|
|
|
|
* from).
|
2011-11-16 06:27:52 +01:00
|
|
|
*
|
2010-08-06 00:24:35 +02:00
|
|
|
* returns: 0 on success. An negative error code on error:
|
|
|
|
* HWC_EGL_ERROR: eglGetError() will provide the proper error code
|
|
|
|
* Another code for non EGL errors.
|
|
|
|
*/
|
2012-06-06 08:41:37 +02:00
|
|
|
int (*set)(struct hwc_composer_device_1 *dev,
|
2012-07-31 23:29:00 +02:00
|
|
|
size_t numDisplays, hwc_display_contents_1_t** displays);
|
2012-06-06 08:41:37 +02:00
|
|
|
|
2010-12-02 01:34:08 +01:00
|
|
|
/*
|
2012-03-24 23:56:29 +01:00
|
|
|
* This field is OPTIONAL and can be NULL.
|
2010-12-02 01:34:08 +01:00
|
|
|
*
|
2011-08-02 01:34:42 +02:00
|
|
|
* If non NULL it will be called by SurfaceFlinger on dumpsys
|
2010-12-02 01:34:08 +01:00
|
|
|
*/
|
2012-06-06 08:41:37 +02:00
|
|
|
void (*dump)(struct hwc_composer_device_1* dev, char *buff, int buff_len);
|
2010-08-06 00:24:35 +02:00
|
|
|
|
2011-08-02 01:34:42 +02:00
|
|
|
/*
|
2012-03-24 23:56:29 +01:00
|
|
|
* This field is OPTIONAL and can be NULL.
|
2011-08-02 01:34:42 +02:00
|
|
|
*
|
|
|
|
* (*registerProcs)() registers a set of callbacks the h/w composer HAL
|
|
|
|
* can later use. It is FORBIDDEN to call any of the callbacks from
|
|
|
|
* within registerProcs(). registerProcs() must save the hwc_procs_t pointer
|
|
|
|
* which is needed when calling a registered callback.
|
|
|
|
* Each call to registerProcs replaces the previous set of callbacks.
|
|
|
|
* registerProcs is called with NULL to unregister all callbacks.
|
|
|
|
*
|
|
|
|
* Any of the callbacks can be NULL, in which case the corresponding
|
|
|
|
* functionality is not supported.
|
|
|
|
*/
|
2012-06-06 08:41:37 +02:00
|
|
|
void (*registerProcs)(struct hwc_composer_device_1* dev,
|
2011-08-02 01:34:42 +02:00
|
|
|
hwc_procs_t const* procs);
|
|
|
|
|
2012-02-04 00:54:11 +01:00
|
|
|
/*
|
2012-03-24 23:56:29 +01:00
|
|
|
* This field is OPTIONAL and can be NULL.
|
2012-02-04 00:54:11 +01:00
|
|
|
*
|
|
|
|
* Used to retrieve information about the h/w composer
|
|
|
|
*
|
|
|
|
* Returns 0 on success or -errno on error.
|
|
|
|
*/
|
2012-06-06 08:41:37 +02:00
|
|
|
int (*query)(struct hwc_composer_device_1* dev, int what, int* value);
|
2012-02-04 00:54:11 +01:00
|
|
|
|
2012-03-24 23:56:29 +01:00
|
|
|
/*
|
|
|
|
* Reserved for future use. Must be NULL.
|
|
|
|
*/
|
|
|
|
void* reserved_proc[4];
|
2012-02-04 00:54:11 +01:00
|
|
|
|
2012-03-24 23:56:29 +01:00
|
|
|
/*
|
2012-08-01 00:18:32 +02:00
|
|
|
* This field is REQUIRED and must not be NULL.
|
2012-03-24 23:56:29 +01:00
|
|
|
*/
|
2012-06-06 08:41:37 +02:00
|
|
|
hwc_methods_1_t const *methods;
|
2010-08-06 00:24:35 +02:00
|
|
|
|
2012-06-06 08:41:37 +02:00
|
|
|
} hwc_composer_device_1_t;
|
2010-08-06 00:24:35 +02:00
|
|
|
|
|
|
|
/** convenience API for opening and closing a device */
|
|
|
|
|
2012-06-06 08:41:37 +02:00
|
|
|
static inline int hwc_open_1(const struct hw_module_t* module,
|
|
|
|
hwc_composer_device_1_t** device) {
|
2010-08-06 00:24:35 +02:00
|
|
|
return module->methods->open(module,
|
|
|
|
HWC_HARDWARE_COMPOSER, (struct hw_device_t**)device);
|
|
|
|
}
|
|
|
|
|
2012-06-06 08:41:37 +02:00
|
|
|
static inline int hwc_close_1(hwc_composer_device_1_t* device) {
|
2010-08-06 00:24:35 +02:00
|
|
|
return device->common.close(&device->common);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
2012-06-06 08:41:37 +02:00
|
|
|
#if !HWC_REMOVE_DEPRECATED_VERSIONS
|
|
|
|
#include <hardware/hwcomposer_v0.h>
|
|
|
|
#endif
|
|
|
|
|
2010-08-06 00:24:35 +02:00
|
|
|
__END_DECLS
|
|
|
|
|
|
|
|
#endif /* ANDROID_INCLUDE_HARDWARE_HWCOMPOSER_H */
|