Skip to content

Commit 518c67b

Browse files
committed
driver, mipi: Remove macro generation
Macros should not be generated per-driver. Instead, they should be added to a header file on mainline. Remove the macro generation as it won't be needed for a while. Link: https://lore.kernel.org/dri-devel/[email protected]/ Signed-off-by: Richard Acayan <[email protected]>
1 parent 4de48df commit 518c67b

File tree

2 files changed

+1
-30
lines changed

2 files changed

+1
-30
lines changed

driver.py

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -72,31 +72,6 @@ def generate_struct(p: Panel, options: Options) -> str:
7272
return s
7373

7474

75-
def generate_macros(p: Panel) -> str:
76-
macros = set()
77-
for cmd in p.cmds.values():
78-
# Check which macros are necessary
79-
for macro in mipi.MACROS.keys():
80-
if macro in cmd.generated:
81-
macros.add(macro)
82-
83-
s = ''
84-
for macro, expr in mipi.MACROS.items():
85-
if not macro in macros:
86-
continue
87-
s += f'''
88-
89-
#define {macro}(dsi, seq...) do {{ \\
90-
static const u8 d[] = {{ seq }}; \\
91-
int ret; \\
92-
ret = {expr}(dsi, d, ARRAY_SIZE(d)); \\
93-
if (ret < 0) \\
94-
return ret; \\
95-
}} while (0)\
96-
'''
97-
return s
98-
99-
10075
# msleep(< 20) will possibly sleep up to 20ms
10176
# In this case, usleep_range should be used
10277
def msleep(m: int) -> str:
@@ -493,7 +468,7 @@ def generate_driver(p: Panel, options: Options) -> None:
493468
{wrap.simple([f'static inline', f'struct {p.short_id} *to_{p.short_id}(struct drm_panel *panel)'])}
494469
{{
495470
return container_of(panel, struct {p.short_id}, panel);
496-
}}{generate_macros(p)}
471+
}}
497472
{generate_reset(p, options)}
498473
{generate_commands(p, options, 'on')}
499474
{generate_commands(p, options, 'off')}

mipi.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,10 +188,6 @@ def _generate_checked_call(method: str, args: List[str], description: str) -> st
188188
'''
189189

190190

191-
MACROS = {
192-
}
193-
194-
195191
def _generate_generic_write(t: Transaction, payload: bytes, options: Options) -> str:
196192
# TODO: Warn when downstream uses LONG_WRITE but mainline would use SHORT
197193
params = _get_params_hex(payload)

0 commit comments

Comments
 (0)