[Intel-gfx] [PATCH 16/23] drm/i915: Introduce GEN4_FEATURES for device info

Rodrigo Vivi rodrigo.vivi at gmail.com
Wed Jul 20 21:44:21 UTC 2016


On Wed, Jul 20, 2016 at 10:40 AM, Carlos Santa <carlos.santa at intel.com> wrote:
> Based on the GEN7_FEATURES changes from Ben W.
>
> Use it for i965g, i965gm, g45,and gm45.
>
> Signed-off-by: Carlos Santa <carlos.santa at intel.com>
> ---
>  drivers/gpu/drm/i915/i915_pci.c | 51 ++++++++++++++++++++++-------------------
>  1 file changed, 28 insertions(+), 23 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
> index 4652e2d..c4fdb4d 100644
> --- a/drivers/gpu/drm/i915/i915_pci.c
> +++ b/drivers/gpu/drm/i915/i915_pci.c
> @@ -123,23 +123,34 @@ static const struct intel_device_info intel_i945gm_info = {
>         CURSOR_OFFSETS,
>  };
>
> +#define GEN4_FEATURES \
> +       .gen = 4, .num_pipes = 2, \
> +       .has_hotplug = 1, \
> +       GEN_DEFAULT_PIPEOFFSETS, \
> +       CURSOR_OFFSETS
> +

I like this

> +#define GEN4_G45_FEATURES \
> +       .is_g4x = 1, .need_gfx_hws = 1, \
> +       .has_pipe_cxsr = 1, \
> +       .ring_mask = RENDER_RING | BSD_RING
> +
> +#define GEN4_i965_FEATURES \
> +       .has_overlay = 1, \
> +       .ring_mask = RENDER_RING
> +

but I believe these should be handled separated/individually
unless they inherit GEN4_FEATURES somehow...

>  static const struct intel_device_info intel_i965g_info = {
> -       .gen = 4, .is_broadwater = 1, .num_pipes = 2,
> -       .has_hotplug = 1,
> -       .has_overlay = 1,
> -       .ring_mask = RENDER_RING,
> -       GEN_DEFAULT_PIPEOFFSETS,
> -       CURSOR_OFFSETS,
> +       GEN4_FEATURES,
> +       GEN4_i965_FEATURES,
> +       .is_broadwater = 1,
> +
>  };
>
>  static const struct intel_device_info intel_i965gm_info = {
> -       .gen = 4, .is_crestline = 1, .num_pipes = 2,
> -       .is_mobile = 1, .has_fbc = 1, .has_hotplug = 1,
> -       .has_overlay = 1,
> +       GEN4_FEATURES,
> +       GEN4_i965_FEATURES,

... to avoid these 2 macros here.

> +       .is_crestline = 1,
> +       .is_mobile = 1, .has_fbc = 1,
>         .supports_tv = 1,
> -       .ring_mask = RENDER_RING,
> -       GEN_DEFAULT_PIPEOFFSETS,
> -       CURSOR_OFFSETS,
>  };
>
>  static const struct intel_device_info intel_g33_info = {
> @@ -152,21 +163,15 @@ static const struct intel_device_info intel_g33_info = {
>  };
>
>  static const struct intel_device_info intel_g45_info = {
> -       .gen = 4, .is_g4x = 1, .need_gfx_hws = 1, .num_pipes = 2,
> -       .has_pipe_cxsr = 1, .has_hotplug = 1,
> -       .ring_mask = RENDER_RING | BSD_RING,
> -       GEN_DEFAULT_PIPEOFFSETS,
> -       CURSOR_OFFSETS,
> +       GEN4_FEATURES,
> +       GEN4_G45_FEATURES,
>  };
>
>  static const struct intel_device_info intel_gm45_info = {
> -       .gen = 4, .is_g4x = 1, .num_pipes = 2,
> -       .is_mobile = 1, .need_gfx_hws = 1, .has_fbc = 1,
> -       .has_pipe_cxsr = 1, .has_hotplug = 1,
> +       GEN4_FEATURES,
> +       GEN4_G45_FEATURES,
> +       .is_mobile = 1, .has_fbc = 1,
>         .supports_tv = 1,
> -       .ring_mask = RENDER_RING | BSD_RING,
> -       GEN_DEFAULT_PIPEOFFSETS,
> -       CURSOR_OFFSETS,
>  };
>
>  static const struct intel_device_info intel_pineview_info = {
> --
> 1.9.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx



-- 
Rodrigo Vivi
Blog: http://blog.vivi.eng.br


More information about the Intel-gfx mailing list