From: Jani Nikula <jani.nikula@intel.com>
To: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: intel-xe@lists.freedesktop.org, rodrigo.vivi@intel.com
Subject: Re: [Intel-xe] [PATCH 1/9] fixup! drm/xe/display: Implement display support
Date: Mon, 24 Apr 2023 14:41:38 +0300 [thread overview]
Message-ID: <87pm7t33t9.fsf@intel.com> (raw)
In-Reply-To: <3tbvdpag33peyu4xechzmeagdokffu7keqjjrudsjjmwaduugx@gjodtnvlx4p3>
On Fri, 21 Apr 2023, Lucas De Marchi <lucas.demarchi@intel.com> wrote:
> On Thu, Apr 20, 2023 at 11:49:46AM +0300, Jani Nikula wrote:
>>On Wed, 19 Apr 2023, Lucas De Marchi <lucas.demarchi@intel.com> wrote:
>>> On Wed, Apr 19, 2023 at 03:39:39PM +0300, Jani Nikula wrote:
>>>>Build the i915 display object files in i915-display sub-directory, to
>>>>increase clarity over what's coming from i915, and to simplify the rule
>>>>to build the object files.
>>>>
>>>>Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>>>>---
>>>> drivers/gpu/drm/xe/Makefile | 165 +++++++++++++++++-------------------
>>>> 1 file changed, 78 insertions(+), 87 deletions(-)
>>>>
>>>>diff --git a/drivers/gpu/drm/xe/Makefile b/drivers/gpu/drm/xe/Makefile
>>>>index aceca651de57..9fa4aaad6b8f 100644
>>>>--- a/drivers/gpu/drm/xe/Makefile
>>>>+++ b/drivers/gpu/drm/xe/Makefile
>>>>@@ -105,100 +105,20 @@ subdir-ccflags-$(CONFIG_DRM_XE_DISPLAY) += \
>>>> -Ddrm_i915_gem_object=xe_bo \
>>>> -Ddrm_i915_private=xe_device
>>>
>>> by leaving them on the same dir I was actually thinking if it would not
>>> be possible to add a display/Makefile so these additional defines here
>>> are added as subdir-ccflags only there.
>>
>>This is my understanding, I may be wrong:
>>
>>* If you want subdir-ccflags-y to only apply within a subdirectory, you
>> need to descend to the subdirectory using "obj-y += subdir" and have a
>> standalone Makefile.
>>
>>* If you use "include $(src)/subdir/Makefile", subdir-ccflags-y
>> specified there applies to the parent directory.
>>
>>* If you descend to the subdirectory using "obj-y += subdir", I don't
>> think you can have the parent and subdirectory Makefiles add objects
>> to the same module.
>
> true, but the snippet below does the trick for me. The problem is: it
> doesn't work due to the include dep:
>
> xe_device_types.h -> intel_display_core.h -> {the-display-world}.h
That's basically the same problem as i915_drv.h -> intel_display_core.h
in i915 land, and the solution is pretty much the same also: make the
display substruct member a pointer opaque to non-display code, and
allocate it dynamically.
That's what all the display header and include refactoring have
gradually been leading up to, but this one's just massively disruptive.
BR,
Jani.
>
> Anyway, here is what I used to remove the cflags from the !display
> sources:
>
> -------------------8<-----------------
> Subject: [PATCH] WIP cflags display removal
>
> ---
> drivers/gpu/drm/xe/Makefile | 36 +++++++++++++++++++++---------------
> 1 file changed, 21 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/Makefile b/drivers/gpu/drm/xe/Makefile
> index ee4a95beec20..fea31cfc3de6 100644
> --- a/drivers/gpu/drm/xe/Makefile
> +++ b/drivers/gpu/drm/xe/Makefile
> @@ -96,24 +96,13 @@ xe-y += xe_bb.o \
> xe_wa.o \
> xe_wopcm.o
>
> -# i915 Display compat #defines and #includes
> -subdir-ccflags-$(CONFIG_DRM_XE_DISPLAY) += \
> - -I$(srctree)/$(src)/display/ext \
> - -I$(srctree)/$(src)/compat-i915-headers \
> - -I$(srctree)/drivers/gpu/drm/xe/display/ \
> - -I$(srctree)/drivers/gpu/drm/i915/display/ \
> - -Ddrm_i915_gem_object=xe_bo \
> - -Ddrm_i915_private=xe_device
> -
> -CFLAGS_i915-display/intel_fbdev.o = $(call cc-disable-warning, override-init)
> -
> # Rule to build display code shared with i915
> $(obj)/i915-display/%.o: $(srctree)/drivers/gpu/drm/i915/display/%.c FORCE
> $(call cmd,force_checksrc)
> $(call if_changed_rule,cc_o_c)
>
> # Display code specific to xe
> -xe-$(CONFIG_DRM_XE_DISPLAY) += \
> +xe-display += \
> xe_display.o \
> display/xe_fb_pin.o \
> display/xe_hdcp_gsc.o \
> @@ -126,7 +115,7 @@ xe-$(CONFIG_DRM_XE_DISPLAY) += \
> display/ext/intel_pch.o
>
> # Display code shared with i915
> -xe-$(CONFIG_DRM_XE_DISPLAY) += \
> +xe-display += \
> i915-display/icl_dsi.o \
> i915-display/intel_atomic.o \
> i915-display/intel_atomic_plane.o \
> @@ -197,15 +186,32 @@ xe-$(CONFIG_DRM_XE_DISPLAY) += \
> i915-display/skl_watermark.o
>
> ifeq ($(CONFIG_ACPI),y)
> - xe-$(CONFIG_DRM_XE_DISPLAY) += \
> + xe-display += \
> i915-display/intel_acpi.o \
> i915-display/intel_opregion.o
> endif
>
> ifeq ($(CONFIG_DRM_FBDEV_EMULATION),y)
> - xe-$(CONFIG_DRM_XE_DISPLAY) += i915-display/intel_fbdev.o
> + xe-display += i915-display/intel_fbdev.o
> endif
>
> +# i915 Display compat #defines and #includes
> +xe-display-ccflags += \
> + -I$(srctree)/$(src)/display/ext \
> + -I$(srctree)/$(src)/compat-i915-headers \
> + -I$(srctree)/drivers/gpu/drm/xe/display/ \
> + -I$(srctree)/drivers/gpu/drm/i915/display/ \
> + -Ddrm_i915_gem_object=xe_bo \
> + -Ddrm_i915_private=xe_device
> +
> +CFLAGS_i915-display/intel_fbdev.o = $(call cc-disable-warning, override-init)
> +
> +# Apply CFAGS to all display sources
> +$(foreach d,$(xe-display), \
> + $(eval CFLAGS_$(d) += $(xe-display-ccflags)))
> +
> +xe-$(CONFIG_DRM_XE_DISPLAY) += $(xe-display)
> +
> obj-$(CONFIG_DRM_XE) += xe.o
> obj-$(CONFIG_DRM_XE_KUNIT_TEST) += tests/
--
Jani Nikula, Intel Open Source Graphics Center
next prev parent reply other threads:[~2023-04-24 11:41 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-19 12:39 [Intel-xe] [PATCH 0/9] xe & i915 display integration cleanups Jani Nikula
2023-04-19 12:39 ` [Intel-xe] [PATCH 1/9] fixup! drm/xe/display: Implement display support Jani Nikula
2023-04-19 21:56 ` Lucas De Marchi
2023-04-20 8:49 ` Jani Nikula
2023-04-21 21:27 ` Lucas De Marchi
2023-04-24 11:41 ` Jani Nikula [this message]
2023-04-19 12:39 ` [Intel-xe] [PATCH 2/9] drm/i915/wm: remove stale and unused ilk_wm_max_level() declaration Jani Nikula
2023-04-19 19:35 ` Rodrigo Vivi
2023-04-19 19:49 ` Rodrigo Vivi
2023-04-19 19:50 ` Jani Nikula
2023-04-19 12:39 ` [Intel-xe] [PATCH 3/9] drm/i915/display: add I915 conditional build to i9xx_wm.h Jani Nikula
2023-04-19 19:35 ` Rodrigo Vivi
2023-04-19 12:39 ` [Intel-xe] [PATCH 4/9] fixup! drm/xe/display: Implement display support Jani Nikula
2023-04-19 12:39 ` [Intel-xe] [PATCH 5/9] drm/i915: rename intel_pm.[ch] to intel_clock_gating.[ch] Jani Nikula
2023-04-19 12:39 ` [Intel-xe] [PATCH 6/9] fixup! drm/xe/display: Implement display support Jani Nikula
2023-04-19 12:39 ` [Intel-xe] [PATCH 7/9] drm/i915: use explicit includes for i915_reg.h and i915_irq.h Jani Nikula
2023-04-19 19:36 ` Rodrigo Vivi
2023-04-19 12:39 ` [Intel-xe] [PATCH 8/9] fixup! drm/xe/display: Implement display support Jani Nikula
2023-04-19 12:39 ` [Intel-xe] [PATCH 9/9] fixup! drm/i915/display: Remaining changes to make xe compile Jani Nikula
2023-04-19 12:43 ` [Intel-xe] ✓ CI.Patch_applied: success for xe & i915 display integration cleanups Patchwork
2023-04-19 12:44 ` [Intel-xe] ✓ CI.KUnit: " Patchwork
2023-04-19 12:48 ` [Intel-xe] ✓ CI.Build: " Patchwork
2023-04-19 13:10 ` [Intel-xe] ○ CI.BAT: info " Patchwork
2023-04-19 19:33 ` [Intel-xe] [PATCH 0/9] " Rodrigo Vivi
2023-04-20 19:30 ` Rodrigo Vivi
2023-04-20 19:59 ` Jani Nikula
2023-04-21 21:29 ` [Intel-xe] ✗ CI.Patch_applied: failure for xe & i915 display integration cleanups (rev2) Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87pm7t33t9.fsf@intel.com \
--to=jani.nikula@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=lucas.demarchi@intel.com \
--cc=rodrigo.vivi@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.