Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/drm2/dist/drm/i915/display Re-introduce: Ha...



details:   https://anonhg.NetBSD.org/src/rev/2eddee84a591
branches:  trunk
changeset: 1028270:2eddee84a591
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Dec 19 09:59:05 2021 +0000

description:
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 <maya%NetBSD.org@localhost>

diffstat:

 sys/external/bsd/drm2/dist/drm/i915/display/intel_display.h |  19 ++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)

diffs (33 lines):

diff -r 380b83c0d7f5 -r 2eddee84a591 sys/external/bsd/drm2/dist/drm/i915/display/intel_display.h
--- a/sys/external/bsd/drm2/dist/drm/i915/display/intel_display.h       Sun Dec 19 09:58:57 2021 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/display/intel_display.h       Sun Dec 19 09:59:05 2021 +0000
@@ -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 @@
 };
 
 /*
+ * 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.



Home | Main Index | Thread Index | Old Index