Skip to content

Commit

Permalink
drm/i915/display: move global_obj_list under display sub-struct
Browse files Browse the repository at this point in the history
Move display global state member under drm_i915_private display
sub-struct.

Prefer adding anonymous sub-structs even for single members that aren't
our own structs.

Remove a nearby stale comment while at it.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221109144209.3624739-3-jani.nikula@intel.com
  • Loading branch information
Jani Nikula committed Nov 17, 2022
1 parent 6274991 commit e2925e1
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/i915/display/intel_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -8572,7 +8572,7 @@ static void intel_mode_config_init(struct drm_i915_private *i915)
struct drm_mode_config *mode_config = &i915->drm.mode_config;

drm_mode_config_init(&i915->drm);
INIT_LIST_HEAD(&i915->global_obj_list);
INIT_LIST_HEAD(&i915->display.global.obj_list);

mode_config->min_width = 0;
mode_config->min_height = 0;
Expand Down
4 changes: 4 additions & 0 deletions drivers/gpu/drm/i915/display/intel_display_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,10 @@ struct intel_display {
u32 rx_config;
} fdi;

struct {
struct list_head obj_list;
} global;

struct {
/*
* Base address of where the gmbus and gpio blocks are located
Expand Down
4 changes: 2 additions & 2 deletions drivers/gpu/drm/i915/display/intel_global_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ void intel_atomic_global_obj_init(struct drm_i915_private *dev_priv,

obj->state = state;
obj->funcs = funcs;
list_add_tail(&obj->head, &dev_priv->global_obj_list);
list_add_tail(&obj->head, &dev_priv->display.global.obj_list);
}

void intel_atomic_global_obj_cleanup(struct drm_i915_private *dev_priv)
{
struct intel_global_obj *obj, *next;

list_for_each_entry_safe(obj, next, &dev_priv->global_obj_list, head) {
list_for_each_entry_safe(obj, next, &dev_priv->display.global.obj_list, head) {
list_del(&obj->head);

drm_WARN_ON(&dev_priv->drm, kref_read(&obj->state->ref) != 1);
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/i915/display/intel_global_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ struct intel_global_obj {
};

#define intel_for_each_global_obj(obj, dev_priv) \
list_for_each_entry(obj, &(dev_priv)->global_obj_list, head)
list_for_each_entry(obj, &(dev_priv)->display.global.obj_list, head)

#define for_each_new_global_obj_in_state(__state, obj, new_obj_state, __i) \
for ((__i) = 0; \
Expand Down
4 changes: 0 additions & 4 deletions drivers/gpu/drm/i915/i915_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -292,10 +292,6 @@ struct drm_i915_private {

struct i915_gem_mm mm;

/* Kernel Modesetting */

struct list_head global_obj_list;

bool mchbar_need_disable;

struct intel_l3_parity l3_parity;
Expand Down

0 comments on commit e2925e1

Please sign in to comment.