Module Name:    src
Committed By:   riastradh
Date:           Sun Dec 19 09:59:05 UTC 2021

Modified Files:
        src/sys/external/bsd/drm2/dist/drm/i915/display: intel_display.h

Log Message:
Re-introduce: Hackily rename enum pipe for drm, without patching.

The patch we used to maintain to do this rename doubled the pain
of merging drm updates.  But ctf gets confused if we have a struct
and an enum both called `pipe', and it's technically against
C99 to do so.  So #define it in all drm code for now to fix
dtrace.

Author: Maya Rashish <m...@netbsd.org>


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
    src/sys/external/bsd/drm2/dist/drm/i915/display/intel_display.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/i915/display/intel_display.h
diff -u src/sys/external/bsd/drm2/dist/drm/i915/display/intel_display.h:1.2 src/sys/external/bsd/drm2/dist/drm/i915/display/intel_display.h:1.3
--- src/sys/external/bsd/drm2/dist/drm/i915/display/intel_display.h:1.2	Sat Dec 18 23:45:29 2021
+++ src/sys/external/bsd/drm2/dist/drm/i915/display/intel_display.h	Sun Dec 19 09:59:05 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: intel_display.h,v 1.2 2021/12/18 23:45:29 riastradh Exp $	*/
+/*	$NetBSD: intel_display.h,v 1.3 2021/12/19 09:59:05 riastradh Exp $	*/
 
 /*
  * Copyright © 2006-2019 Intel Corporation
@@ -77,6 +77,23 @@ enum i915_gpio {
 };
 
 /*
+ * NetBSD already has struct pipe, and according to C99 6.2.3 there's
+ * only one namespace for struct, union, and enum tags, but the i915
+ * driver wants a type called enum pipe.
+ *
+ * So rename it to avoid conflicts which confuse tools like ctfmerge --
+ * but make sure we include <sys/file.h> first to avoid having two
+ * different versions of struct file, one with a pointer to struct pipe
+ * and another with a pointer to struct i915_pipe.
+ *
+ * This will cause trouble if we ever have an API that involves `pipe'
+ * as a member which we need to reference from within drm code.  But
+ * for now that is not the case.
+ *
+ * XXX Yes, this is disgusting.  Sorry.
+ */
+#define	pipe	pipe_drmhack
+/*
  * Keep the pipe enum values fixed: the code assumes that PIPE_A=0, the
  * rest have consecutive values and match the enum values of transcoders
  * with a 1:1 transcoder -> pipe mapping.

Reply via email to