mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2026-08-22 05:43:02 +00:00
lib/igt_kms: Simplify return value of kmstest_get_connector_config
A plain bool is enough. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
+8
-7
@@ -414,9 +414,9 @@ bool kmstest_get_connector_default_mode(int drm_fd, drmModeConnector *connector,
|
||||
return true;
|
||||
}
|
||||
|
||||
int kmstest_get_connector_config(int drm_fd, uint32_t connector_id,
|
||||
unsigned long crtc_idx_mask,
|
||||
struct kmstest_connector_config *config)
|
||||
bool kmstest_get_connector_config(int drm_fd, uint32_t connector_id,
|
||||
unsigned long crtc_idx_mask,
|
||||
struct kmstest_connector_config *config)
|
||||
{
|
||||
drmModeRes *resources;
|
||||
drmModeConnector *connector;
|
||||
@@ -493,7 +493,7 @@ found:
|
||||
|
||||
drmModeFreeResources(resources);
|
||||
|
||||
return 0;
|
||||
return true;
|
||||
err4:
|
||||
drmModeFreeEncoder(encoder);
|
||||
err3:
|
||||
@@ -501,7 +501,7 @@ err3:
|
||||
err2:
|
||||
drmModeFreeResources(resources);
|
||||
err1:
|
||||
return -1;
|
||||
return false;
|
||||
}
|
||||
|
||||
void kmstest_free_connector_config(struct kmstest_connector_config *config)
|
||||
@@ -651,7 +651,7 @@ static void igt_display_log_shift(igt_display_t *display, int shift)
|
||||
static void igt_output_refresh(igt_output_t *output)
|
||||
{
|
||||
igt_display_t *display = output->display;
|
||||
int ret;
|
||||
bool ret;
|
||||
unsigned long crtc_idx_mask;
|
||||
|
||||
/* we mask out the pipes already in use */
|
||||
@@ -659,11 +659,12 @@ static void igt_output_refresh(igt_output_t *output)
|
||||
|
||||
if (output->valid)
|
||||
kmstest_free_connector_config(&output->config);
|
||||
|
||||
ret = kmstest_get_connector_config(display->drm_fd,
|
||||
output->id,
|
||||
crtc_idx_mask,
|
||||
&output->config);
|
||||
if (ret == 0)
|
||||
if (ret)
|
||||
output->valid = true;
|
||||
else
|
||||
output->valid = false;
|
||||
|
||||
+3
-4
@@ -103,7 +103,6 @@ void kmstest_dump_mode(drmModeModeInfo *mode);
|
||||
int kmstest_get_pipe_from_crtc_id(int fd, int crtc_id);
|
||||
void kmstest_set_vt_graphics_mode(void);
|
||||
|
||||
|
||||
struct kmstest_connector_config {
|
||||
drmModeCrtc *crtc;
|
||||
drmModeConnector *connector;
|
||||
@@ -154,9 +153,9 @@ void kmstest_force_edid(int drm_fd, drmModeConnector *connector,
|
||||
|
||||
bool kmstest_get_connector_default_mode(int drm_fd, drmModeConnector *connector,
|
||||
drmModeModeInfo *mode);
|
||||
int kmstest_get_connector_config(int drm_fd, uint32_t connector_id,
|
||||
unsigned long crtc_idx_mask,
|
||||
struct kmstest_connector_config *config);
|
||||
bool kmstest_get_connector_config(int drm_fd, uint32_t connector_id,
|
||||
unsigned long crtc_idx_mask,
|
||||
struct kmstest_connector_config *config);
|
||||
void kmstest_free_connector_config(struct kmstest_connector_config *config);
|
||||
|
||||
void kmstest_set_connector_dpms(int fd, drmModeConnector *connector, int mode);
|
||||
|
||||
Reference in New Issue
Block a user