summaryrefslogtreecommitdiff
path: root/src/radeon_kms.c
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2018-07-11 18:42:58 +0200
committerMichel Dänzer <michel@daenzer.net>2018-07-12 18:08:34 +0200
commit4050b0ad51b1c65945c6474981d1228888738cd4 (patch)
tree4047304beafbede53d2c3e54008f0464130fd0fd /src/radeon_kms.c
parentcf8bc72e3473cef2b511e2c938eb00aca82de909 (diff)
Replace 'foo == NULL' with '!foo'
Shorter and sweeter. :) (Ported from amdgpu commit e8e688f3852fb06b0c34ed5bce47c9493bcd1613) Acked-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'src/radeon_kms.c')
-rw-r--r--src/radeon_kms.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/radeon_kms.c b/src/radeon_kms.c
index 15dca0de..36840ad3 100644
--- a/src/radeon_kms.c
+++ b/src/radeon_kms.c
@@ -639,7 +639,7 @@ master_has_sync_shared_pixmap(ScrnInfoPtr scrn, PixmapDirtyUpdatePtr dirty)
{
ScreenPtr master_screen = radeon_dirty_master(dirty);
- return master_screen->SyncSharedPixmap != NULL;
+ return !!master_screen->SyncSharedPixmap;
}
static Bool
@@ -647,7 +647,7 @@ slave_has_sync_shared_pixmap(ScrnInfoPtr scrn, PixmapDirtyUpdatePtr dirty)
{
ScreenPtr slave_screen = dirty->slave_dst->drawable.pScreen;
- return slave_screen->SyncSharedPixmap != NULL;
+ return !!slave_screen->SyncSharedPixmap;
}
static void
@@ -1769,7 +1769,7 @@ Bool RADEONPreInit_KMS(ScrnInfoPtr pScrn, int flags)
info->dri2.available = FALSE;
info->dri2.enabled = FALSE;
info->dri2.pKernelDRMVersion = drmGetVersion(pRADEONEnt->fd);
- if (info->dri2.pKernelDRMVersion == NULL) {
+ if (!info->dri2.pKernelDRMVersion) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"RADEONDRIGetVersion failed to get the DRM version\n");
return FALSE;
@@ -1924,7 +1924,7 @@ Bool RADEONPreInit_KMS(ScrnInfoPtr pScrn, int flags)
xf86OutputPtr output = xf86_config->output[i];
/* XXX: double check crtc mode */
- if ((output->probed_modes != NULL) && (output->crtc == NULL))
+ if (output->probed_modes && !output->crtc)
output->crtc = xf86_config->crtc[0];
}
}
@@ -1987,7 +1987,7 @@ Bool RADEONPreInit_KMS(ScrnInfoPtr pScrn, int flags)
if (!xf86LoadSubModule(pScrn, "ramdac")) return FALSE;
}
- if (pScrn->modes == NULL
+ if (!pScrn->modes
#ifdef XSERVER_PLATFORM_BUS
&& !pScrn->is_gpu
#endif
@@ -2098,7 +2098,7 @@ static Bool RADEONSaveScreen_KMS(ScreenPtr pScreen, int mode)
unblank = xf86IsUnblank(mode);
if (unblank) SetTimeSinceLastInputEvent();
- if ((pScrn != NULL) && pScrn->vtSema) {
+ if (pScrn && pScrn->vtSema) {
if (unblank)
RADEONUnblank(pScrn);
else
@@ -2287,7 +2287,7 @@ Bool RADEONScreenInit_KMS(ScreenPtr pScreen, int argc, char **argv)
info->fb_shadow = calloc(1,
pScrn->displayWidth * pScrn->virtualY *
((pScrn->bitsPerPixel + 7) >> 3));
- if (info->fb_shadow == NULL) {
+ if (!info->fb_shadow) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Failed to allocate shadow framebuffer\n");
return FALSE;
@@ -2689,13 +2689,13 @@ static Bool radeon_setup_kernel_mem(ScreenPtr pScreen)
int pitch;
uint32_t tiling_flags = 0;
- if (info->accel_state->exa != NULL) {
+ if (info->accel_state->exa) {
xf86DrvMsg(pScreen->myNum, X_ERROR, "Memory map already initialized\n");
return FALSE;
}
if (!info->use_glamor && info->r600_shadow_fb == FALSE) {
info->accel_state->exa = exaDriverAlloc();
- if (info->accel_state->exa == NULL) {
+ if (!info->accel_state->exa) {
xf86DrvMsg(pScreen->myNum, X_ERROR, "exaDriverAlloc failed\n");
return FALSE;
}
@@ -2709,7 +2709,7 @@ static Bool radeon_setup_kernel_mem(ScreenPtr pScreen)
cursor_size = RADEON_ALIGN(cursor_size, RADEON_GPU_PAGE_SIZE);
for (c = 0; c < xf86_config->num_crtc; c++) {
/* cursor objects */
- if (info->cursor_bo[c] == NULL) {
+ if (!info->cursor_bo[c]) {
info->cursor_bo[c] = radeon_bo_open(info->bufmgr, 0,
cursor_size, 0,
RADEON_GEM_DOMAIN_VRAM, 0);
@@ -2727,7 +2727,7 @@ static Bool radeon_setup_kernel_mem(ScreenPtr pScreen)
}
}
- if (info->front_buffer == NULL) {
+ if (!info->front_buffer) {
int usage = CREATE_PIXMAP_USAGE_BACKING_PIXMAP;
if (info->allowColorTiling && !info->shadow_primary) {
@@ -2787,9 +2787,8 @@ void radeon_kms_update_vram_limit(ScrnInfoPtr pScrn, uint32_t new_fb_size)
int c;
for (c = 0; c < xf86_config->num_crtc; c++) {
- if (info->cursor_bo[c] != NULL) {
+ if (info->cursor_bo[c])
new_fb_size += (64 * 4 * 64);
- }
}
remain_size_bytes = info->vram_size - new_fb_size;