Skip to content
This repository was archived by the owner on Jan 7, 2023. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
982383e
UPSTREAM: android: add liblog to libmesa_intel_common build
tpalli Feb 21, 2019
91c07ca
UPSTREAM: android: make libbacktrace optional on USE_LIBBACKTRACE
tpalli Feb 26, 2019
68e7173
UPSTREAM: android: Build fixes for OMR1
tpalli Mar 5, 2019
7964125
UPSTREAM: android: static link with libexpat with Android O+
Kishore409 Mar 11, 2019
09fe74b
INTERNAL: Adds support for gralloc1.0.
munish-b Jul 1, 2018
4252199
INTERNAL: ignore some compile warning on android.
jennycao May 30, 2018
dcc18d1
INTERNAL: enable O3 for Mesa compilation.
yogesh-marathe Dec 8, 2017
9b02fdd
INTERNAL: Enable sampling for imported dma_buf images
strassek Mar 22, 2017
bf741e0
UPSTREAM: SQUASH: Add P0x formats
tpalli Feb 11, 2019
6fd71fa
INTERNAL: Add format P010 etc for 10bit/12bit/16bit YUV420 formats
js0701 Oct 14, 2017
da1eacc
INTERNAL: Relax permissions when we export prime handle for GEM.
kalyankondapally Feb 4, 2018
5ce5100
INTERNAL: CHROMIUM: egl: automatically call eglReleaseThread on threa…
Jun 14, 2017
28e27d4
INTERNAL: prevent deadlock in droid_query_buffer_age
Apr 18, 2018
d5c63f6
FROMLIST: Check if the window is non-NULL before setting swap interval.
Apr 25, 2018
53a093e
INTERNAL: Add ReadMe file.
kalyankondapally May 23, 2018
5800142
INTERNAL: glcpp: Hack to handle expressions in #line directives.
kaydenl Oct 4, 2017
31d0f60
REVERTME: i965: perf: implement GPA's null renderer
llandwerlin-intel Feb 8, 2018
bc8d447
INTERNAL: anv: disable extensions for Android CTS
strassek Aug 27, 2018
4e3aa37
FROMLIST: SQUASH: i965: SIMD32 selection heuristics
Oct 15, 2018
d16da8d
FROMLIST: glsl: fix a binding points assignment for ssbo/ubo arrays
asimiklit Mar 5, 2019
73918cd
FROMLIST: glsl: fix an incorrect max_array_access after optimization …
asimiklit Mar 5, 2019
31938ce
UPSTREAM: anv/android: fix missing dependencies issue during parallel…
renchenglei May 23, 2019
bdf98e2
Add prebuilt-intermediates for xmlpool
renchenglei May 30, 2019
9077a85
Add generated file for i965_dri library
renchenglei May 30, 2019
4f8362b
mesa3d: dragonboards: add format_srgb.c to prebuilts
renchenglei May 31, 2019
6e421e2
Add generated file for vulkan.broxton library
renchenglei May 31, 2019
525b9b6
Add xmlpool/options.h back in the list of intermediate prebuilt sourc…
renchenglei May 31, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions Android.common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ LOCAL_C_INCLUDES += \

MESA_VERSION := $(shell cat $(MESA_TOP)/VERSION)
LOCAL_CFLAGS += \
-O3 \
-Wno-error \
-Wno-unused-parameter \
-Wno-pointer-arith \
Expand Down Expand Up @@ -77,14 +78,23 @@ LOCAL_CFLAGS += \
-fvisibility=hidden \
-fno-math-errno \
-fno-trapping-math \
-Wno-sign-compare
-Wno-sign-compare \
-Wno-self-assign \
-Wno-constant-logical-operand \
-Wno-format \
-Wno-incompatible-pointer-types \
-Wno-enum-conversion

LOCAL_CPPFLAGS += \
-D__STDC_CONSTANT_MACROS \
-D__STDC_FORMAT_MACROS \
-D__STDC_LIMIT_MACROS \
-Wno-error=non-virtual-dtor \
-Wno-non-virtual-dtor
-Wno-non-virtual-dtor \
-Wno-delete-non-virtual-dtor \
-Wno-overloaded-virtual \
-Wno-missing-braces \
-Wno-deprecated-register

# mesa requires at least c99 compiler
LOCAL_CONLYFLAGS += \
Expand Down
2 changes: 2 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Any security related issues should be reported by following the instructions here:
https://01.org/security
4 changes: 4 additions & 0 deletions include/GL/internal/dri_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -1352,6 +1352,10 @@ struct __DRIdri2ExtensionRec {
#define __DRI_IMAGE_FOURCC_YVU422 0x36315659
#define __DRI_IMAGE_FOURCC_YVU444 0x34325659

#define __DRI_IMAGE_FOURCC_P010 0x30313050
#define __DRI_IMAGE_FOURCC_P012 0x32313050
#define __DRI_IMAGE_FOURCC_P016 0x36313050

/**
* Queryable on images created by createImageFromNames.
*
Expand Down
196 changes: 196 additions & 0 deletions prebuilt-intermediates/compiler/brw_nir_trig_workarounds.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
#include "brw_nir.h"

#include "nir.h"
#include "nir_builder.h"
#include "nir_search.h"
#include "nir_search_helpers.h"

#ifndef NIR_OPT_ALGEBRAIC_STRUCT_DEFS
#define NIR_OPT_ALGEBRAIC_STRUCT_DEFS

struct transform {
const nir_search_expression *search;
const nir_search_value *replace;
unsigned condition_offset;
};

#endif


static const nir_search_variable search0_0 = {
{ nir_search_value_variable, -1 },
0, /* x */
false,
nir_type_invalid,
NULL,
};
static const nir_search_expression search0 = {
{ nir_search_value_expression, -1 },
false,
nir_op_fsin,
{ &search0_0.value },
NULL,
};

static const nir_search_variable replace0_0_0 = {
{ nir_search_value_variable, -1 },
0, /* x */
false,
nir_type_invalid,
NULL,
};
static const nir_search_expression replace0_0 = {
{ nir_search_value_expression, -1 },
false,
nir_op_fsin,
{ &replace0_0_0.value },
NULL,
};

static const nir_search_constant replace0_1 = {
{ nir_search_value_constant, -1 },
nir_type_float, { 0x3fefffc115df6556 /* 0.99997 */ },
};
static const nir_search_expression replace0 = {
{ nir_search_value_expression, -1 },
false,
nir_op_fmul,
{ &replace0_0.value, &replace0_1.value },
NULL,
};

static const nir_search_variable search1_0 = {
{ nir_search_value_variable, -1 },
0, /* x */
false,
nir_type_invalid,
NULL,
};
static const nir_search_expression search1 = {
{ nir_search_value_expression, -1 },
false,
nir_op_fcos,
{ &search1_0.value },
NULL,
};

static const nir_search_variable replace1_0_0 = {
{ nir_search_value_variable, -1 },
0, /* x */
false,
nir_type_invalid,
NULL,
};
static const nir_search_expression replace1_0 = {
{ nir_search_value_expression, -1 },
false,
nir_op_fcos,
{ &replace1_0_0.value },
NULL,
};

static const nir_search_constant replace1_1 = {
{ nir_search_value_constant, -1 },
nir_type_float, { 0x3fefffc115df6556 /* 0.99997 */ },
};
static const nir_search_expression replace1 = {
{ nir_search_value_expression, -1 },
false,
nir_op_fmul,
{ &replace1_0.value, &replace1_1.value },
NULL,
};

static const struct transform brw_nir_apply_trig_workarounds_fcos_xforms[] = {
{ &search1, &replace1.value, 0 },
};
static const struct transform brw_nir_apply_trig_workarounds_fsin_xforms[] = {
{ &search0, &replace0.value, 0 },
};

static bool
brw_nir_apply_trig_workarounds_block(nir_builder *build, nir_block *block,
const bool *condition_flags)
{
bool progress = false;

nir_foreach_instr_reverse_safe(instr, block) {
if (instr->type != nir_instr_type_alu)
continue;

nir_alu_instr *alu = nir_instr_as_alu(instr);
if (!alu->dest.dest.is_ssa)
continue;

switch (alu->op) {
case nir_op_fcos:
for (unsigned i = 0; i < ARRAY_SIZE(brw_nir_apply_trig_workarounds_fcos_xforms); i++) {
const struct transform *xform = &brw_nir_apply_trig_workarounds_fcos_xforms[i];
if (condition_flags[xform->condition_offset] &&
nir_replace_instr(build, alu, xform->search, xform->replace)) {
progress = true;
break;
}
}
break;
case nir_op_fsin:
for (unsigned i = 0; i < ARRAY_SIZE(brw_nir_apply_trig_workarounds_fsin_xforms); i++) {
const struct transform *xform = &brw_nir_apply_trig_workarounds_fsin_xforms[i];
if (condition_flags[xform->condition_offset] &&
nir_replace_instr(build, alu, xform->search, xform->replace)) {
progress = true;
break;
}
}
break;
default:
break;
}
}

return progress;
}

static bool
brw_nir_apply_trig_workarounds_impl(nir_function_impl *impl, const bool *condition_flags)
{
bool progress = false;

nir_builder build;
nir_builder_init(&build, impl);

nir_foreach_block_reverse(block, impl) {
progress |= brw_nir_apply_trig_workarounds_block(&build, block, condition_flags);
}

if (progress) {
nir_metadata_preserve(impl, nir_metadata_block_index |
nir_metadata_dominance);
} else {
#ifndef NDEBUG
impl->valid_metadata &= ~nir_metadata_not_properly_reset;
#endif
}

return progress;
}


bool
brw_nir_apply_trig_workarounds(nir_shader *shader)
{
bool progress = false;
bool condition_flags[1];
const nir_shader_compiler_options *options = shader->options;
(void) options;

condition_flags[0] = true;

nir_foreach_function(function, shader) {
if (function->impl)
progress |= brw_nir_apply_trig_workarounds_impl(function->impl, condition_flags);
}

return progress;
}

Loading