Re: [Intel-gfx] [RFC 01/15] drm/i915: Make I830 platform support optional

2018-02-09 Thread Jani Nikula
On Thu, 08 Feb 2018, Tvrtko Ursulin  wrote:
> From: Tvrtko Ursulin 
>
> Signed-off-by: Tvrtko Ursulin 
> ---
>  drivers/gpu/drm/i915/Kconfig   | 5 +
>  drivers/gpu/drm/i915/Kconfig.platforms | 6 ++
>  drivers/gpu/drm/i915/i915_drv.h| 5 -
>  drivers/gpu/drm/i915/i915_pci.c| 4 
>  4 files changed, 19 insertions(+), 1 deletion(-)
>  create mode 100644 drivers/gpu/drm/i915/Kconfig.platforms
>
> diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig
> index dfd95889f4b7..1363d05e6ec5 100644
> --- a/drivers/gpu/drm/i915/Kconfig
> +++ b/drivers/gpu/drm/i915/Kconfig
> @@ -131,3 +131,8 @@ depends on DRM_I915
>  depends on EXPERT
>  source drivers/gpu/drm/i915/Kconfig.debug
>  endmenu
> +
> +menu "Platform support"
> +depends on DRM_I915
> +source drivers/gpu/drm/i915/Kconfig.platforms
> +endmenu
> diff --git a/drivers/gpu/drm/i915/Kconfig.platforms 
> b/drivers/gpu/drm/i915/Kconfig.platforms
> new file mode 100644
> index ..f3949fff21e9
> --- /dev/null
> +++ b/drivers/gpu/drm/i915/Kconfig.platforms
> @@ -0,0 +1,6 @@
> +config DRM_I915_PLATFORM_INTEL_I830
> + bool "Intel i830 platform support"
> + default y
> + depends on DRM_I915
> + help
> +   Include support for Intel i830 platform.
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 28a2671a26c7..6acd9789b452 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -2575,7 +2575,10 @@ intel_info(const struct drm_i915_private *dev_priv)
>  
>  #define IS_PLATFORM(dev_priv, p) ((dev_priv)->info.platform_mask & BIT(p))
>  
> -#define IS_I830(dev_priv)IS_PLATFORM(dev_priv, INTEL_I830)
> +#define IS_OPT_PLATFORM(dev_priv, p) \
> + (IS_ENABLED(CONFIG_DRM_I915_PLATFORM_##p) && IS_PLATFORM(dev_priv, p))
> +
> +#define IS_I830(dev_priv)IS_OPT_PLATFORM(dev_priv, INTEL_I830)
>  #define IS_I845G(dev_priv)   IS_PLATFORM(dev_priv, INTEL_I845G)
>  #define IS_I85X(dev_priv)IS_PLATFORM(dev_priv, INTEL_I85X)
>  #define IS_I865G(dev_priv)   IS_PLATFORM(dev_priv, INTEL_I865G)
> diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
> index 4e7a10c89782..81573073dceb 100644
> --- a/drivers/gpu/drm/i915/i915_pci.c
> +++ b/drivers/gpu/drm/i915/i915_pci.c
> @@ -74,12 +74,14 @@
>   GEN_DEFAULT_PAGE_SIZES, \
>   CURSOR_OFFSETS
>  
> +#ifdef CONFIG_DRM_I915_PLATFORM_INTEL_I830
>  static const struct intel_device_info intel_i830_info = {
>   GEN2_FEATURES,
>   .platform = INTEL_I830,
>   .is_mobile = 1, .cursor_needs_physical = 1,
>   .num_pipes = 2, /* legal, last one wins */
>  };
> +#endif

Is the compiler not smart enough to throw the device info away without
the #ifdefs? You're removing the only reference to it below after
all. Ditto throughout the series.

BR,
Jani.

>  
>  static const struct intel_device_info intel_i845g_info = {
>   GEN2_FEATURES,
> @@ -599,7 +601,9 @@ static const struct intel_device_info 
> intel_icelake_11_info = {
>   * PCI ID matches, otherwise we'll use the wrong info struct above.
>   */
>  static const struct pci_device_id pciidlist[] = {
> +#ifdef CONFIG_DRM_I915_PLATFORM_INTEL_I830
>   INTEL_I830_IDS(_i830_info),
> +#endif
>   INTEL_I845G_IDS(_i845g_info),
>   INTEL_I85X_IDS(_i85x_info),
>   INTEL_I865G_IDS(_i865g_info),

-- 
Jani Nikula, Intel Open Source Technology Center
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [RFC 01/15] drm/i915: Make I830 platform support optional

2018-02-08 Thread Chris Wilson
Quoting Tvrtko Ursulin (2018-02-08 13:05:52)
> From: Tvrtko Ursulin 
> 
> Signed-off-by: Tvrtko Ursulin 
> ---
>  drivers/gpu/drm/i915/Kconfig   | 5 +
>  drivers/gpu/drm/i915/Kconfig.platforms | 6 ++
>  drivers/gpu/drm/i915/i915_drv.h| 5 -
>  drivers/gpu/drm/i915/i915_pci.c| 4 
>  4 files changed, 19 insertions(+), 1 deletion(-)
>  create mode 100644 drivers/gpu/drm/i915/Kconfig.platforms
> 
> diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig
> index dfd95889f4b7..1363d05e6ec5 100644
> --- a/drivers/gpu/drm/i915/Kconfig
> +++ b/drivers/gpu/drm/i915/Kconfig
> @@ -131,3 +131,8 @@ depends on DRM_I915
>  depends on EXPERT
>  source drivers/gpu/drm/i915/Kconfig.debug
>  endmenu
> +
> +menu "Platform support"
> +depends on DRM_I915
> +source drivers/gpu/drm/i915/Kconfig.platforms
> +endmenu
> diff --git a/drivers/gpu/drm/i915/Kconfig.platforms 
> b/drivers/gpu/drm/i915/Kconfig.platforms
> new file mode 100644
> index ..f3949fff21e9
> --- /dev/null
> +++ b/drivers/gpu/drm/i915/Kconfig.platforms
> @@ -0,0 +1,6 @@
> +config DRM_I915_PLATFORM_INTEL_I830
> +   bool "Intel i830 platform support"
> +   default y
> +   depends on DRM_I915
> +   help
> + Include support for Intel i830 platform.
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 28a2671a26c7..6acd9789b452 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -2575,7 +2575,10 @@ intel_info(const struct drm_i915_private *dev_priv)
>  
>  #define IS_PLATFORM(dev_priv, p) ((dev_priv)->info.platform_mask & BIT(p))
>  
> -#define IS_I830(dev_priv)  IS_PLATFORM(dev_priv, INTEL_I830)
> +#define IS_OPT_PLATFORM(dev_priv, p) \
> +   (IS_ENABLED(CONFIG_DRM_I915_PLATFORM_##p) && IS_PLATFORM(dev_priv, p))
> +
> +#define IS_I830(dev_priv)  IS_OPT_PLATFORM(dev_priv, INTEL_I830)
>  #define IS_I845G(dev_priv) IS_PLATFORM(dev_priv, INTEL_I845G)
>  #define IS_I85X(dev_priv)  IS_PLATFORM(dev_priv, INTEL_I85X)
>  #define IS_I865G(dev_priv) IS_PLATFORM(dev_priv, INTEL_I865G)
> diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
> index 4e7a10c89782..81573073dceb 100644
> --- a/drivers/gpu/drm/i915/i915_pci.c
> +++ b/drivers/gpu/drm/i915/i915_pci.c
> @@ -74,12 +74,14 @@
> GEN_DEFAULT_PAGE_SIZES, \
> CURSOR_OFFSETS
>  
> +#ifdef CONFIG_DRM_I915_PLATFORM_INTEL_I830

Be modern throughout, #if IS_ENABLED?

>  static const struct intel_device_info intel_i830_info = {
> GEN2_FEATURES,
> .platform = INTEL_I830,
> .is_mobile = 1, .cursor_needs_physical = 1,
> .num_pipes = 2, /* legal, last one wins */
>  };
> +#endif
>  
>  static const struct intel_device_info intel_i845g_info = {
> GEN2_FEATURES,
> @@ -599,7 +601,9 @@ static const struct intel_device_info 
> intel_icelake_11_info = {
>   * PCI ID matches, otherwise we'll use the wrong info struct above.
>   */
>  static const struct pci_device_id pciidlist[] = {
> +#ifdef CONFIG_DRM_I915_PLATFORM_INTEL_I830
> INTEL_I830_IDS(_i830_info),
> +#endif

This is exactly what I had in mind for the first draft. I was also
wondering how easy is it for us to create .section.platform. (Modules
within modules)
-Chris
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [RFC 01/15] drm/i915: Make I830 platform support optional

2018-02-08 Thread Tvrtko Ursulin
From: Tvrtko Ursulin 

Signed-off-by: Tvrtko Ursulin 
---
 drivers/gpu/drm/i915/Kconfig   | 5 +
 drivers/gpu/drm/i915/Kconfig.platforms | 6 ++
 drivers/gpu/drm/i915/i915_drv.h| 5 -
 drivers/gpu/drm/i915/i915_pci.c| 4 
 4 files changed, 19 insertions(+), 1 deletion(-)
 create mode 100644 drivers/gpu/drm/i915/Kconfig.platforms

diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig
index dfd95889f4b7..1363d05e6ec5 100644
--- a/drivers/gpu/drm/i915/Kconfig
+++ b/drivers/gpu/drm/i915/Kconfig
@@ -131,3 +131,8 @@ depends on DRM_I915
 depends on EXPERT
 source drivers/gpu/drm/i915/Kconfig.debug
 endmenu
+
+menu "Platform support"
+depends on DRM_I915
+source drivers/gpu/drm/i915/Kconfig.platforms
+endmenu
diff --git a/drivers/gpu/drm/i915/Kconfig.platforms 
b/drivers/gpu/drm/i915/Kconfig.platforms
new file mode 100644
index ..f3949fff21e9
--- /dev/null
+++ b/drivers/gpu/drm/i915/Kconfig.platforms
@@ -0,0 +1,6 @@
+config DRM_I915_PLATFORM_INTEL_I830
+   bool "Intel i830 platform support"
+   default y
+   depends on DRM_I915
+   help
+ Include support for Intel i830 platform.
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 28a2671a26c7..6acd9789b452 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -2575,7 +2575,10 @@ intel_info(const struct drm_i915_private *dev_priv)
 
 #define IS_PLATFORM(dev_priv, p) ((dev_priv)->info.platform_mask & BIT(p))
 
-#define IS_I830(dev_priv)  IS_PLATFORM(dev_priv, INTEL_I830)
+#define IS_OPT_PLATFORM(dev_priv, p) \
+   (IS_ENABLED(CONFIG_DRM_I915_PLATFORM_##p) && IS_PLATFORM(dev_priv, p))
+
+#define IS_I830(dev_priv)  IS_OPT_PLATFORM(dev_priv, INTEL_I830)
 #define IS_I845G(dev_priv) IS_PLATFORM(dev_priv, INTEL_I845G)
 #define IS_I85X(dev_priv)  IS_PLATFORM(dev_priv, INTEL_I85X)
 #define IS_I865G(dev_priv) IS_PLATFORM(dev_priv, INTEL_I865G)
diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
index 4e7a10c89782..81573073dceb 100644
--- a/drivers/gpu/drm/i915/i915_pci.c
+++ b/drivers/gpu/drm/i915/i915_pci.c
@@ -74,12 +74,14 @@
GEN_DEFAULT_PAGE_SIZES, \
CURSOR_OFFSETS
 
+#ifdef CONFIG_DRM_I915_PLATFORM_INTEL_I830
 static const struct intel_device_info intel_i830_info = {
GEN2_FEATURES,
.platform = INTEL_I830,
.is_mobile = 1, .cursor_needs_physical = 1,
.num_pipes = 2, /* legal, last one wins */
 };
+#endif
 
 static const struct intel_device_info intel_i845g_info = {
GEN2_FEATURES,
@@ -599,7 +601,9 @@ static const struct intel_device_info intel_icelake_11_info 
= {
  * PCI ID matches, otherwise we'll use the wrong info struct above.
  */
 static const struct pci_device_id pciidlist[] = {
+#ifdef CONFIG_DRM_I915_PLATFORM_INTEL_I830
INTEL_I830_IDS(_i830_info),
+#endif
INTEL_I845G_IDS(_i845g_info),
INTEL_I85X_IDS(_i85x_info),
INTEL_I865G_IDS(_i865g_info),
-- 
2.14.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx