File: igt_panel.c

package info (click to toggle)
intel-gpu-tools 2.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 63,360 kB
  • sloc: xml: 781,458; ansic: 360,567; python: 8,336; yacc: 2,781; perl: 1,196; sh: 1,177; lex: 487; asm: 227; lisp: 35; makefile: 30
file content (39 lines) | stat: -rw-r--r-- 922 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/* SPDX-License-Identifier: MIT */
/*
 * Copyright © 2025 Intel Corporation
 */

#include <stdbool.h>
#include <string.h>

#include "drmtest.h"
#include "igt_panel.h"

/**
 * igt_is_panel_blocked - Checks if a given vendor name is present in a blocklist.
 *
 * @vendor_name: The name of the vendor to check for in the blocklist.
 * @blocklist: An array of strings representing the blocklist.
 * @blocklist_size: The number of entries in the blocklist array.
 *
 * Returns:
 * true if the vendor name is found in the blocklist, false otherwise.
 */
bool igt_is_panel_blocked(const char *vendor_name,
			  const char *const blocklist[],
			  size_t blocklist_size)
{
	int i;

	if (!vendor_name || vendor_name[0] == '\0' ||
	    (vendor_name[0] == ' ' && vendor_name[1] == '\0'))
		return false;

	for (i = 0; i < blocklist_size; i++) {
		if (strstr(blocklist[i], vendor_name) != NULL)
			return true;
	}

	return false;
}