Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Gustavo Sousa <gustavo.sousa@intel.com>
To: Jani Nikula <jani.nikula@intel.com>,
	<intel-gfx@lists.freedesktop.org>,
	<intel-xe@lists.freedesktop.org>
Cc: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Subject: Re: [PATCH 2/3] drm/i915/display: Add infra to reduce global state funcs boilerplate
Date: Fri, 20 Dec 2024 10:56:46 -0300	[thread overview]
Message-ID: <173470300698.2440.11037743612320372311@intel.com> (raw)
In-Reply-To: <87ldwapwig.fsf@intel.com>

Quoting Jani Nikula (2024-12-20 05:51:51-03:00)
>On Thu, 19 Dec 2024, Gustavo Sousa <gustavo.sousa@intel.com> wrote:
>> diff --git a/drivers/gpu/drm/i915/display/intel_global_state.h b/drivers/gpu/drm/i915/display/intel_global_state.h
>> index 6506a8e32972..e47e007225cc 100644
>> --- a/drivers/gpu/drm/i915/display/intel_global_state.h
>> +++ b/drivers/gpu/drm/i915/display/intel_global_state.h
>> @@ -8,6 +8,8 @@
>>  
>>  #include <linux/kref.h>
>>  #include <linux/list.h>
>> +#include <linux/stddef.h>
>
>What do you need this for?

Because of offsetof().

--
Gustavo Sousa

>
>> +#include <linux/types.h>
>>  
>>  struct drm_i915_private;
>>  struct intel_atomic_state;
>> @@ -15,6 +17,10 @@ struct intel_global_obj;
>>  struct intel_global_state;
>>  
>>  struct intel_global_state_funcs {
>> +        /* state_size and base_offset are initialized by INTEL_GLOBAL_STATE_DEFAULTS() */
>> +        size_t state_size;
>> +        size_t base_offset;
>> +
>>          struct intel_global_state *(*atomic_duplicate_state)(struct intel_global_obj *obj);
>>          void (*atomic_destroy_state)(struct intel_global_obj *obj,
>>                                       struct intel_global_state *state);
>> @@ -26,6 +32,10 @@ struct intel_global_obj {
>>          const struct intel_global_state_funcs *funcs;
>>  };
>>  
>> +#define INTEL_GLOBAL_STATE_DEFAULTS(type, base_member) \
>> +        .state_size = sizeof(type), \
>> +        .base_offset = offsetof(type, base_member)
>> +
>>  #define intel_for_each_global_obj(obj, dev_priv) \
>>          list_for_each_entry(obj, &(dev_priv)->display.global.obj_list, head)
>>  
>> @@ -96,4 +106,9 @@ int intel_atomic_global_state_wait_for_dependencies(struct intel_atomic_state *s
>>  
>>  bool intel_atomic_global_state_is_serialized(struct intel_atomic_state *state);
>>  
>> +struct intel_global_state *
>> +intel_atomic_global_duplicate_state_common(struct intel_global_obj *obj);
>> +void intel_atomic_global_destroy_state_common(struct intel_global_obj *obj,
>> +                                              struct intel_global_state *state);
>> +
>>  #endif
>
>-- 
>Jani Nikula, Intel

  reply	other threads:[~2024-12-20 13:57 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-19 21:48 [PATCH 0/3] drm/i915/display: Reduce global state funcs boilerplate Gustavo Sousa
2024-12-19 21:48 ` [PATCH 1/3] drm/i915/display: Do not assume zero offset when duplicating global state Gustavo Sousa
2024-12-19 22:43   ` Cavitt, Jonathan
2024-12-20  9:11   ` Ville Syrjälä
2024-12-20 13:37     ` Gustavo Sousa
2024-12-19 21:48 ` [PATCH 2/3] drm/i915/display: Add infra to reduce global state funcs boilerplate Gustavo Sousa
2024-12-19 22:44   ` Cavitt, Jonathan
2024-12-20 13:43     ` Gustavo Sousa
2024-12-20  8:50   ` Jani Nikula
2024-12-20 13:54     ` Gustavo Sousa
2024-12-20  8:51   ` Jani Nikula
2024-12-20 13:56     ` Gustavo Sousa [this message]
2024-12-20  9:23   ` Ville Syrjälä
2024-12-20 14:02     ` Gustavo Sousa
2024-12-19 21:48 ` [PATCH 3/3] drm/i915/display: Use INTEL_GLOBAL_STATE_DEFAULTS Gustavo Sousa
2024-12-19 22:45   ` Cavitt, Jonathan
2024-12-20 14:08     ` Gustavo Sousa
2024-12-19 22:51 ` ✓ CI.Patch_applied: success for drm/i915/display: Reduce global state funcs boilerplate Patchwork
2024-12-19 22:51 ` ✗ CI.checkpatch: warning " Patchwork
2024-12-19 22:53 ` ✓ CI.KUnit: success " Patchwork
2024-12-19 23:13 ` ✓ CI.Build: " Patchwork
2024-12-19 23:15 ` ✓ CI.Hooks: " Patchwork
2024-12-19 23:17 ` ✗ CI.checksparse: warning " Patchwork
2024-12-19 23:52 ` ✓ Xe.CI.BAT: success " Patchwork
2024-12-20 22:48 ` ✗ Xe.CI.Full: failure " 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=173470300698.2440.11037743612320372311@intel.com \
    --to=gustavo.sousa@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --cc=ville.syrjala@linux.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox