diff options
Diffstat (limited to 'drivers/gpu/drm/arm/display')
8 files changed, 41 insertions, 42 deletions
diff --git a/drivers/gpu/drm/arm/display/include/malidp_utils.h b/drivers/gpu/drm/arm/display/include/malidp_utils.h index 3bc383d5bf73..49a1d7f3539c 100644 --- a/drivers/gpu/drm/arm/display/include/malidp_utils.h +++ b/drivers/gpu/drm/arm/display/include/malidp_utils.h @@ -13,9 +13,6 @@  #define has_bit(nr, mask)	(BIT(nr) & (mask))  #define has_bits(bits, mask)	(((bits) & (mask)) == (bits)) -#define dp_for_each_set_bit(bit, mask) \ -	for_each_set_bit((bit), ((unsigned long *)&(mask)), sizeof(mask) * 8) -  #define dp_wait_cond(__cond, __tries, __min_range, __max_range)	\  ({							\  	int num_tries = __tries;			\ diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_dev.c b/drivers/gpu/drm/arm/display/komeda/komeda_dev.c index ca891ae14d36..cc7664c95a54 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_dev.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_dev.c @@ -62,7 +62,7 @@ core_id_show(struct device *dev, struct device_attribute *attr, char *buf)  {  	struct komeda_dev *mdev = dev_to_mdev(dev); -	return snprintf(buf, PAGE_SIZE, "0x%08x\n", mdev->chip.core_id); +	return sysfs_emit(buf, "0x%08x\n", mdev->chip.core_id);  }  static DEVICE_ATTR_RO(core_id); @@ -85,7 +85,7 @@ config_id_show(struct device *dev, struct device_attribute *attr, char *buf)  		if (pipe->layers[i]->layer_type == KOMEDA_FMT_RICH_LAYER)  			config_id.n_richs++;  	} -	return snprintf(buf, PAGE_SIZE, "0x%08x\n", config_id.value); +	return sysfs_emit(buf, "0x%08x\n", config_id.value);  }  static DEVICE_ATTR_RO(config_id); @@ -94,7 +94,7 @@ aclk_hz_show(struct device *dev, struct device_attribute *attr, char *buf)  {  	struct komeda_dev *mdev = dev_to_mdev(dev); -	return snprintf(buf, PAGE_SIZE, "%lu\n", clk_get_rate(mdev->aclk)); +	return sysfs_emit(buf, "%lu\n", clk_get_rate(mdev->aclk));  }  static DEVICE_ATTR_RO(aclk_hz); diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_format_caps.h b/drivers/gpu/drm/arm/display/komeda/komeda_format_caps.h index 32273cf18f7c..cf7a183f773d 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_format_caps.h +++ b/drivers/gpu/drm/arm/display/komeda/komeda_format_caps.h @@ -82,17 +82,6 @@ struct komeda_format_caps_table {  extern u64 komeda_supported_modifiers[]; -static inline const char *komeda_get_format_name(u32 fourcc, u64 modifier) -{ -	struct drm_format_name_buf buf; -	static char name[64]; - -	snprintf(name, sizeof(name), "%s with modifier: 0x%llx.", -		 drm_get_format_name(fourcc, &buf), modifier); - -	return name; -} -  const struct komeda_format_caps *  komeda_get_format_caps(struct komeda_format_caps_table *table,  		       u32 fourcc, u64 modifier); diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c b/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c index 170f9dc8ec19..3c372d2deb0a 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_framebuffer.c @@ -276,8 +276,8 @@ bool komeda_fb_is_layer_supported(struct komeda_fb *kfb, u32 layer_type,  	supported = komeda_format_mod_supported(&mdev->fmt_tbl, layer_type,  						fourcc, modifier, rot);  	if (!supported) -		DRM_DEBUG_ATOMIC("Layer TYPE: %d doesn't support fb FMT: %s.\n", -			layer_type, komeda_get_format_name(fourcc, modifier)); +		DRM_DEBUG_ATOMIC("Layer TYPE: %d doesn't support fb FMT: %p4cc with modifier: 0x%llx.\n", +				 layer_type, &fourcc, modifier);  	return supported;  } diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_kms.c b/drivers/gpu/drm/arm/display/komeda/komeda_kms.c index 034ee08482e0..aeda4e5ec4f4 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_kms.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_kms.c @@ -73,6 +73,7 @@ static const struct drm_driver komeda_kms_driver = {  static void komeda_kms_commit_tail(struct drm_atomic_state *old_state)  {  	struct drm_device *dev = old_state->dev; +	bool fence_cookie = dma_fence_begin_signalling();  	drm_atomic_helper_commit_modeset_disables(dev, old_state); @@ -85,6 +86,8 @@ static void komeda_kms_commit_tail(struct drm_atomic_state *old_state)  	drm_atomic_helper_wait_for_flip_done(dev, old_state); +	dma_fence_end_signalling(fence_cookie); +  	drm_atomic_helper_cleanup_planes(dev, old_state);  } diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.c b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.c index 719a79728e24..06c595378dda 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline.c @@ -46,8 +46,9 @@ void komeda_pipeline_destroy(struct komeda_dev *mdev,  {  	struct komeda_component *c;  	int i; +	unsigned long avail_comps = pipe->avail_comps; -	dp_for_each_set_bit(i, pipe->avail_comps) { +	for_each_set_bit(i, &avail_comps, 32) {  		c = komeda_pipeline_get_component(pipe, i);  		komeda_component_destroy(mdev, c);  	} @@ -247,6 +248,7 @@ static void komeda_pipeline_dump(struct komeda_pipeline *pipe)  {  	struct komeda_component *c;  	int id; +	unsigned long avail_comps = pipe->avail_comps;  	DRM_INFO("Pipeline-%d: n_layers: %d, n_scalers: %d, output: %s.\n",  		 pipe->id, pipe->n_layers, pipe->n_scalers, @@ -258,7 +260,7 @@ static void komeda_pipeline_dump(struct komeda_pipeline *pipe)  		 pipe->of_output_links[1] ?  		 pipe->of_output_links[1]->full_name : "none"); -	dp_for_each_set_bit(id, pipe->avail_comps) { +	for_each_set_bit(id, &avail_comps, 32) {  		c = komeda_pipeline_get_component(pipe, id);  		komeda_component_dump(c); @@ -270,8 +272,9 @@ static void komeda_component_verify_inputs(struct komeda_component *c)  	struct komeda_pipeline *pipe = c->pipeline;  	struct komeda_component *input;  	int id; +	unsigned long supported_inputs = c->supported_inputs; -	dp_for_each_set_bit(id, c->supported_inputs) { +	for_each_set_bit(id, &supported_inputs, 32) {  		input = komeda_pipeline_get_component(pipe, id);  		if (!input) {  			c->supported_inputs &= ~(BIT(id)); @@ -302,8 +305,9 @@ static void komeda_pipeline_assemble(struct komeda_pipeline *pipe)  	struct komeda_component *c;  	struct komeda_layer *layer;  	int i, id; +	unsigned long avail_comps = pipe->avail_comps; -	dp_for_each_set_bit(id, pipe->avail_comps) { +	for_each_set_bit(id, &avail_comps, 32) {  		c = komeda_pipeline_get_component(pipe, id);  		komeda_component_verify_inputs(c);  	} @@ -355,13 +359,15 @@ void komeda_pipeline_dump_register(struct komeda_pipeline *pipe,  {  	struct komeda_component *c;  	u32 id; +	unsigned long avail_comps;  	seq_printf(sf, "\n======== Pipeline-%d ==========\n", pipe->id);  	if (pipe->funcs && pipe->funcs->dump_register)  		pipe->funcs->dump_register(pipe, sf); -	dp_for_each_set_bit(id, pipe->avail_comps) { +	avail_comps = pipe->avail_comps; +	for_each_set_bit(id, &avail_comps, 32) {  		c = komeda_pipeline_get_component(pipe, id);  		seq_printf(sf, "\n------%s------\n", c->name); diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c index 5c085116de3f..e672b9cffee3 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_pipeline_state.c @@ -1231,14 +1231,15 @@ komeda_pipeline_unbound_components(struct komeda_pipeline *pipe,  	struct komeda_pipeline_state *old = priv_to_pipe_st(pipe->obj.state);  	struct komeda_component_state *c_st;  	struct komeda_component *c; -	u32 disabling_comps, id; +	u32 id; +	unsigned long disabling_comps;  	WARN_ON(!old);  	disabling_comps = (~new->active_comps) & old->active_comps;  	/* unbound all disabling component */ -	dp_for_each_set_bit(id, disabling_comps) { +	for_each_set_bit(id, &disabling_comps, 32) {  		c = komeda_pipeline_get_component(pipe, id);  		c_st = komeda_component_get_state_and_set_user(c,  				drm_st, NULL, new->crtc); @@ -1286,7 +1287,8 @@ bool komeda_pipeline_disable(struct komeda_pipeline *pipe,  	struct komeda_pipeline_state *old;  	struct komeda_component *c;  	struct komeda_component_state *c_st; -	u32 id, disabling_comps = 0; +	u32 id; +	unsigned long disabling_comps;  	old = komeda_pipeline_get_old_state(pipe, old_state); @@ -1296,10 +1298,10 @@ bool komeda_pipeline_disable(struct komeda_pipeline *pipe,  		disabling_comps = old->active_comps &  				  pipe->standalone_disabled_comps; -	DRM_DEBUG_ATOMIC("PIPE%d: active_comps: 0x%x, disabling_comps: 0x%x.\n", +	DRM_DEBUG_ATOMIC("PIPE%d: active_comps: 0x%x, disabling_comps: 0x%lx.\n",  			 pipe->id, old->active_comps, disabling_comps); -	dp_for_each_set_bit(id, disabling_comps) { +	for_each_set_bit(id, &disabling_comps, 32) {  		c = komeda_pipeline_get_component(pipe, id);  		c_st = priv_to_comp_st(c->obj.state); @@ -1330,16 +1332,17 @@ void komeda_pipeline_update(struct komeda_pipeline *pipe,  	struct komeda_pipeline_state *new = priv_to_pipe_st(pipe->obj.state);  	struct komeda_pipeline_state *old;  	struct komeda_component *c; -	u32 id, changed_comps = 0; +	u32 id; +	unsigned long changed_comps;  	old = komeda_pipeline_get_old_state(pipe, old_state);  	changed_comps = new->active_comps | old->active_comps; -	DRM_DEBUG_ATOMIC("PIPE%d: active_comps: 0x%x, changed: 0x%x.\n", +	DRM_DEBUG_ATOMIC("PIPE%d: active_comps: 0x%x, changed: 0x%lx.\n",  			 pipe->id, new->active_comps, changed_comps); -	dp_for_each_set_bit(id, changed_comps) { +	for_each_set_bit(id, &changed_comps, 32) {  		c = komeda_pipeline_get_component(pipe, id);  		if (new->active_comps & BIT(c->id)) diff --git a/drivers/gpu/drm/arm/display/komeda/komeda_plane.c b/drivers/gpu/drm/arm/display/komeda/komeda_plane.c index 98e915e325dd..d63d83800a8a 100644 --- a/drivers/gpu/drm/arm/display/komeda/komeda_plane.c +++ b/drivers/gpu/drm/arm/display/komeda/komeda_plane.c @@ -49,10 +49,8 @@ komeda_plane_init_data_flow(struct drm_plane_state *st,  	dflow->rot = drm_rotation_simplify(st->rotation, caps->supported_rots);  	if (!has_bits(dflow->rot, caps->supported_rots)) { -		DRM_DEBUG_ATOMIC("rotation(0x%x) isn't supported by %s.\n", -				 dflow->rot, -				 komeda_get_format_name(caps->fourcc, -							fb->modifier)); +		DRM_DEBUG_ATOMIC("rotation(0x%x) isn't supported by %p4cc with modifier: 0x%llx.\n", +				 dflow->rot, &caps->fourcc, fb->modifier);  		return -EINVAL;  	} @@ -71,20 +69,23 @@ komeda_plane_init_data_flow(struct drm_plane_state *st,   */  static int  komeda_plane_atomic_check(struct drm_plane *plane, -			  struct drm_plane_state *state) +			  struct drm_atomic_state *state)  { +	struct drm_plane_state *new_plane_state = drm_atomic_get_new_plane_state(state, +										 plane);  	struct komeda_plane *kplane = to_kplane(plane); -	struct komeda_plane_state *kplane_st = to_kplane_st(state); +	struct komeda_plane_state *kplane_st = to_kplane_st(new_plane_state);  	struct komeda_layer *layer = kplane->layer;  	struct drm_crtc_state *crtc_st;  	struct komeda_crtc_state *kcrtc_st;  	struct komeda_data_flow_cfg dflow;  	int err; -	if (!state->crtc || !state->fb) +	if (!new_plane_state->crtc || !new_plane_state->fb)  		return 0; -	crtc_st = drm_atomic_get_crtc_state(state->state, state->crtc); +	crtc_st = drm_atomic_get_crtc_state(state, +					    new_plane_state->crtc);  	if (IS_ERR(crtc_st) || !crtc_st->enable) {  		DRM_DEBUG_ATOMIC("Cannot update plane on a disabled CRTC.\n");  		return -EINVAL; @@ -96,7 +97,7 @@ komeda_plane_atomic_check(struct drm_plane *plane,  	kcrtc_st = to_kcrtc_st(crtc_st); -	err = komeda_plane_init_data_flow(state, kcrtc_st, &dflow); +	err = komeda_plane_init_data_flow(new_plane_state, kcrtc_st, &dflow);  	if (err)  		return err; @@ -115,7 +116,7 @@ komeda_plane_atomic_check(struct drm_plane *plane,   */  static void  komeda_plane_atomic_update(struct drm_plane *plane, -			   struct drm_plane_state *old_state) +			   struct drm_atomic_state *state)  {  }  | 
