Commit 773eb04d authored by Ben Skeggs's avatar Ben Skeggs
Browse files

drm/nouveau/disp: expose conn event class



This removes some now-unnecessary nesting of workqueues.

v2:
- use ?: (lyude)

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
parent ffd26641
Loading
Loading
Loading
Loading
+10 −0
Original line number Original line Diff line number Diff line
@@ -2,6 +2,7 @@
#ifndef __NVIF_CONN_H__
#ifndef __NVIF_CONN_H__
#define __NVIF_CONN_H__
#define __NVIF_CONN_H__
#include <nvif/object.h>
#include <nvif/object.h>
#include <nvif/event.h>
struct nvif_disp;
struct nvif_disp;


struct nvif_conn {
struct nvif_conn {
@@ -11,8 +12,17 @@ struct nvif_conn {
int nvif_conn_ctor(struct nvif_disp *, const char *name, int id, struct nvif_conn *);
int nvif_conn_ctor(struct nvif_disp *, const char *name, int id, struct nvif_conn *);
void nvif_conn_dtor(struct nvif_conn *);
void nvif_conn_dtor(struct nvif_conn *);


static inline int
nvif_conn_id(struct nvif_conn *conn)
{
	return conn->object.handle;
}

#define NVIF_CONN_HPD_STATUS_UNSUPPORTED 0 /* negative if query fails */
#define NVIF_CONN_HPD_STATUS_UNSUPPORTED 0 /* negative if query fails */
#define NVIF_CONN_HPD_STATUS_NOT_PRESENT 1
#define NVIF_CONN_HPD_STATUS_NOT_PRESENT 1
#define NVIF_CONN_HPD_STATUS_PRESENT     2
#define NVIF_CONN_HPD_STATUS_PRESENT     2
int nvif_conn_hpd_status(struct nvif_conn *);
int nvif_conn_hpd_status(struct nvif_conn *);

int nvif_conn_event_ctor(struct nvif_conn *, const char *name, nvif_event_func, u8 types,
			 struct nvif_event *);
#endif
#endif
+0 −19
Original line number Original line Diff line number Diff line
@@ -52,25 +52,6 @@ struct nvif_notify_rep_v0 {
	__u8  data[];	/* reply data (below) */
	__u8  data[];	/* reply data (below) */
};
};


struct nvif_notify_conn_req_v0 {
	/* nvif_notify_req ... */
	__u8  version;
#define NVIF_NOTIFY_CONN_V0_PLUG                                           0x01
#define NVIF_NOTIFY_CONN_V0_UNPLUG                                         0x02
#define NVIF_NOTIFY_CONN_V0_IRQ                                            0x04
#define NVIF_NOTIFY_CONN_V0_ANY                                            0x07
	__u8  mask;
	__u8  conn;
	__u8  pad03[5];
};

struct nvif_notify_conn_rep_v0 {
	/* nvif_notify_rep ... */
	__u8  version;
	__u8  mask;
	__u8  pad02[6];
};

struct nvif_notify_uevent_req {
struct nvif_notify_uevent_req {
	/* nvif_notify_req ... */
	/* nvif_notify_req ... */
};
};
+11 −0
Original line number Original line Diff line number Diff line
@@ -10,6 +10,17 @@ union nvif_conn_args {
	} v0;
	} v0;
};
};


union nvif_conn_event_args {
	struct nvif_conn_event_v0 {
		__u8 version;
#define NVIF_CONN_EVENT_V0_PLUG   0x01
#define NVIF_CONN_EVENT_V0_UNPLUG 0x02
#define NVIF_CONN_EVENT_V0_IRQ    0x04
		__u8 types;
		__u8 pad02[6];
	} v0;
};

#define NVIF_CONN_V0_HPD_STATUS 0x00000000
#define NVIF_CONN_V0_HPD_STATUS 0x00000000


union nvif_conn_hpd_status_args {
union nvif_conn_hpd_status_args {
+3 −3
Original line number Original line Diff line number Diff line
@@ -8,9 +8,6 @@
#include <subdev/bios/gpio.h>
#include <subdev/bios/gpio.h>


struct nvkm_gpio_ntfy_req {
struct nvkm_gpio_ntfy_req {
#define NVKM_GPIO_HI                                                       0x01
#define NVKM_GPIO_LO                                                       0x02
#define NVKM_GPIO_TOGGLED                                                  0x03
	u8 mask;
	u8 mask;
	u8 line;
	u8 line;
};
};
@@ -23,6 +20,9 @@ struct nvkm_gpio {
	const struct nvkm_gpio_func *func;
	const struct nvkm_gpio_func *func;
	struct nvkm_subdev subdev;
	struct nvkm_subdev subdev;


#define NVKM_GPIO_HI       BIT(0)
#define NVKM_GPIO_LO       BIT(1)
#define NVKM_GPIO_TOGGLED (NVKM_GPIO_HI | NVKM_GPIO_LO)
	struct nvkm_event event;
	struct nvkm_event event;
};
};


+5 −14
Original line number Original line Diff line number Diff line
@@ -7,20 +7,6 @@
#include <subdev/bios.h>
#include <subdev/bios.h>
#include <subdev/bios/i2c.h>
#include <subdev/bios/i2c.h>


struct nvkm_i2c_ntfy_req {
#define NVKM_I2C_PLUG                                                      0x01
#define NVKM_I2C_UNPLUG                                                    0x02
#define NVKM_I2C_IRQ                                                       0x04
#define NVKM_I2C_DONE                                                      0x08
#define NVKM_I2C_ANY                                                       0x0f
	u8 mask;
	u8 port;
};

struct nvkm_i2c_ntfy_rep {
	u8 mask;
};

struct nvkm_i2c_bus_probe {
struct nvkm_i2c_bus_probe {
	struct i2c_board_info dev;
	struct i2c_board_info dev;
	u8 udelay; /* set to 0 to use the standard delay */
	u8 udelay; /* set to 0 to use the standard delay */
@@ -79,6 +65,11 @@ struct nvkm_i2c {
	struct list_head bus;
	struct list_head bus;
	struct list_head aux;
	struct list_head aux;


#define NVKM_I2C_PLUG   BIT(0)
#define NVKM_I2C_UNPLUG BIT(1)
#define NVKM_I2C_IRQ    BIT(2)
#define NVKM_I2C_DONE   BIT(3)
#define NVKM_I2C_ANY   (NVKM_I2C_PLUG | NVKM_I2C_UNPLUG | NVKM_I2C_IRQ | NVKM_I2C_DONE)
	struct nvkm_event event;
	struct nvkm_event event;
};
};


Loading