Commit a9dc3395 authored by Jani Nikula's avatar Jani Nikula

drm/i915/sdvo: switch to kernel types

Mixed C99 and kernel types use is getting ugly.	Prefer kernel types.

sed -i 's/\buint\(8\|16\|32\|64\)_t\b/u\1/g'

v2: rebase
Acked-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Acked-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: default avatarJosé Roberto de Souza <jose.souza@intel.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190118120125.15484-1-jani.nikula@intel.com
parent a81f781a
...@@ -76,7 +76,7 @@ struct intel_sdvo { ...@@ -76,7 +76,7 @@ struct intel_sdvo {
i915_reg_t sdvo_reg; i915_reg_t sdvo_reg;
/* Active outputs controlled by this SDVO output */ /* Active outputs controlled by this SDVO output */
uint16_t controlled_output; u16 controlled_output;
/* /*
* Capabilities of the SDVO device returned by * Capabilities of the SDVO device returned by
...@@ -91,12 +91,12 @@ struct intel_sdvo { ...@@ -91,12 +91,12 @@ struct intel_sdvo {
* For multiple function SDVO device, * For multiple function SDVO device,
* this is for current attached outputs. * this is for current attached outputs.
*/ */
uint16_t attached_output; u16 attached_output;
/* /*
* Hotplug activation bits for this device * Hotplug activation bits for this device
*/ */
uint16_t hotplug_active; u16 hotplug_active;
enum port port; enum port port;
...@@ -104,19 +104,19 @@ struct intel_sdvo { ...@@ -104,19 +104,19 @@ struct intel_sdvo {
bool has_hdmi_audio; bool has_hdmi_audio;
/* DDC bus used by this SDVO encoder */ /* DDC bus used by this SDVO encoder */
uint8_t ddc_bus; u8 ddc_bus;
/* /*
* the sdvo flag gets lost in round trip: dtd->adjusted_mode->dtd * the sdvo flag gets lost in round trip: dtd->adjusted_mode->dtd
*/ */
uint8_t dtd_sdvo_flags; u8 dtd_sdvo_flags;
}; };
struct intel_sdvo_connector { struct intel_sdvo_connector {
struct intel_connector base; struct intel_connector base;
/* Mark the type of connector */ /* Mark the type of connector */
uint16_t output_flag; u16 output_flag;
/* This contains all current supported TV format */ /* This contains all current supported TV format */
u8 tv_format_supported[TV_FORMAT_NUM]; u8 tv_format_supported[TV_FORMAT_NUM];
...@@ -184,7 +184,7 @@ to_intel_sdvo_connector(struct drm_connector *connector) ...@@ -184,7 +184,7 @@ to_intel_sdvo_connector(struct drm_connector *connector)
container_of((conn_state), struct intel_sdvo_connector_state, base.base) container_of((conn_state), struct intel_sdvo_connector_state, base.base)
static bool static bool
intel_sdvo_output_setup(struct intel_sdvo *intel_sdvo, uint16_t flags); intel_sdvo_output_setup(struct intel_sdvo *intel_sdvo, u16 flags);
static bool static bool
intel_sdvo_tv_create_property(struct intel_sdvo *intel_sdvo, intel_sdvo_tv_create_property(struct intel_sdvo *intel_sdvo,
struct intel_sdvo_connector *intel_sdvo_connector, struct intel_sdvo_connector *intel_sdvo_connector,
...@@ -746,9 +746,9 @@ static bool intel_sdvo_get_input_timing(struct intel_sdvo *intel_sdvo, ...@@ -746,9 +746,9 @@ static bool intel_sdvo_get_input_timing(struct intel_sdvo *intel_sdvo,
static bool static bool
intel_sdvo_create_preferred_input_timing(struct intel_sdvo *intel_sdvo, intel_sdvo_create_preferred_input_timing(struct intel_sdvo *intel_sdvo,
struct intel_sdvo_connector *intel_sdvo_connector, struct intel_sdvo_connector *intel_sdvo_connector,
uint16_t clock, u16 clock,
uint16_t width, u16 width,
uint16_t height) u16 height)
{ {
struct intel_sdvo_preferred_input_timing_args args; struct intel_sdvo_preferred_input_timing_args args;
...@@ -791,9 +791,9 @@ static bool intel_sdvo_set_clock_rate_mult(struct intel_sdvo *intel_sdvo, u8 val ...@@ -791,9 +791,9 @@ static bool intel_sdvo_set_clock_rate_mult(struct intel_sdvo *intel_sdvo, u8 val
static void intel_sdvo_get_dtd_from_mode(struct intel_sdvo_dtd *dtd, static void intel_sdvo_get_dtd_from_mode(struct intel_sdvo_dtd *dtd,
const struct drm_display_mode *mode) const struct drm_display_mode *mode)
{ {
uint16_t width, height; u16 width, height;
uint16_t h_blank_len, h_sync_len, v_blank_len, v_sync_len; u16 h_blank_len, h_sync_len, v_blank_len, v_sync_len;
uint16_t h_sync_offset, v_sync_offset; u16 h_sync_offset, v_sync_offset;
int mode_clock; int mode_clock;
memset(dtd, 0, sizeof(*dtd)); memset(dtd, 0, sizeof(*dtd));
...@@ -898,13 +898,13 @@ static bool intel_sdvo_check_supp_encode(struct intel_sdvo *intel_sdvo) ...@@ -898,13 +898,13 @@ static bool intel_sdvo_check_supp_encode(struct intel_sdvo *intel_sdvo)
} }
static bool intel_sdvo_set_encode(struct intel_sdvo *intel_sdvo, static bool intel_sdvo_set_encode(struct intel_sdvo *intel_sdvo,
uint8_t mode) u8 mode)
{ {
return intel_sdvo_set_value(intel_sdvo, SDVO_CMD_SET_ENCODE, &mode, 1); return intel_sdvo_set_value(intel_sdvo, SDVO_CMD_SET_ENCODE, &mode, 1);
} }
static bool intel_sdvo_set_colorimetry(struct intel_sdvo *intel_sdvo, static bool intel_sdvo_set_colorimetry(struct intel_sdvo *intel_sdvo,
uint8_t mode) u8 mode)
{ {
return intel_sdvo_set_value(intel_sdvo, SDVO_CMD_SET_COLORIMETRY, &mode, 1); return intel_sdvo_set_value(intel_sdvo, SDVO_CMD_SET_COLORIMETRY, &mode, 1);
} }
...@@ -913,11 +913,11 @@ static bool intel_sdvo_set_colorimetry(struct intel_sdvo *intel_sdvo, ...@@ -913,11 +913,11 @@ static bool intel_sdvo_set_colorimetry(struct intel_sdvo *intel_sdvo,
static void intel_sdvo_dump_hdmi_buf(struct intel_sdvo *intel_sdvo) static void intel_sdvo_dump_hdmi_buf(struct intel_sdvo *intel_sdvo)
{ {
int i, j; int i, j;
uint8_t set_buf_index[2]; u8 set_buf_index[2];
uint8_t av_split; u8 av_split;
uint8_t buf_size; u8 buf_size;
uint8_t buf[48]; u8 buf[48];
uint8_t *pos; u8 *pos;
intel_sdvo_get_value(encoder, SDVO_CMD_GET_HBUF_AV_SPLIT, &av_split, 1); intel_sdvo_get_value(encoder, SDVO_CMD_GET_HBUF_AV_SPLIT, &av_split, 1);
...@@ -940,11 +940,11 @@ static void intel_sdvo_dump_hdmi_buf(struct intel_sdvo *intel_sdvo) ...@@ -940,11 +940,11 @@ static void intel_sdvo_dump_hdmi_buf(struct intel_sdvo *intel_sdvo)
#endif #endif
static bool intel_sdvo_write_infoframe(struct intel_sdvo *intel_sdvo, static bool intel_sdvo_write_infoframe(struct intel_sdvo *intel_sdvo,
unsigned if_index, uint8_t tx_rate, unsigned int if_index, u8 tx_rate,
const uint8_t *data, unsigned length) const u8 *data, unsigned int length)
{ {
uint8_t set_buf_index[2] = { if_index, 0 }; u8 set_buf_index[2] = { if_index, 0 };
uint8_t hbuf_size, tmp[8]; u8 hbuf_size, tmp[8];
int i; int i;
if (!intel_sdvo_set_value(intel_sdvo, if (!intel_sdvo_set_value(intel_sdvo,
...@@ -984,7 +984,7 @@ static bool intel_sdvo_set_avi_infoframe(struct intel_sdvo *intel_sdvo, ...@@ -984,7 +984,7 @@ static bool intel_sdvo_set_avi_infoframe(struct intel_sdvo *intel_sdvo,
{ {
const struct drm_display_mode *adjusted_mode = const struct drm_display_mode *adjusted_mode =
&pipe_config->base.adjusted_mode; &pipe_config->base.adjusted_mode;
uint8_t sdvo_data[HDMI_INFOFRAME_SIZE(AVI)]; u8 sdvo_data[HDMI_INFOFRAME_SIZE(AVI)];
union hdmi_infoframe frame; union hdmi_infoframe frame;
int ret; int ret;
ssize_t len; ssize_t len;
...@@ -1017,7 +1017,7 @@ static bool intel_sdvo_set_tv_format(struct intel_sdvo *intel_sdvo, ...@@ -1017,7 +1017,7 @@ static bool intel_sdvo_set_tv_format(struct intel_sdvo *intel_sdvo,
const struct drm_connector_state *conn_state) const struct drm_connector_state *conn_state)
{ {
struct intel_sdvo_tv_format format; struct intel_sdvo_tv_format format;
uint32_t format_map; u32 format_map;
format_map = 1 << conn_state->tv.mode; format_map = 1 << conn_state->tv.mode;
memset(&format, 0, sizeof(format)); memset(&format, 0, sizeof(format));
...@@ -1208,7 +1208,7 @@ static void intel_sdvo_update_props(struct intel_sdvo *intel_sdvo, ...@@ -1208,7 +1208,7 @@ static void intel_sdvo_update_props(struct intel_sdvo *intel_sdvo,
const struct drm_connector_state *conn_state = &sdvo_state->base.base; const struct drm_connector_state *conn_state = &sdvo_state->base.base;
struct intel_sdvo_connector *intel_sdvo_conn = struct intel_sdvo_connector *intel_sdvo_conn =
to_intel_sdvo_connector(conn_state->connector); to_intel_sdvo_connector(conn_state->connector);
uint16_t val; u16 val;
if (intel_sdvo_conn->left) if (intel_sdvo_conn->left)
UPDATE_PROPERTY(sdvo_state->tv.overscan_h, OVERSCAN_H); UPDATE_PROPERTY(sdvo_state->tv.overscan_h, OVERSCAN_H);
...@@ -1692,10 +1692,10 @@ static bool intel_sdvo_get_capabilities(struct intel_sdvo *intel_sdvo, struct in ...@@ -1692,10 +1692,10 @@ static bool intel_sdvo_get_capabilities(struct intel_sdvo *intel_sdvo, struct in
return true; return true;
} }
static uint16_t intel_sdvo_get_hotplug_support(struct intel_sdvo *intel_sdvo) static u16 intel_sdvo_get_hotplug_support(struct intel_sdvo *intel_sdvo)
{ {
struct drm_i915_private *dev_priv = to_i915(intel_sdvo->base.base.dev); struct drm_i915_private *dev_priv = to_i915(intel_sdvo->base.base.dev);
uint16_t hotplug; u16 hotplug;
if (!I915_HAS_HOTPLUG(dev_priv)) if (!I915_HAS_HOTPLUG(dev_priv))
return 0; return 0;
...@@ -1826,7 +1826,7 @@ intel_sdvo_connector_matches_edid(struct intel_sdvo_connector *sdvo, ...@@ -1826,7 +1826,7 @@ intel_sdvo_connector_matches_edid(struct intel_sdvo_connector *sdvo,
static enum drm_connector_status static enum drm_connector_status
intel_sdvo_detect(struct drm_connector *connector, bool force) intel_sdvo_detect(struct drm_connector *connector, bool force)
{ {
uint16_t response; u16 response;
struct intel_sdvo *intel_sdvo = intel_attached_sdvo(connector); struct intel_sdvo *intel_sdvo = intel_attached_sdvo(connector);
struct intel_sdvo_connector *intel_sdvo_connector = to_intel_sdvo_connector(connector); struct intel_sdvo_connector *intel_sdvo_connector = to_intel_sdvo_connector(connector);
enum drm_connector_status ret; enum drm_connector_status ret;
...@@ -1977,7 +1977,7 @@ static void intel_sdvo_get_tv_modes(struct drm_connector *connector) ...@@ -1977,7 +1977,7 @@ static void intel_sdvo_get_tv_modes(struct drm_connector *connector)
struct intel_sdvo *intel_sdvo = intel_attached_sdvo(connector); struct intel_sdvo *intel_sdvo = intel_attached_sdvo(connector);
const struct drm_connector_state *conn_state = connector->state; const struct drm_connector_state *conn_state = connector->state;
struct intel_sdvo_sdtv_resolution_request tv_res; struct intel_sdvo_sdtv_resolution_request tv_res;
uint32_t reply = 0, format_map = 0; u32 reply = 0, format_map = 0;
int i; int i;
DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n", DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n",
...@@ -2062,7 +2062,7 @@ static int ...@@ -2062,7 +2062,7 @@ static int
intel_sdvo_connector_atomic_get_property(struct drm_connector *connector, intel_sdvo_connector_atomic_get_property(struct drm_connector *connector,
const struct drm_connector_state *state, const struct drm_connector_state *state,
struct drm_property *property, struct drm_property *property,
uint64_t *val) u64 *val)
{ {
struct intel_sdvo_connector *intel_sdvo_connector = to_intel_sdvo_connector(connector); struct intel_sdvo_connector *intel_sdvo_connector = to_intel_sdvo_connector(connector);
const struct intel_sdvo_connector_state *sdvo_state = to_intel_sdvo_connector_state((void *)state); const struct intel_sdvo_connector_state *sdvo_state = to_intel_sdvo_connector_state((void *)state);
...@@ -2121,7 +2121,7 @@ static int ...@@ -2121,7 +2121,7 @@ static int
intel_sdvo_connector_atomic_set_property(struct drm_connector *connector, intel_sdvo_connector_atomic_set_property(struct drm_connector *connector,
struct drm_connector_state *state, struct drm_connector_state *state,
struct drm_property *property, struct drm_property *property,
uint64_t val) u64 val)
{ {
struct intel_sdvo_connector *intel_sdvo_connector = to_intel_sdvo_connector(connector); struct intel_sdvo_connector *intel_sdvo_connector = to_intel_sdvo_connector(connector);
struct intel_sdvo_connector_state *sdvo_state = to_intel_sdvo_connector_state(state); struct intel_sdvo_connector_state *sdvo_state = to_intel_sdvo_connector_state(state);
...@@ -2270,7 +2270,7 @@ static const struct drm_encoder_funcs intel_sdvo_enc_funcs = { ...@@ -2270,7 +2270,7 @@ static const struct drm_encoder_funcs intel_sdvo_enc_funcs = {
static void static void
intel_sdvo_guess_ddc_bus(struct intel_sdvo *sdvo) intel_sdvo_guess_ddc_bus(struct intel_sdvo *sdvo)
{ {
uint16_t mask = 0; u16 mask = 0;
unsigned int num_bits; unsigned int num_bits;
/* /*
...@@ -2671,7 +2671,7 @@ intel_sdvo_lvds_init(struct intel_sdvo *intel_sdvo, int device) ...@@ -2671,7 +2671,7 @@ intel_sdvo_lvds_init(struct intel_sdvo *intel_sdvo, int device)
} }
static bool static bool
intel_sdvo_output_setup(struct intel_sdvo *intel_sdvo, uint16_t flags) intel_sdvo_output_setup(struct intel_sdvo *intel_sdvo, u16 flags)
{ {
/* SDVO requires XXX1 function may not exist unless it has XXX0 function.*/ /* SDVO requires XXX1 function may not exist unless it has XXX0 function.*/
...@@ -2747,7 +2747,7 @@ static bool intel_sdvo_tv_create_property(struct intel_sdvo *intel_sdvo, ...@@ -2747,7 +2747,7 @@ static bool intel_sdvo_tv_create_property(struct intel_sdvo *intel_sdvo,
{ {
struct drm_device *dev = intel_sdvo->base.base.dev; struct drm_device *dev = intel_sdvo->base.base.dev;
struct intel_sdvo_tv_format format; struct intel_sdvo_tv_format format;
uint32_t format_map, i; u32 format_map, i;
if (!intel_sdvo_set_target_output(intel_sdvo, type)) if (!intel_sdvo_set_target_output(intel_sdvo, type))
return false; return false;
...@@ -2814,7 +2814,7 @@ intel_sdvo_create_enhance_property_tv(struct intel_sdvo *intel_sdvo, ...@@ -2814,7 +2814,7 @@ intel_sdvo_create_enhance_property_tv(struct intel_sdvo *intel_sdvo,
struct drm_connector_state *conn_state = connector->state; struct drm_connector_state *conn_state = connector->state;
struct intel_sdvo_connector_state *sdvo_state = struct intel_sdvo_connector_state *sdvo_state =
to_intel_sdvo_connector_state(conn_state); to_intel_sdvo_connector_state(conn_state);
uint16_t response, data_value[2]; u16 response, data_value[2];
/* when horizontal overscan is supported, Add the left/right property */ /* when horizontal overscan is supported, Add the left/right property */
if (enhancements.overscan_h) { if (enhancements.overscan_h) {
...@@ -2925,7 +2925,7 @@ intel_sdvo_create_enhance_property_lvds(struct intel_sdvo *intel_sdvo, ...@@ -2925,7 +2925,7 @@ intel_sdvo_create_enhance_property_lvds(struct intel_sdvo *intel_sdvo,
{ {
struct drm_device *dev = intel_sdvo->base.base.dev; struct drm_device *dev = intel_sdvo->base.base.dev;
struct drm_connector *connector = &intel_sdvo_connector->base.base; struct drm_connector *connector = &intel_sdvo_connector->base.base;
uint16_t response, data_value[2]; u16 response, data_value[2];
ENHANCEMENT(&connector->state->tv, brightness, BRIGHTNESS); ENHANCEMENT(&connector->state->tv, brightness, BRIGHTNESS);
...@@ -2939,7 +2939,7 @@ static bool intel_sdvo_create_enhance_property(struct intel_sdvo *intel_sdvo, ...@@ -2939,7 +2939,7 @@ static bool intel_sdvo_create_enhance_property(struct intel_sdvo *intel_sdvo,
{ {
union { union {
struct intel_sdvo_enhancements_reply reply; struct intel_sdvo_enhancements_reply reply;
uint16_t response; u16 response;
} enhancements; } enhancements;
BUILD_BUG_ON(sizeof(enhancements) != 2); BUILD_BUG_ON(sizeof(enhancements) != 2);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment