Merge remote-tracking branch 'pfdo/drm-next' into drm-next
Pull in drm-next for the object find API changes. Fix the one place the API crashes. Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
@@ -262,6 +262,10 @@ enum {
|
||||
#define MHL_RAPK_UNSUPPORTED 0x02 /* Rcvd RAP action code not supported */
|
||||
#define MHL_RAPK_BUSY 0x03 /* Responder too busy to respond */
|
||||
|
||||
/* Bit masks for RCP messages */
|
||||
#define MHL_RCP_KEY_RELEASED_MASK 0x80
|
||||
#define MHL_RCP_KEY_ID_MASK 0x7F
|
||||
|
||||
/*
|
||||
* Error status codes for RCPE messages
|
||||
*/
|
||||
|
||||
+45
-49
@@ -585,12 +585,12 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p);
|
||||
*/
|
||||
#define for_each_oldnew_connector_in_state(__state, connector, old_connector_state, new_connector_state, __i) \
|
||||
for ((__i) = 0; \
|
||||
(__i) < (__state)->num_connector && \
|
||||
((connector) = (__state)->connectors[__i].ptr, \
|
||||
(old_connector_state) = (__state)->connectors[__i].old_state, \
|
||||
(new_connector_state) = (__state)->connectors[__i].new_state, 1); \
|
||||
(__i)++) \
|
||||
for_each_if (connector)
|
||||
(__i) < (__state)->num_connector; \
|
||||
(__i)++) \
|
||||
for_each_if ((__state)->connectors[__i].ptr && \
|
||||
((connector) = (__state)->connectors[__i].ptr, \
|
||||
(old_connector_state) = (__state)->connectors[__i].old_state, \
|
||||
(new_connector_state) = (__state)->connectors[__i].new_state, 1))
|
||||
|
||||
/**
|
||||
* for_each_old_connector_in_state - iterate over all connectors in an atomic update
|
||||
@@ -606,11 +606,11 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p);
|
||||
*/
|
||||
#define for_each_old_connector_in_state(__state, connector, old_connector_state, __i) \
|
||||
for ((__i) = 0; \
|
||||
(__i) < (__state)->num_connector && \
|
||||
((connector) = (__state)->connectors[__i].ptr, \
|
||||
(old_connector_state) = (__state)->connectors[__i].old_state, 1); \
|
||||
(__i)++) \
|
||||
for_each_if (connector)
|
||||
(__i) < (__state)->num_connector; \
|
||||
(__i)++) \
|
||||
for_each_if ((__state)->connectors[__i].ptr && \
|
||||
((connector) = (__state)->connectors[__i].ptr, \
|
||||
(old_connector_state) = (__state)->connectors[__i].old_state, 1))
|
||||
|
||||
/**
|
||||
* for_each_new_connector_in_state - iterate over all connectors in an atomic update
|
||||
@@ -626,11 +626,11 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p);
|
||||
*/
|
||||
#define for_each_new_connector_in_state(__state, connector, new_connector_state, __i) \
|
||||
for ((__i) = 0; \
|
||||
(__i) < (__state)->num_connector && \
|
||||
((connector) = (__state)->connectors[__i].ptr, \
|
||||
(new_connector_state) = (__state)->connectors[__i].new_state, 1); \
|
||||
(__i)++) \
|
||||
for_each_if (connector)
|
||||
(__i) < (__state)->num_connector; \
|
||||
(__i)++) \
|
||||
for_each_if ((__state)->connectors[__i].ptr && \
|
||||
((connector) = (__state)->connectors[__i].ptr, \
|
||||
(new_connector_state) = (__state)->connectors[__i].new_state, 1))
|
||||
|
||||
/**
|
||||
* for_each_oldnew_crtc_in_state - iterate over all CRTCs in an atomic update
|
||||
@@ -646,12 +646,12 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p);
|
||||
*/
|
||||
#define for_each_oldnew_crtc_in_state(__state, crtc, old_crtc_state, new_crtc_state, __i) \
|
||||
for ((__i) = 0; \
|
||||
(__i) < (__state)->dev->mode_config.num_crtc && \
|
||||
((crtc) = (__state)->crtcs[__i].ptr, \
|
||||
(old_crtc_state) = (__state)->crtcs[__i].old_state, \
|
||||
(new_crtc_state) = (__state)->crtcs[__i].new_state, 1); \
|
||||
(__i) < (__state)->dev->mode_config.num_crtc; \
|
||||
(__i)++) \
|
||||
for_each_if (crtc)
|
||||
for_each_if ((__state)->crtcs[__i].ptr && \
|
||||
((crtc) = (__state)->crtcs[__i].ptr, \
|
||||
(old_crtc_state) = (__state)->crtcs[__i].old_state, \
|
||||
(new_crtc_state) = (__state)->crtcs[__i].new_state, 1))
|
||||
|
||||
/**
|
||||
* for_each_old_crtc_in_state - iterate over all CRTCs in an atomic update
|
||||
@@ -666,11 +666,11 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p);
|
||||
*/
|
||||
#define for_each_old_crtc_in_state(__state, crtc, old_crtc_state, __i) \
|
||||
for ((__i) = 0; \
|
||||
(__i) < (__state)->dev->mode_config.num_crtc && \
|
||||
((crtc) = (__state)->crtcs[__i].ptr, \
|
||||
(old_crtc_state) = (__state)->crtcs[__i].old_state, 1); \
|
||||
(__i) < (__state)->dev->mode_config.num_crtc; \
|
||||
(__i)++) \
|
||||
for_each_if (crtc)
|
||||
for_each_if ((__state)->crtcs[__i].ptr && \
|
||||
((crtc) = (__state)->crtcs[__i].ptr, \
|
||||
(old_crtc_state) = (__state)->crtcs[__i].old_state, 1))
|
||||
|
||||
/**
|
||||
* for_each_new_crtc_in_state - iterate over all CRTCs in an atomic update
|
||||
@@ -685,11 +685,11 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p);
|
||||
*/
|
||||
#define for_each_new_crtc_in_state(__state, crtc, new_crtc_state, __i) \
|
||||
for ((__i) = 0; \
|
||||
(__i) < (__state)->dev->mode_config.num_crtc && \
|
||||
((crtc) = (__state)->crtcs[__i].ptr, \
|
||||
(new_crtc_state) = (__state)->crtcs[__i].new_state, 1); \
|
||||
(__i) < (__state)->dev->mode_config.num_crtc; \
|
||||
(__i)++) \
|
||||
for_each_if (crtc)
|
||||
for_each_if ((__state)->crtcs[__i].ptr && \
|
||||
((crtc) = (__state)->crtcs[__i].ptr, \
|
||||
(new_crtc_state) = (__state)->crtcs[__i].new_state, 1))
|
||||
|
||||
/**
|
||||
* for_each_oldnew_plane_in_state - iterate over all planes in an atomic update
|
||||
@@ -705,12 +705,12 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p);
|
||||
*/
|
||||
#define for_each_oldnew_plane_in_state(__state, plane, old_plane_state, new_plane_state, __i) \
|
||||
for ((__i) = 0; \
|
||||
(__i) < (__state)->dev->mode_config.num_total_plane && \
|
||||
((plane) = (__state)->planes[__i].ptr, \
|
||||
(old_plane_state) = (__state)->planes[__i].old_state, \
|
||||
(new_plane_state) = (__state)->planes[__i].new_state, 1); \
|
||||
(__i) < (__state)->dev->mode_config.num_total_plane; \
|
||||
(__i)++) \
|
||||
for_each_if (plane)
|
||||
for_each_if ((__state)->planes[__i].ptr && \
|
||||
((plane) = (__state)->planes[__i].ptr, \
|
||||
(old_plane_state) = (__state)->planes[__i].old_state,\
|
||||
(new_plane_state) = (__state)->planes[__i].new_state, 1))
|
||||
|
||||
/**
|
||||
* for_each_old_plane_in_state - iterate over all planes in an atomic update
|
||||
@@ -725,12 +725,11 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p);
|
||||
*/
|
||||
#define for_each_old_plane_in_state(__state, plane, old_plane_state, __i) \
|
||||
for ((__i) = 0; \
|
||||
(__i) < (__state)->dev->mode_config.num_total_plane && \
|
||||
((plane) = (__state)->planes[__i].ptr, \
|
||||
(old_plane_state) = (__state)->planes[__i].old_state, 1); \
|
||||
(__i) < (__state)->dev->mode_config.num_total_plane; \
|
||||
(__i)++) \
|
||||
for_each_if (plane)
|
||||
|
||||
for_each_if ((__state)->planes[__i].ptr && \
|
||||
((plane) = (__state)->planes[__i].ptr, \
|
||||
(old_plane_state) = (__state)->planes[__i].old_state, 1))
|
||||
/**
|
||||
* for_each_new_plane_in_state - iterate over all planes in an atomic update
|
||||
* @__state: &struct drm_atomic_state pointer
|
||||
@@ -744,11 +743,11 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p);
|
||||
*/
|
||||
#define for_each_new_plane_in_state(__state, plane, new_plane_state, __i) \
|
||||
for ((__i) = 0; \
|
||||
(__i) < (__state)->dev->mode_config.num_total_plane && \
|
||||
((plane) = (__state)->planes[__i].ptr, \
|
||||
(new_plane_state) = (__state)->planes[__i].new_state, 1); \
|
||||
(__i) < (__state)->dev->mode_config.num_total_plane; \
|
||||
(__i)++) \
|
||||
for_each_if (plane)
|
||||
for_each_if ((__state)->planes[__i].ptr && \
|
||||
((plane) = (__state)->planes[__i].ptr, \
|
||||
(new_plane_state) = (__state)->planes[__i].new_state, 1))
|
||||
|
||||
/**
|
||||
* for_each_oldnew_private_obj_in_state - iterate over all private objects in an atomic update
|
||||
@@ -768,8 +767,7 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p);
|
||||
((obj) = (__state)->private_objs[__i].ptr, \
|
||||
(old_obj_state) = (__state)->private_objs[__i].old_state, \
|
||||
(new_obj_state) = (__state)->private_objs[__i].new_state, 1); \
|
||||
(__i)++) \
|
||||
for_each_if (obj)
|
||||
(__i)++)
|
||||
|
||||
/**
|
||||
* for_each_old_private_obj_in_state - iterate over all private objects in an atomic update
|
||||
@@ -787,8 +785,7 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p);
|
||||
(__i) < (__state)->num_private_objs && \
|
||||
((obj) = (__state)->private_objs[__i].ptr, \
|
||||
(old_obj_state) = (__state)->private_objs[__i].old_state, 1); \
|
||||
(__i)++) \
|
||||
for_each_if (obj)
|
||||
(__i)++)
|
||||
|
||||
/**
|
||||
* for_each_new_private_obj_in_state - iterate over all private objects in an atomic update
|
||||
@@ -806,8 +803,7 @@ void drm_state_dump(struct drm_device *dev, struct drm_printer *p);
|
||||
(__i) < (__state)->num_private_objs && \
|
||||
((obj) = (__state)->private_objs[__i].ptr, \
|
||||
(new_obj_state) = (__state)->private_objs[__i].new_state, 1); \
|
||||
(__i)++) \
|
||||
for_each_if (obj)
|
||||
(__i)++)
|
||||
|
||||
/**
|
||||
* drm_atomic_crtc_needs_modeset - compute combined modeset need
|
||||
|
||||
@@ -939,10 +939,11 @@ static inline unsigned drm_connector_index(struct drm_connector *connector)
|
||||
* add takes a reference to it.
|
||||
*/
|
||||
static inline struct drm_connector *drm_connector_lookup(struct drm_device *dev,
|
||||
struct drm_file *file_priv,
|
||||
uint32_t id)
|
||||
{
|
||||
struct drm_mode_object *mo;
|
||||
mo = drm_mode_object_find(dev, id, DRM_MODE_OBJECT_CONNECTOR);
|
||||
mo = drm_mode_object_find(dev, file_priv, id, DRM_MODE_OBJECT_CONNECTOR);
|
||||
return mo ? obj_to_connector(mo) : NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -959,10 +959,11 @@ struct drm_crtc *drm_crtc_from_index(struct drm_device *dev, int idx);
|
||||
* userspace interface should be done using &drm_property.
|
||||
*/
|
||||
static inline struct drm_crtc *drm_crtc_find(struct drm_device *dev,
|
||||
uint32_t id)
|
||||
struct drm_file *file_priv,
|
||||
uint32_t id)
|
||||
{
|
||||
struct drm_mode_object *mo;
|
||||
mo = drm_mode_object_find(dev, id, DRM_MODE_OBJECT_CRTC);
|
||||
mo = drm_mode_object_find(dev, file_priv, id, DRM_MODE_OBJECT_CRTC);
|
||||
return mo ? obj_to_crtc(mo) : NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -752,6 +752,12 @@
|
||||
# define DP_PSR_SINK_INTERNAL_ERROR 7
|
||||
# define DP_PSR_SINK_STATE_MASK 0x07
|
||||
|
||||
#define DP_SYNCHRONIZATION_LATENCY_IN_SINK 0x2009 /* edp 1.4 */
|
||||
# define DP_MAX_RESYNC_FRAME_COUNT_MASK (0xf << 0)
|
||||
# define DP_MAX_RESYNC_FRAME_COUNT_SHIFT 0
|
||||
# define DP_LAST_ACTUAL_SYNCHRONIZATION_LATENCY_MASK (0xf << 4)
|
||||
# define DP_LAST_ACTUAL_SYNCHRONIZATION_LATENCY_SHIFT 4
|
||||
|
||||
#define DP_RECEIVER_ALPM_STATUS 0x200b /* eDP 1.4 */
|
||||
# define DP_ALPM_LOCK_TIMEOUT_ERROR (1 << 0)
|
||||
|
||||
|
||||
@@ -324,7 +324,7 @@ struct drm_driver {
|
||||
*/
|
||||
bool (*get_vblank_timestamp) (struct drm_device *dev, unsigned int pipe,
|
||||
int *max_error,
|
||||
struct timeval *vblank_time,
|
||||
ktime_t *vblank_time,
|
||||
bool in_vblank_irq);
|
||||
|
||||
/**
|
||||
|
||||
@@ -214,11 +214,12 @@ static inline bool drm_encoder_crtc_ok(struct drm_encoder *encoder,
|
||||
* drm_mode_object_find().
|
||||
*/
|
||||
static inline struct drm_encoder *drm_encoder_find(struct drm_device *dev,
|
||||
struct drm_file *file_priv,
|
||||
uint32_t id)
|
||||
{
|
||||
struct drm_mode_object *mo;
|
||||
|
||||
mo = drm_mode_object_find(dev, id, DRM_MODE_OBJECT_ENCODER);
|
||||
mo = drm_mode_object_find(dev, file_priv, id, DRM_MODE_OBJECT_ENCODER);
|
||||
|
||||
return mo ? obj_to_encoder(mo) : NULL;
|
||||
}
|
||||
|
||||
@@ -205,6 +205,7 @@ int drm_framebuffer_init(struct drm_device *dev,
|
||||
struct drm_framebuffer *fb,
|
||||
const struct drm_framebuffer_funcs *funcs);
|
||||
struct drm_framebuffer *drm_framebuffer_lookup(struct drm_device *dev,
|
||||
struct drm_file *file_priv,
|
||||
uint32_t id);
|
||||
void drm_framebuffer_remove(struct drm_framebuffer *fb);
|
||||
void drm_framebuffer_cleanup(struct drm_framebuffer *fb);
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
struct drm_object_properties;
|
||||
struct drm_property;
|
||||
struct drm_device;
|
||||
struct drm_file;
|
||||
|
||||
/**
|
||||
* struct drm_mode_object - base structure for modeset objects
|
||||
@@ -113,6 +114,7 @@ struct drm_object_properties {
|
||||
}
|
||||
|
||||
struct drm_mode_object *drm_mode_object_find(struct drm_device *dev,
|
||||
struct drm_file *file_priv,
|
||||
uint32_t id, uint32_t type);
|
||||
void drm_mode_object_get(struct drm_mode_object *obj);
|
||||
void drm_mode_object_put(struct drm_mode_object *obj);
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
#define __DRM_OF_H__
|
||||
|
||||
#include <linux/of_graph.h>
|
||||
#if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_DRM_PANEL_BRIDGE)
|
||||
#include <drm/drm_bridge.h>
|
||||
#endif
|
||||
|
||||
struct component_master_ops;
|
||||
struct component_match;
|
||||
@@ -67,6 +70,34 @@ static inline int drm_of_find_panel_or_bridge(const struct device_node *np,
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* drm_of_panel_bridge_remove - remove panel bridge
|
||||
* @np: device tree node containing panel bridge output ports
|
||||
*
|
||||
* Remove the panel bridge of a given DT node's port and endpoint number
|
||||
*
|
||||
* Returns zero if successful, or one of the standard error codes if it fails.
|
||||
*/
|
||||
static inline int drm_of_panel_bridge_remove(const struct device_node *np,
|
||||
int port, int endpoint)
|
||||
{
|
||||
#if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_DRM_PANEL_BRIDGE)
|
||||
struct drm_bridge *bridge;
|
||||
struct device_node *remote;
|
||||
|
||||
remote = of_graph_get_remote_node(np, port, endpoint);
|
||||
if (!remote)
|
||||
return -ENODEV;
|
||||
|
||||
bridge = of_drm_find_bridge(remote);
|
||||
drm_panel_bridge_remove(bridge);
|
||||
|
||||
return 0;
|
||||
#else
|
||||
return -EINVAL;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline int drm_of_encoder_active_endpoint_id(struct device_node *node,
|
||||
struct drm_encoder *encoder)
|
||||
{
|
||||
|
||||
@@ -597,10 +597,11 @@ int drm_mode_plane_set_obj_prop(struct drm_plane *plane,
|
||||
* drm_mode_object_find().
|
||||
*/
|
||||
static inline struct drm_plane *drm_plane_find(struct drm_device *dev,
|
||||
struct drm_file *file_priv,
|
||||
uint32_t id)
|
||||
{
|
||||
struct drm_mode_object *mo;
|
||||
mo = drm_mode_object_find(dev, id, DRM_MODE_OBJECT_PLANE);
|
||||
mo = drm_mode_object_find(dev, file_priv, id, DRM_MODE_OBJECT_PLANE);
|
||||
return mo ? obj_to_plane(mo) : NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -312,10 +312,11 @@ drm_property_unreference_blob(struct drm_property_blob *blob)
|
||||
* This function looks up the property object specified by id and returns it.
|
||||
*/
|
||||
static inline struct drm_property *drm_property_find(struct drm_device *dev,
|
||||
struct drm_file *file_priv,
|
||||
uint32_t id)
|
||||
{
|
||||
struct drm_mode_object *mo;
|
||||
mo = drm_mode_object_find(dev, id, DRM_MODE_OBJECT_PROPERTY);
|
||||
mo = drm_mode_object_find(dev, file_priv, id, DRM_MODE_OBJECT_PROPERTY);
|
||||
return mo ? obj_to_property(mo) : NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ struct drm_vblank_crtc {
|
||||
/**
|
||||
* @time: Vblank timestamp corresponding to @count.
|
||||
*/
|
||||
struct timeval time;
|
||||
ktime_t time;
|
||||
|
||||
/**
|
||||
* @refcount: Number of users/waiters of the vblank interrupt. Only when
|
||||
@@ -154,7 +154,7 @@ struct drm_vblank_crtc {
|
||||
int drm_vblank_init(struct drm_device *dev, unsigned int num_crtcs);
|
||||
u32 drm_crtc_vblank_count(struct drm_crtc *crtc);
|
||||
u32 drm_crtc_vblank_count_and_time(struct drm_crtc *crtc,
|
||||
struct timeval *vblanktime);
|
||||
ktime_t *vblanktime);
|
||||
void drm_crtc_send_vblank_event(struct drm_crtc *crtc,
|
||||
struct drm_pending_vblank_event *e);
|
||||
void drm_crtc_arm_vblank_event(struct drm_crtc *crtc,
|
||||
@@ -172,7 +172,7 @@ u32 drm_crtc_accurate_vblank_count(struct drm_crtc *crtc);
|
||||
|
||||
bool drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev,
|
||||
unsigned int pipe, int *max_error,
|
||||
struct timeval *vblank_time,
|
||||
ktime_t *vblank_time,
|
||||
bool in_vblank_irq);
|
||||
void drm_calc_timestamping_constants(struct drm_crtc *crtc,
|
||||
const struct drm_display_mode *mode);
|
||||
|
||||
@@ -339,7 +339,6 @@
|
||||
#define INTEL_KBL_GT1_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x5913, info), /* ULT GT1.5 */ \
|
||||
INTEL_VGA_DEVICE(0x5915, info), /* ULX GT1.5 */ \
|
||||
INTEL_VGA_DEVICE(0x5917, info), /* DT GT1.5 */ \
|
||||
INTEL_VGA_DEVICE(0x5906, info), /* ULT GT1 */ \
|
||||
INTEL_VGA_DEVICE(0x590E, info), /* ULX GT1 */ \
|
||||
INTEL_VGA_DEVICE(0x5902, info), /* DT GT1 */ \
|
||||
@@ -349,6 +348,7 @@
|
||||
|
||||
#define INTEL_KBL_GT2_IDS(info) \
|
||||
INTEL_VGA_DEVICE(0x5916, info), /* ULT GT2 */ \
|
||||
INTEL_VGA_DEVICE(0x5917, info), /* Mobile GT2 */ \
|
||||
INTEL_VGA_DEVICE(0x5921, info), /* ULT GT2F */ \
|
||||
INTEL_VGA_DEVICE(0x591E, info), /* ULX GT2 */ \
|
||||
INTEL_VGA_DEVICE(0x5912, info), /* DT GT2 */ \
|
||||
|
||||
Reference in New Issue
Block a user