Added radeon backend for minigbm

This is useful for amd/radeon cards
based on gpu architecture preceding GCN 1.2

BUG=none
TEST=none

Change-Id: I54f1c84157ce691da1b595cb859dfca357d0b171
Reviewed-on: https://chromium-review.googlesource.com/593634
Commit-Ready: Stéphane Marchesin <marcheu@chromium.org>
Tested-by: Giri Kumar <giri@flintos.io>
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
diff --git a/radeon.c b/radeon.c
new file mode 100644
index 0000000..baf42ed
--- /dev/null
+++ b/radeon.c
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2017 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include "drv_priv.h"
+#include "helpers.h"
+#include "util.h"
+
+static const uint32_t render_target_formats[] = { DRM_FORMAT_ARGB8888, DRM_FORMAT_XRGB8888 };
+
+static int radeon_init(struct driver *drv)
+{
+	int ret;
+	ret = drv_add_combinations(drv, render_target_formats, ARRAY_SIZE(render_target_formats),
+				   &LINEAR_METADATA, BO_USE_RENDER_MASK);
+	if (ret)
+		return ret;
+
+	return drv_modify_linear_combinations(drv);
+}
+
+struct backend backend_radeon = {
+	.name = "radeon",
+	.init = radeon_init,
+	.bo_create = drv_dumb_bo_create,
+	.bo_destroy = drv_dumb_bo_destroy,
+	.bo_import = drv_prime_bo_import,
+	.bo_map = drv_dumb_bo_map,
+};