mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-01 16:48:07 +02:00
intel/decoder: Make intel_spec_load_filename() have separate dir and name strings
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20889>
This commit is contained in:
parent
b4c8d2dc45
commit
bfe4a0e744
4 changed files with 8 additions and 15 deletions
|
|
@ -21,7 +21,6 @@
|
|||
* IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <libgen.h>
|
||||
#include <stdio.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
|
@ -744,18 +743,9 @@ intel_spec_load(const struct intel_device_info *devinfo)
|
|||
}
|
||||
|
||||
struct intel_spec *
|
||||
intel_spec_load_filename(const char *filename)
|
||||
intel_spec_load_filename(const char *dir, const char *name)
|
||||
{
|
||||
char *tmp = strdup(filename);
|
||||
char *dir = strdup(dirname(tmp));
|
||||
free(tmp);
|
||||
tmp = strdup(filename);
|
||||
char *base = strdup(basename(tmp));
|
||||
free(tmp);
|
||||
struct intel_spec *spec = intel_spec_load_common(0, dir, base);
|
||||
free(dir);
|
||||
free(base);
|
||||
return spec;
|
||||
return intel_spec_load_common(0, dir, name);
|
||||
}
|
||||
|
||||
struct intel_spec *
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ struct intel_spec *intel_spec_load(const struct intel_device_info *devinfo);
|
|||
struct intel_spec *
|
||||
intel_spec_load_from_path(const struct intel_device_info *devinfo,
|
||||
const char *path);
|
||||
struct intel_spec *intel_spec_load_filename(const char *filename);
|
||||
struct intel_spec *intel_spec_load_filename(const char *dir, const char *name);
|
||||
void intel_spec_destroy(struct intel_spec *spec);
|
||||
uint32_t intel_spec_get_gen(struct intel_spec *spec);
|
||||
struct intel_group *intel_spec_find_instruction(struct intel_spec *spec,
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@
|
|||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
# SOFTWARE.
|
||||
|
||||
fs = import('fs')
|
||||
|
||||
files_libintel_common = files(
|
||||
'i915/intel_engine.c',
|
||||
'i915/intel_engine.h',
|
||||
|
|
@ -114,7 +116,8 @@ if with_tests and not with_platform_android
|
|||
dependencies : [idep_mesautil, idep_intel_dev],
|
||||
link_with : libintel_common,
|
||||
c_args : [
|
||||
'-DGENXML_PATH="@0@"'.format(genxml_path)
|
||||
'-DGENXML_DIR="@0@"'.format(fs.parent(genxml_path)),
|
||||
'-DGENXML_FILE="@0@"'.format(fs.name(genxml_path)),
|
||||
],
|
||||
),
|
||||
args : ['-quiet'],
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ test_two_levels(struct intel_spec *spec) {
|
|||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
struct intel_spec *spec = intel_spec_load_filename(GENXML_PATH);
|
||||
struct intel_spec *spec = intel_spec_load_filename(GENXML_DIR, GENXML_FILE);
|
||||
|
||||
if (argc > 1 && strcmp(argv[1], "-quiet") == 0)
|
||||
quiet = true;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue