drm2netbsd revision 1.6
11.1Sriastrad#!/bin/sh
21.1Sriastrad
31.6Sriastrad#	$NetBSD: drm2netbsd,v 1.6 2024/07/02 20:09:30 riastradh Exp $
41.1Sriastrad#
51.1Sriastrad# $ /path/to/drm2netbsd > /path/to/files.drm.new
61.1Sriastrad#
71.1Sriastrad# Run from the directory that came from drivers/gpu/drm.
81.1Sriastrad
91.1Sriastradset -Ceu
101.1Sriastrad
111.1Sriastrad# Location of the DRMKMS sources relative to $NETBSDSRCDIR.
121.1Sriastraddrmkms_top=external/bsd/drm2/dist/drm
131.1Sriastrad
141.1Sriastrad# config(5) flag for the DRMKMS driver.
151.1Sriastraddrmkms_flag=drmkms
161.1Sriastrad
171.6Sriastradenv CONFIG_COMPAT=y \
181.6Sriastradenv CONFIG_DRM=y \
191.6Sriastradenv CONFIG_DRM_BUDDY=y \
201.6Sriastradenv CONFIG_DRM_EXEC=y \
211.2Sriastradenv CONFIG_DRM_FBDEV_EMULATION=y \
221.4Sriastradenv CONFIG_DRM_GEM_CMA_HELPER=y \
231.6Sriastradenv CONFIG_DRM_GEM_DMA_HELPER=y \
241.6Sriastradenv CONFIG_DRM_GEM_SHMEM_HELPER=y \
251.6Sriastradenv CONFIG_DRM_KMS_HELPER=y \
261.6Sriastradenv CONFIG_DRM_LEGACY=y \
271.6Sriastradenv CONFIG_DRM_MIPI_DBI=y \
281.6Sriastradenv CONFIG_DRM_MIPI_DSI=y \
291.4Sriastradenv CONFIG_DRM_PANEL=y \
301.6Sriastradenv CONFIG_DRM_PANEL_ORIENTATION_QUIRKS=y \
311.6Sriastradenv CONFIG_DRM_PRIVACY_SCREEN=y \
321.6Sriastradenv CONFIG_DRM_SCHED=y \
331.6Sriastradenv CONFIG_DRM_SUBALLOC_HELPER=y \
341.3Sriastradenv CONFIG_DRM_VM=y \
351.6Sriastradenv CONFIG_DRM_VRAM_HELPER=y \
361.6Sriastradenv CONFIG_OF=y \
371.6Sriastradenv CONFIG_PCI=y \
381.1Sriastradmake -f Makefile -V '$(drm-y)' -V '$(drm_kms_helper-y)' \
391.1Sriastrad| tr ' ' '\n' \
401.1Sriastrad| grep -v '^$' \
411.5Sriastrad| {
421.5Sriastrad	sed -e 's,\.o$,.c,'
431.5Sriastrad	# Separate objects.
441.5Sriastrad	echo drm_panel_orientation_quirks.c
451.5Sriastrad} | sort -u \
461.1Sriastrad| while read f; do
471.1Sriastrad	printf 'file\t%s\t%s\n' "$drmkms_top/$f" "$drmkms_flag"
481.1Sriastraddone
49