Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b9a2e321 authored by Mathias Agopian's avatar Mathias Agopian Committed by Android (Google) Code Review
Browse files

Merge "Plumb gralloc producer/consumer bits correctly" into oc-dev

parents e44061f9 910ab13e
Loading
Loading
Loading
Loading
+10 −12
Original line number Original line Diff line number Diff line
@@ -14754,18 +14754,16 @@ package android.hardware {
    field public static final int RGBX_8888 = 2; // 0x2
    field public static final int RGBX_8888 = 2; // 0x2
    field public static final int RGB_565 = 4; // 0x4
    field public static final int RGB_565 = 4; // 0x4
    field public static final int RGB_888 = 3; // 0x3
    field public static final int RGB_888 = 3; // 0x3
    field public static final long USAGE0_CPU_READ = 2L; // 0x2L
    field public static final long USAGE_CPU_READ_OFTEN = 3L; // 0x3L
    field public static final long USAGE0_CPU_READ_OFTEN = 6L; // 0x6L
    field public static final long USAGE_CPU_READ_RARELY = 2L; // 0x2L
    field public static final long USAGE0_CPU_WRITE = 32L; // 0x20L
    field public static final long USAGE_CPU_WRITE_OFTEN = 48L; // 0x30L
    field public static final long USAGE0_CPU_WRITE_OFTEN = 96L; // 0x60L
    field public static final long USAGE_CPU_WRITE_RARELY = 32L; // 0x20L
    field public static final long USAGE0_GPU_COLOR_OUTPUT = 2048L; // 0x800L
    field public static final long USAGE_GPU_COLOR_OUTPUT = 512L; // 0x200L
    field public static final long USAGE0_GPU_CUBEMAP = 8192L; // 0x2000L
    field public static final long USAGE_GPU_DATA_BUFFER = 16777216L; // 0x1000000L
    field public static final long USAGE0_GPU_DATA_BUFFER = 16384L; // 0x4000L
    field public static final long USAGE_GPU_SAMPLED_IMAGE = 256L; // 0x100L
    field public static final long USAGE0_GPU_SAMPLED_IMAGE = 1024L; // 0x400L
    field public static final long USAGE_PROTECTED_CONTENT = 16384L; // 0x4000L
    field public static final long USAGE0_GPU_STORAGE_IMAGE = 3072L; // 0xc00L
    field public static final long USAGE_SENSOR_DIRECT_DATA = 8388608L; // 0x800000L
    field public static final long USAGE0_PROTECTED_CONTENT = 262144L; // 0x40000L
    field public static final long USAGE_VIDEO_ENCODE = 65536L; // 0x10000L
    field public static final long USAGE0_SENSOR_DIRECT_DATA = 536870912L; // 0x20000000L
    field public static final long USAGE0_VIDEO_ENCODE = 2097152L; // 0x200000L
  }
  }
  public final class Sensor {
  public final class Sensor {
+10 −12
Original line number Original line Diff line number Diff line
@@ -15532,18 +15532,16 @@ package android.hardware {
    field public static final int RGBX_8888 = 2; // 0x2
    field public static final int RGBX_8888 = 2; // 0x2
    field public static final int RGB_565 = 4; // 0x4
    field public static final int RGB_565 = 4; // 0x4
    field public static final int RGB_888 = 3; // 0x3
    field public static final int RGB_888 = 3; // 0x3
    field public static final long USAGE0_CPU_READ = 2L; // 0x2L
    field public static final long USAGE_CPU_READ_OFTEN = 3L; // 0x3L
    field public static final long USAGE0_CPU_READ_OFTEN = 6L; // 0x6L
    field public static final long USAGE_CPU_READ_RARELY = 2L; // 0x2L
    field public static final long USAGE0_CPU_WRITE = 32L; // 0x20L
    field public static final long USAGE_CPU_WRITE_OFTEN = 48L; // 0x30L
    field public static final long USAGE0_CPU_WRITE_OFTEN = 96L; // 0x60L
    field public static final long USAGE_CPU_WRITE_RARELY = 32L; // 0x20L
    field public static final long USAGE0_GPU_COLOR_OUTPUT = 2048L; // 0x800L
    field public static final long USAGE_GPU_COLOR_OUTPUT = 512L; // 0x200L
    field public static final long USAGE0_GPU_CUBEMAP = 8192L; // 0x2000L
    field public static final long USAGE_GPU_DATA_BUFFER = 16777216L; // 0x1000000L
    field public static final long USAGE0_GPU_DATA_BUFFER = 16384L; // 0x4000L
    field public static final long USAGE_GPU_SAMPLED_IMAGE = 256L; // 0x100L
    field public static final long USAGE0_GPU_SAMPLED_IMAGE = 1024L; // 0x400L
    field public static final long USAGE_PROTECTED_CONTENT = 16384L; // 0x4000L
    field public static final long USAGE0_GPU_STORAGE_IMAGE = 3072L; // 0xc00L
    field public static final long USAGE_SENSOR_DIRECT_DATA = 8388608L; // 0x800000L
    field public static final long USAGE0_PROTECTED_CONTENT = 262144L; // 0x40000L
    field public static final long USAGE_VIDEO_ENCODE = 65536L; // 0x10000L
    field public static final long USAGE0_SENSOR_DIRECT_DATA = 536870912L; // 0x20000000L
    field public static final long USAGE0_VIDEO_ENCODE = 2097152L; // 0x200000L
  }
  }
  public final class Sensor {
  public final class Sensor {
+10 −12
Original line number Original line Diff line number Diff line
@@ -14800,18 +14800,16 @@ package android.hardware {
    field public static final int RGBX_8888 = 2; // 0x2
    field public static final int RGBX_8888 = 2; // 0x2
    field public static final int RGB_565 = 4; // 0x4
    field public static final int RGB_565 = 4; // 0x4
    field public static final int RGB_888 = 3; // 0x3
    field public static final int RGB_888 = 3; // 0x3
    field public static final long USAGE0_CPU_READ = 2L; // 0x2L
    field public static final long USAGE_CPU_READ_OFTEN = 3L; // 0x3L
    field public static final long USAGE0_CPU_READ_OFTEN = 6L; // 0x6L
    field public static final long USAGE_CPU_READ_RARELY = 2L; // 0x2L
    field public static final long USAGE0_CPU_WRITE = 32L; // 0x20L
    field public static final long USAGE_CPU_WRITE_OFTEN = 48L; // 0x30L
    field public static final long USAGE0_CPU_WRITE_OFTEN = 96L; // 0x60L
    field public static final long USAGE_CPU_WRITE_RARELY = 32L; // 0x20L
    field public static final long USAGE0_GPU_COLOR_OUTPUT = 2048L; // 0x800L
    field public static final long USAGE_GPU_COLOR_OUTPUT = 512L; // 0x200L
    field public static final long USAGE0_GPU_CUBEMAP = 8192L; // 0x2000L
    field public static final long USAGE_GPU_DATA_BUFFER = 16777216L; // 0x1000000L
    field public static final long USAGE0_GPU_DATA_BUFFER = 16384L; // 0x4000L
    field public static final long USAGE_GPU_SAMPLED_IMAGE = 256L; // 0x100L
    field public static final long USAGE0_GPU_SAMPLED_IMAGE = 1024L; // 0x400L
    field public static final long USAGE_PROTECTED_CONTENT = 16384L; // 0x4000L
    field public static final long USAGE0_GPU_STORAGE_IMAGE = 3072L; // 0xc00L
    field public static final long USAGE_SENSOR_DIRECT_DATA = 8388608L; // 0x800000L
    field public static final long USAGE0_PROTECTED_CONTENT = 262144L; // 0x40000L
    field public static final long USAGE_VIDEO_ENCODE = 65536L; // 0x10000L
    field public static final long USAGE0_SENSOR_DIRECT_DATA = 536870912L; // 0x20000000L
    field public static final long USAGE0_VIDEO_ENCODE = 2097152L; // 0x200000L
  }
  }
  public final class Sensor {
  public final class Sensor {
+34 −39
Original line number Original line Diff line number Diff line
@@ -70,37 +70,34 @@ public final class HardwareBuffer implements Parcelable, AutoCloseable {


    /** @hide */
    /** @hide */
    @Retention(RetentionPolicy.SOURCE)
    @Retention(RetentionPolicy.SOURCE)
    @IntDef(flag = true, value = {USAGE0_CPU_READ, USAGE0_CPU_READ_OFTEN, USAGE0_CPU_WRITE,
    @IntDef(flag = true, value = {USAGE_CPU_READ_RARELY, USAGE_CPU_READ_OFTEN,
            USAGE0_CPU_WRITE_OFTEN, USAGE0_GPU_SAMPLED_IMAGE, USAGE0_GPU_COLOR_OUTPUT,
            USAGE_CPU_WRITE_RARELY, USAGE_CPU_WRITE_OFTEN, USAGE_GPU_SAMPLED_IMAGE,
            USAGE0_GPU_STORAGE_IMAGE, USAGE0_GPU_CUBEMAP, USAGE0_GPU_DATA_BUFFER,
            USAGE_GPU_COLOR_OUTPUT, USAGE_PROTECTED_CONTENT, USAGE_VIDEO_ENCODE,
            USAGE0_PROTECTED_CONTENT, USAGE0_SENSOR_DIRECT_DATA, USAGE0_VIDEO_ENCODE})
            USAGE_GPU_DATA_BUFFER, USAGE_SENSOR_DIRECT_DATA})
    public @interface Usage0 {};
    public @interface Usage {};


    /** Usage0: the buffer will sometimes be read by the CPU */
    /** Usage: The buffer will sometimes be read by the CPU */
    public static final long USAGE0_CPU_READ               = (1 << 1);
    public static final long USAGE_CPU_READ_RARELY       = 2;
    /** Usage0: the buffer will often be read by the CPU*/
    /** Usage: The buffer will often be read by the CPU */
    public static final long USAGE0_CPU_READ_OFTEN         = (1 << 2 | USAGE0_CPU_READ);
    public static final long USAGE_CPU_READ_OFTEN        = 3;
    /** Usage0: the buffer will sometimes be written to by the CPU */

    public static final long USAGE0_CPU_WRITE              = (1 << 5);
    /** Usage: The buffer will sometimes be written to by the CPU */
    /** Usage0: the buffer will often be written to by the CPU */
    public static final long USAGE_CPU_WRITE_RARELY      = 2 << 4;
    public static final long USAGE0_CPU_WRITE_OFTEN        = (1 << 6 | USAGE0_CPU_WRITE);
    /** Usage: The buffer will often be written to by the CPU */
    /** Usage0: the buffer will be read from by the GPU */
    public static final long USAGE_CPU_WRITE_OFTEN       = 3 << 4;
    public static final long USAGE0_GPU_SAMPLED_IMAGE      = (1 << 10);

    /** Usage0: the buffer will be written to by the GPU */
    /** Usage: The buffer will be read from by the GPU */
    public static final long USAGE0_GPU_COLOR_OUTPUT       = (1 << 11);
    public static final long USAGE_GPU_SAMPLED_IMAGE      = 1 << 8;
    /** Usage0: the buffer will be read from and written to by the GPU */
    /** Usage: The buffer will be written to by the GPU */
    public static final long USAGE0_GPU_STORAGE_IMAGE      = (USAGE0_GPU_SAMPLED_IMAGE |
    public static final long USAGE_GPU_COLOR_OUTPUT       = 1 << 9;
            USAGE0_GPU_COLOR_OUTPUT);
    /** Usage: The buffer must not be used outside of a protected hardware path */
    /** Usage0: the buffer will be used as a cubemap texture */
    public static final long USAGE_PROTECTED_CONTENT      = 1 << 14;
    public static final long USAGE0_GPU_CUBEMAP            = (1 << 13);
    /** Usage: The buffer will be read by a hardware video encoder */
    /** Usage0: the buffer will be used as a shader storage or uniform buffer object*/
    public static final long USAGE_VIDEO_ENCODE           = 1 << 16;
    public static final long USAGE0_GPU_DATA_BUFFER        = (1 << 14);
    /** Usage: The buffer will be used for sensor direct data */
    /** Usage0: the buffer must not be used outside of a protected hardware path */
    public static final long USAGE_SENSOR_DIRECT_DATA     = 1 << 23;
    public static final long USAGE0_PROTECTED_CONTENT      = (1 << 18);
    /** Usage: The buffer will be used as a shader storage or uniform buffer object */
    /** Usage0: the buffer will be used for sensor direct data */
    public static final long USAGE_GPU_DATA_BUFFER        = 1 << 24;
    public static final long USAGE0_SENSOR_DIRECT_DATA     = (1 << 29);
    /** Usage0: the buffer will be read by a hardware video encoder */
    public static final long USAGE0_VIDEO_ENCODE           = (1 << 21);


    // The approximate size of a native AHardwareBuffer object.
    // The approximate size of a native AHardwareBuffer object.
    private static final long NATIVE_HARDWARE_BUFFER_SIZE = 232;
    private static final long NATIVE_HARDWARE_BUFFER_SIZE = 232;
@@ -116,13 +113,11 @@ public final class HardwareBuffer implements Parcelable, AutoCloseable {
     * {@link #RGBX_8888}, {@link #RGB_565}, {@link #RGB_888}, {@link #RGBA_1010102}, {@link #BLOB}
     * {@link #RGBX_8888}, {@link #RGB_565}, {@link #RGB_888}, {@link #RGBA_1010102}, {@link #BLOB}
     * @param layers The number of layers in the buffer
     * @param layers The number of layers in the buffer
     * @param usage Flags describing how the buffer will be used, one of
     * @param usage Flags describing how the buffer will be used, one of
     *     {@link #USAGE0_CPU_READ}, {@link #USAGE0_CPU_READ_OFTEN}, {@link #USAGE0_CPU_WRITE},
     *     {@link #USAGE_CPU_READ_RARELY}, {@link #USAGE_CPU_READ_OFTEN},
     *     {@link #USAGE0_CPU_WRITE_OFTEN}, {@link #USAGE0_GPU_SAMPLED_IMAGE},
     *     {@link #USAGE_CPU_WRITE_RARELY}, {@link #USAGE_CPU_WRITE_OFTEN},
     *     {@link #USAGE0_GPU_COLOR_OUTPUT},{@link #USAGE0_GPU_STORAGE_IMAGE},
     *     {@link #USAGE_GPU_SAMPLED_IMAGE}, {@link #USAGE_GPU_COLOR_OUTPUT},
     *     {@link #USAGE0_GPU_CUBEMAP}, {@link #USAGE0_GPU_DATA_BUFFER},
     *     {@link #USAGE_GPU_DATA_BUFFER}, {@link #USAGE_PROTECTED_CONTENT},
     *     {@link #USAGE0_PROTECTED_CONTENT}, {@link #USAGE0_SENSOR_DIRECT_DATA},
     *     {@link #USAGE_SENSOR_DIRECT_DATA}, {@link #USAGE_VIDEO_ENCODE}
     *     {@link #USAGE0_VIDEO_ENCODE}
     *
     * @return A <code>HardwareBuffer</code> instance if successful, or throws an
     * @return A <code>HardwareBuffer</code> instance if successful, or throws an
     *     IllegalArgumentException if the dimensions passed are invalid (either zero, negative, or
     *     IllegalArgumentException if the dimensions passed are invalid (either zero, negative, or
     *     too large to allocate), if the format is not supported, if the requested number of layers
     *     too large to allocate), if the format is not supported, if the requested number of layers
@@ -130,7 +125,7 @@ public final class HardwareBuffer implements Parcelable, AutoCloseable {
     */
     */
    @NonNull
    @NonNull
    public static HardwareBuffer create(int width, int height, @Format int format, int layers,
    public static HardwareBuffer create(int width, int height, @Format int format, int layers,
            @Usage0 long usage) {
            @Usage long usage) {
        if (!HardwareBuffer.isSupportedFormat(format)) {
        if (!HardwareBuffer.isSupportedFormat(format)) {
            throw new IllegalArgumentException("Invalid pixel format " + format);
            throw new IllegalArgumentException("Invalid pixel format " + format);
        }
        }
+2 −2
Original line number Original line Diff line number Diff line
@@ -589,9 +589,9 @@ public class SystemSensorManager extends SensorManager {
                        "Width if HaradwareBuffer must be greater than "
                        "Width if HaradwareBuffer must be greater than "
                        + MIN_DIRECT_CHANNEL_BUFFER_SIZE);
                        + MIN_DIRECT_CHANNEL_BUFFER_SIZE);
            }
            }
            if ((hardwareBuffer.getUsage() & HardwareBuffer.USAGE0_SENSOR_DIRECT_DATA) == 0) {
            if ((hardwareBuffer.getUsage() & HardwareBuffer.USAGE_SENSOR_DIRECT_DATA) == 0) {
                throw new IllegalArgumentException(
                throw new IllegalArgumentException(
                        "HardwareBuffer must set usage flag USAGE0_SENSOR_DIRECT_DATA");
                        "HardwareBuffer must set usage flag USAGE_SENSOR_DIRECT_DATA");
            }
            }
            size = hardwareBuffer.getWidth();
            size = hardwareBuffer.getWidth();
            id = nativeCreateDirectChannel(
            id = nativeCreateDirectChannel(
Loading