Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9b82f3e6 authored by Geert Uytterhoeven's avatar Geert Uytterhoeven Committed by Paul Mackerras
Browse files

powerpc/ps3: Replace the flip_ctl logic in ps3av and ps3fb by a mutex



Introduce ps3_gpu_mutex to synchronizes GPU-related operations, like:
  - invoking the L1GPU_CONTEXT_ATTRIBUTE_FB_BLIT command using the
    lv1_gpu_context_attribute() hypervisor call,
  - handling the PS3AV_CID_AVB_PARAM packet in the PS3 A/V Settings driver.

Signed-off-by: default avatarGeert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: default avatarGeoff Levand <geoffrey.levand@am.sony.com>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 486936cd
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -516,4 +516,7 @@ void ps3_sync_irq(int node);
u32 ps3_get_hw_thread_id(int cpu);
u64 ps3_get_spe_id(void *arg);

/* mutex synchronizing GPU accesses and video mode changes */
extern struct mutex ps3_gpu_mutex;

#endif
+0 −4
Original line number Diff line number Diff line
@@ -740,8 +740,4 @@ extern int ps3av_audio_mute(int);
extern int ps3av_audio_mute_analog(int);
extern int ps3av_dev_open(void);
extern int ps3av_dev_close(void);
extern void ps3av_register_flip_ctl(void (*flip_ctl)(int on, void *data),
				    void *flip_data);
extern void ps3av_flip_ctl(int on);

#endif	/* _ASM_POWERPC_PS3AV_H_ */
+4 −0
Original line number Diff line number Diff line
@@ -42,6 +42,10 @@
#define DBG pr_debug
#endif

/* mutex synchronizing GPU accesses and video mode changes */
DEFINE_MUTEX(ps3_gpu_mutex);
EXPORT_SYMBOL_GPL(ps3_gpu_mutex);

#if !defined(CONFIG_SMP)
static void smp_send_stop(void) {}
#endif
+0 −20
Original line number Diff line number Diff line
@@ -59,8 +59,6 @@ static struct ps3av {
		struct ps3av_reply_hdr reply_hdr;
		u8 raw[PS3AV_BUF_SIZE];
	} recv_buf;
	void (*flip_ctl)(int on, void *data);
	void *flip_data;
} *ps3av;

/* color space */
@@ -939,24 +937,6 @@ int ps3av_audio_mute(int mute)

EXPORT_SYMBOL_GPL(ps3av_audio_mute);

void ps3av_register_flip_ctl(void (*flip_ctl)(int on, void *data),
			     void *flip_data)
{
	mutex_lock(&ps3av->mutex);
	ps3av->flip_ctl = flip_ctl;
	ps3av->flip_data = flip_data;
	mutex_unlock(&ps3av->mutex);
}
EXPORT_SYMBOL_GPL(ps3av_register_flip_ctl);

void ps3av_flip_ctl(int on)
{
	mutex_lock(&ps3av->mutex);
	if (ps3av->flip_ctl)
		ps3av->flip_ctl(on, ps3av->flip_data);
	mutex_unlock(&ps3av->mutex);
}

static int ps3av_probe(struct ps3_system_bus_device *dev)
{
	int res;
+2 −2
Original line number Diff line number Diff line
@@ -864,7 +864,7 @@ int ps3av_cmd_avb_param(struct ps3av_pkt_avb_param *avb, u32 send_len)
{
	int res;

	ps3av_flip_ctl(0);	/* flip off */
	mutex_lock(&ps3_gpu_mutex);

	/* avb packet */
	res = ps3av_do_pkt(PS3AV_CID_AVB_PARAM, send_len, sizeof(*avb),
@@ -878,7 +878,7 @@ int ps3av_cmd_avb_param(struct ps3av_pkt_avb_param *avb, u32 send_len)
			 res);

      out:
	ps3av_flip_ctl(1);	/* flip on */
	mutex_unlock(&ps3_gpu_mutex);
	return res;
}

Loading